diff --git a/aliasDefinition/_____SYSTEMALIAS/_____SYSTEMALIAS.aod b/aliasDefinition/_____SYSTEMALIAS/_____SYSTEMALIAS.aod index af693489da8162610b58c157de5a6fe0a1b8b41d..3c5aedffe5464e5e778a25b4372abeb59ea701e4 100644 --- a/aliasDefinition/_____SYSTEMALIAS/_____SYSTEMALIAS.aod +++ b/aliasDefinition/_____SYSTEMALIAS/_____SYSTEMALIAS.aod @@ -1712,7 +1712,7 @@ <entityDb> <name>ASYS_PERMISSIONSET</name> <dbName></dbName> - <idColumn>PERMISSIONSETID</idColumn> + <idColumn>ASYS_PERMISSIONSETID</idColumn> <idGeneratorType v="0" /> <idGeneratorInterval v="1" /> <documentation></documentation> @@ -1816,7 +1816,7 @@ <entityDb> <name>ASYS_PERMISSIONACTION</name> <dbName></dbName> - <idColumn>PERMISSIONACTIONID</idColumn> + <idColumn>ASYS_PERMISSIONACTIONID</idColumn> <idGeneratorType v="0" /> <idGeneratorInterval v="1" /> <documentation></documentation> diff --git a/entity/Activity_entity/Activity_entity.aod b/entity/Activity_entity/Activity_entity.aod index 0d0a112f0c5bf19ba9ee893659b494b388606b3b..d4c06eaeedeef0b7f545ecd501cc99da61458769 100644 --- a/entity/Activity_entity/Activity_entity.aod +++ b/entity/Activity_entity/Activity_entity.aod @@ -488,11 +488,6 @@ <entityName>Appointment_entity</entityName> <fieldName>LinkedAppointments</fieldName> </dependency> - <children> - <entityParameter> - <name>LinkedObjectId_param</name> - </entityParameter> - </children> </entityConsumer> <entityActionField> <name>newSupportticket</name> diff --git a/entity/Activity_entity/entityfields/attributes/children/objectrowid_param/code.js b/entity/Activity_entity/entityfields/attributes/children/objectrowid_param/code.js deleted file mode 100644 index a8267b62060b4bd30cedaba4713f4421a6e6f9ff..0000000000000000000000000000000000000000 --- a/entity/Activity_entity/entityfields/attributes/children/objectrowid_param/code.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.ACTIVITYID")); \ No newline at end of file diff --git a/entity/Activity_entity/entityfields/attributes/children/objecttype_param/code.js b/entity/Activity_entity/entityfields/attributes/children/objecttype_param/code.js deleted file mode 100644 index 008915f61deac19ccdd40fff81701de63eb3b6a2..0000000000000000000000000000000000000000 --- a/entity/Activity_entity/entityfields/attributes/children/objecttype_param/code.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.result"); -import("Context_lib"); - -result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/Activity_entity/entityfields/keywordcategory/children/containername_param/valueProcess.js b/entity/Activity_entity/entityfields/keywordcategory/children/containername_param/valueProcess.js deleted file mode 100644 index 7b43ff2f6bef70bf04cd150c46dd7d9f921cf5d0..0000000000000000000000000000000000000000 --- a/entity/Activity_entity/entityfields/keywordcategory/children/containername_param/valueProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.result"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); - -result.string($KeywordRegistry.activityCategory()); \ No newline at end of file diff --git a/entity/Activity_entity/entityfields/link/children/activityid_param/valueProcess.js b/entity/Activity_entity/entityfields/link/children/activityid_param/valueProcess.js deleted file mode 100644 index a8267b62060b4bd30cedaba4713f4421a6e6f9ff..0000000000000000000000000000000000000000 --- a/entity/Activity_entity/entityfields/link/children/activityid_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.ACTIVITYID")); \ No newline at end of file diff --git a/entity/Activity_entity/entityfields/moduletrees/children/contextname/valueProcess.js b/entity/Activity_entity/entityfields/moduletrees/children/contextname/valueProcess.js deleted file mode 100644 index 109d9bf5c8ea2825f9da796529721deab9a96d9f..0000000000000000000000000000000000000000 --- a/entity/Activity_entity/entityfields/moduletrees/children/contextname/valueProcess.js +++ /dev/null @@ -1,3 +0,0 @@ -import("system.result"); - -result.string("Activity"); \ No newline at end of file diff --git a/entity/Activity_entity/entityfields/newmail/onActionProcess.js b/entity/Activity_entity/entityfields/newmail/onActionProcess.js deleted file mode 100644 index 097887a005788a6f5cc554e228879456082c4f21..0000000000000000000000000000000000000000 --- a/entity/Activity_entity/entityfields/newmail/onActionProcess.js +++ /dev/null @@ -1,14 +0,0 @@ -import("system.db"); -import("system.vars"); -import("system.neon"); -import("KeywordRegistry_basic"); - - -var params = { - "DocumentTemplateType_param" : $KeywordRegistry.documentTemplateType$mail() -} - -//neon.openContext("DocumentTemplate", "DocumentTemplateFilterSmall_view", null, neon.OPERATINGSTATE_SEARCH, params); -//neon.openContext("DocumentTemplate", "DocumentTemplateFilterSmall_view", null, null, null, params); -neon.openContext("DocumentTemplate", null, null, neon.OPERATINGSTATE_SEARCH, params); - diff --git a/entity/AddressValidation_entity/entityfields/cityvalidatior/children/type_param/valueProcess.js b/entity/AddressValidation_entity/entityfields/cityvalidatior/children/type_param/valueProcess.js deleted file mode 100644 index 07a8e649c2c8a47b00f727a51543e5e695d7a7f5..0000000000000000000000000000000000000000 --- a/entity/AddressValidation_entity/entityfields/cityvalidatior/children/type_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("WsValidation_lib"); -import("system.result"); - -result.string(AddressValidationType.get().TYPE_CITY_NOMINATIM.key); \ No newline at end of file diff --git a/entity/AddressValidation_entity/entityfields/zipvalidator/children/type_param/valueProcess.js b/entity/AddressValidation_entity/entityfields/zipvalidator/children/type_param/valueProcess.js deleted file mode 100644 index fda16aa510156d5a9e059f1cb3a19ea1e72ef61e..0000000000000000000000000000000000000000 --- a/entity/AddressValidation_entity/entityfields/zipvalidator/children/type_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("WsValidation_lib"); -import("system.result"); - -result.string(AddressValidationType.get().TYPE_ZIP_NOMINATIM.key); \ No newline at end of file diff --git a/entity/Address_entity/Address_entity.aod b/entity/Address_entity/Address_entity.aod index 5e6122b2767b55c3ccc21429bfe61a9fe01d84d7..a8fab2595e8795a739e854e715f1669bbd0477ac 100644 --- a/entity/Address_entity/Address_entity.aod +++ b/entity/Address_entity/Address_entity.aod @@ -451,6 +451,7 @@ </entityField> <entityProvider> <name>QuickEntryAdresses</name> + <documentation>%aditoprj%/entity/Address_entity/entityfields/quickentryadresses/documentation.adoc</documentation> <dependencies> <entityDependency> <name>d677a301-2038-4ccd-baa1-5f986e290564</name> diff --git a/entity/Address_entity/conditionProcess.js b/entity/Address_entity/conditionProcess.js deleted file mode 100644 index 2a2a40bad76b7c7bf6a7845b81df92b5cfa85ee2..0000000000000000000000000000000000000000 --- a/entity/Address_entity/conditionProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("Sql_lib"); -import("system.db"); -import("system.result"); - -//TODO: use a preparedCondition (.build instead of .toString) when available #1030812 #1034026 -result.string(newWhereIfSet("ADDRESS.CONTACT_ID", "$param.ContactId_param").toString()); diff --git a/entity/Address_entity/entityfields/keywordaddresstype/children/containername_param/valueProcess.js b/entity/Address_entity/entityfields/keywordaddresstype/children/containername_param/valueProcess.js deleted file mode 100644 index 167d3dc35f38110620b4eb5e6004b4c4454578f2..0000000000000000000000000000000000000000 --- a/entity/Address_entity/entityfields/keywordaddresstype/children/containername_param/valueProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.result"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); - -result.string($KeywordRegistry.addressType()); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/orgaddresses/children/contacttype_param/code.js b/entity/Address_entity/entityfields/orgaddresses/children/contacttype_param/code.js deleted file mode 100644 index 85a095aeb8aaaff00b627db260104e8790cb3a03..0000000000000000000000000000000000000000 --- a/entity/Address_entity/entityfields/orgaddresses/children/contacttype_param/code.js +++ /dev/null @@ -1,3 +0,0 @@ -import("system.result"); - -result.object(1); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/persaddresses/children/contacttype_param/code.js b/entity/Address_entity/entityfields/persaddresses/children/contacttype_param/code.js deleted file mode 100644 index ee2a3d7dfb188a0e175b68c1cf815af5842aa34f..0000000000000000000000000000000000000000 --- a/entity/Address_entity/entityfields/persaddresses/children/contacttype_param/code.js +++ /dev/null @@ -1,3 +0,0 @@ -import("system.result"); - -result.object(2); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/quickentryadresses/documentation.adoc b/entity/Address_entity/entityfields/quickentryadresses/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..02f8ddcf3a0a317172962c6c7eafaaa7f7a86c12 --- /dev/null +++ b/entity/Address_entity/entityfields/quickentryadresses/documentation.adoc @@ -0,0 +1,3 @@ += QuickEntry_entity - Addresses + +Provides all addresses for QuickEntry \ No newline at end of file diff --git a/entity/Address_entity/recordcontainers/childgroup/affectedIds.js b/entity/Address_entity/recordcontainers/childgroup/affectedIds.js deleted file mode 100644 index cd9ce4eca596f562519fd3e40d69d57afad64c62..0000000000000000000000000000000000000000 --- a/entity/Address_entity/recordcontainers/childgroup/affectedIds.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.object([vars.getString("$local.idvalue")]); \ No newline at end of file diff --git a/entity/Address_entity/recordcontainers/childgroup/query.js b/entity/Address_entity/recordcontainers/childgroup/query.js deleted file mode 100644 index c0ba9e3c53936a0e77923eb3d126c5ac144cea1d..0000000000000000000000000000000000000000 --- a/entity/Address_entity/recordcontainers/childgroup/query.js +++ /dev/null @@ -1,22 +0,0 @@ -import("Sql_lib"); -import("system.db"); -import("system.result"); -import("system.vars"); - -var affectedIds; -if (vars.exists("$local.idvalue")) { - affectedIds = vars.get("$local.idvalue"); -} - -var addressSelect = newSelect("ADDRESS.ADDRESSID as \"_uid_\", \n\ - ADDRESS.ADDRESSID, \n\ - ADDRESS.ZIP as ZIP, \n\ - ADDRESS.CITY as CITY, \n\ - ADDRESS.COUNTRY, \n\ - ADDRESS.ADDRESS, \n\ - ADDRESS.BUILDINGNO") - .from("ADDRESS") - .whereIfSet("ADDRESS.ADDRESSID", affectedIds, SqlBuilder.IN()) - .orderBy("ADDRESS.ADDRESSID") - -result.string(addressSelect.toString("1=2")); \ No newline at end of file diff --git a/entity/AnyContact_entity/AnyContact_entity.aod b/entity/AnyContact_entity/AnyContact_entity.aod index 174d18bdf2e02d632566658b9ce602aacf9d7388..764fffc4fd77721dcdae4ec59576865446464b97 100644 --- a/entity/AnyContact_entity/AnyContact_entity.aod +++ b/entity/AnyContact_entity/AnyContact_entity.aod @@ -107,7 +107,6 @@ <description>Relation type. Value is based on the existance or non-existance of ORGANISATION_ID and PERSON_ID. See ContactUtils.getRelationTypeByPersOrg for possible values</description> <contentType>NUMBER</contentType> - <valueProcess>%aditoprj%/entity/AnyContact_entity/entityfields/contactType/valueProcess.js</valueProcess> </entityField> <entityField> <name>ORGANISATION_NAME</name> diff --git a/entity/AnyContact_entity/entityfields/contacttype/valueProcess.js b/entity/AnyContact_entity/entityfields/contacttype/valueProcess.js deleted file mode 100644 index 1974bb4d5a7c88145de2d44d53a22c00ece7aab3..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/entityfields/contacttype/valueProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.result"); -import("system.vars"); -import("Contact_lib") - -result.object(ContactUtils.getContactType(vars.get("$field.CONTACTID"), vars.get("$field.PERSON_ID"), vars.get("$field.ORGANISATION_ID"))); \ No newline at end of file diff --git a/entity/AnyContact_entity/entityfields/date_edit/valueProcess.js b/entity/AnyContact_entity/entityfields/date_edit/valueProcess.js deleted file mode 100644 index 710ac8a06a9911f82ff222c7d9d231846ca93fb2..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/entityfields/date_edit/valueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) - result.string(vars.getString("$sys.date")); \ No newline at end of file diff --git a/entity/AnyContact_entity/entityfields/date_new/valueProcess.js b/entity/AnyContact_entity/entityfields/date_new/valueProcess.js deleted file mode 100644 index 3a0d59096cd2de39b6098f1ed95af580dcebfce0..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/entityfields/date_new/valueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) - result.string(vars.getString("$sys.date")); \ No newline at end of file diff --git a/entity/AnyContact_entity/entityfields/user_edit/valueProcess.js b/entity/AnyContact_entity/entityfields/user_edit/valueProcess.js deleted file mode 100644 index 1581e18d9763043ae602b98658f87cb0a3b0c967..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/entityfields/user_edit/valueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) - result.string(vars.getString("$sys.user")); \ No newline at end of file diff --git a/entity/AnyContact_entity/entityfields/user_new/valueProcess.js b/entity/AnyContact_entity/entityfields/user_new/valueProcess.js deleted file mode 100644 index 7c566863b493d778b72dea7d8822f6a59333e77d..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/entityfields/user_new/valueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.neon"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) - result.string(vars.getString("$sys.user")); \ No newline at end of file diff --git a/entity/AnyContact_entity/entityfields/withprivat_param/valueProcess.js b/entity/AnyContact_entity/entityfields/withprivat_param/valueProcess.js deleted file mode 100644 index 755662df1632264e94e6a4d766bb65ead50a553d..0000000000000000000000000000000000000000 --- a/entity/AnyContact_entity/entityfields/withprivat_param/valueProcess.js +++ /dev/null @@ -1,3 +0,0 @@ -import("system.result"); - -result.string("0") \ No newline at end of file diff --git a/entity/Appointment_entity/Appointment_entity.aod b/entity/Appointment_entity/Appointment_entity.aod index a88c2b6e6d636b7e7c8b39c6815377002469eb4f..28c70af66100db91d5c2b61eea6d9ff584fb5832 100644 --- a/entity/Appointment_entity/Appointment_entity.aod +++ b/entity/Appointment_entity/Appointment_entity.aod @@ -288,9 +288,6 @@ <jDitoRecordFieldMapping> <name>STATUS.value</name> </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>LINKS.value</name> - </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> <name>DESCRIPTION.value</name> </jDitoRecordFieldMapping> diff --git a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js index 1537137ac8ec8fb412f232a80567dcafa4a93a5e..7e8972a145953d11163f3fccc1879487dea6e31b 100644 --- a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js @@ -107,8 +107,7 @@ function buildEntry(pEntry, pMasterentry) organizer, owner, attendees, - status, - links, + status, description, location, '', diff --git a/entity/CampaignPlanning_entity/CampaignPlanning_entity.aod b/entity/CampaignPlanning_entity/CampaignPlanning_entity.aod index 5686a654510804c5582ec45ca999421ad7cea021..051deb0ceea090c270fb0b24b3896c9ec9959094 100644 --- a/entity/CampaignPlanning_entity/CampaignPlanning_entity.aod +++ b/entity/CampaignPlanning_entity/CampaignPlanning_entity.aod @@ -120,12 +120,6 @@ <name>CAMPAIGN_ID.value</name> <recordfield>CAMPAIGN.CAMPAIGNID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>CAMPAIGN_NAME.value</name> - <recordfield>CAMPAIGN.NAME</recordfield> - <isFilterable v="true" /> - <isLookupFilter v="true" /> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>DATE_END.value</name> <recordfield>CAMPAIGNSTEP.DATE_END</recordfield> @@ -150,10 +144,6 @@ <name>STEP_ID.value</name> <recordfield>CAMPAIGNSTEP.CAMPAIGNSTEPID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>STEP_NAME.value</name> - <recordfield>CAMPAIGNSTEP.NAME</recordfield> - </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> <jDitoRecordContainer> diff --git a/entity/Contract_entity/Contract_entity.aod b/entity/Contract_entity/Contract_entity.aod index 6bb015cb39a37b2b6a4ebc1fb28fbb225534cf58..51dab19fa4733bd1cf91075fa059b823317b0a96 100644 --- a/entity/Contract_entity/Contract_entity.aod +++ b/entity/Contract_entity/Contract_entity.aod @@ -490,14 +490,6 @@ <name>CONTACT_PERSON_ID.value</name> <recordfield>CONTACT.PERSON_ID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>PERSON_FIRSTNAME.value</name> - <recordfield>PERSON.FIRSTNAME</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>PERSON_LASTNAME.value</name> - <recordfield>PERSON.LASTNAME</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PAYMENT.displayValue</name> <expression>%aditoprj%/entity/Contract_entity/recordcontainers/db/recordfieldmappings/payment.displayvalue/expression.js</expression> @@ -553,10 +545,6 @@ <name>CONTRACTCODE</name> <indexFieldType>TEXT_PLAIN</indexFieldType> </indexRecordFieldMapping> - <indexRecordFieldMapping> - <name>CUSTOMERCODE</name> - <indexFieldType>TEXT_PLAIN</indexFieldType> - </indexRecordFieldMapping> <indexRecordFieldMapping> <name>CONTACT_ORG_ID.value</name> <indexFieldType>STRING</indexFieldType> diff --git a/entity/Contract_entity/recordcontainers/index/query.js b/entity/Contract_entity/recordcontainers/index/query.js index b0797ceb1fba98977f0b70822229f384ba7eeed6..0b7612604a0518ed4437906473ea5f0caf38e248 100644 --- a/entity/Contract_entity/recordcontainers/index/query.js +++ b/entity/Contract_entity/recordcontainers/index/query.js @@ -13,7 +13,6 @@ var querySelect = newSelect("CONTRACTID " //as "_uid_" + ", " + sqlHelper.concat(["ORGANISATION.NAME", "'| " + translate.text("Type of contract") + ":'", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.contractType(), "CONTRACTTYPE")]) //as "_description_" + ", CONTRACTCODE " - + ", CUSTOMERCODE " + ", CONTACT.ORGANISATION_ID" //as CONTACT_ORG_ID + ", ORGANISATION.NAME" //as "CONTACT_ORG_ID.displayValue" + ", CONTRACT.CONTACT_ID") diff --git a/entity/Notification_entity/Notification_entity.aod b/entity/Notification_entity/Notification_entity.aod index 296228bdb9093ffb706994e7d4879510357a660e..05ab81cea74020a8b9ef2aa3bfa4266073bcda10 100644 --- a/entity/Notification_entity/Notification_entity.aod +++ b/entity/Notification_entity/Notification_entity.aod @@ -246,12 +246,6 @@ <name>ICON.value</name> <recordfield>ASYS_NOTIFICATIONCONTENTS.ICON_INFO</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>CALCULATEDPRIORITY.value</name> - <recordfield>ASYS_NOTIFICATIONCONTENTS.FORCEDPRIORITY</recordfield> - <isFilterable v="true" /> - <isLookupFilter v="true" /> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>RESOLVEDPRIORITY.value</name> <recordfield>ASYS_NOTIFICATIONS.RESOLVEDPRIORITY</recordfield> diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index 0968837cb500a102196278911944e12c5390f590..48fe414838b8a3bfa78d78a7a57e768a8f82aa26 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -1286,10 +1286,6 @@ <name>OFFERCODE.value</name> <indexFieldType>STRING</indexFieldType> </indexRecordFieldMapping> - <indexRecordFieldMapping> - <name>CUSTOMERCODE.value</name> - <indexFieldType>STRING</indexFieldType> - </indexRecordFieldMapping> <indexRecordFieldMapping> <name>CONTACT_ID.value</name> <indexFieldType>STRING</indexFieldType> diff --git a/entity/Offer_entity/recordcontainers/index/query.js b/entity/Offer_entity/recordcontainers/index/query.js index 608db62da009bb4eb785ecbd14c9f10f8dbb351d..6026dd62b0e7e82195b1597e9907f011545ce07f 100644 --- a/entity/Offer_entity/recordcontainers/index/query.js +++ b/entity/Offer_entity/recordcontainers/index/query.js @@ -13,7 +13,6 @@ var querySelect = newSelect("OFFER.OFFERID " // as "_uid_", + ", " + sqlHelper.concat([sqlHelper.cast("OFFER.OFFERCODE", SQLTYPES.CHAR, 10), KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.offerStatus(), "OFFER.STATUS")], " | ") //as "_title_" + ", " + sqlHelper.concat(["ORGANISATION.NAME", "'| " + translate.text("Description") + ":'", sqlHelper.castLob("OFFER.INFO", 250)]) // as "_description_" + ", OFFER.OFFERCODE" - + ", ORGANISATION.CUSTOMERCODE " + ", OFFER.CONTACT_ID " + ", CONTACT.ORGANISATION_ID " // as CONTACT_ORG_ID + ", ORGANISATION.NAME") // as "CONTACT_ORG_ID.displayValue" diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod index 6bec26be42531a4a59b275c0674feb1be0099d62..2c8082ea9ffdf2565a44890ffea392bdef4f298d 100644 --- a/entity/Order_entity/Order_entity.aod +++ b/entity/Order_entity/Order_entity.aod @@ -1217,10 +1217,6 @@ <name>SALESORDERCODE.value</name> <indexFieldType>STRING</indexFieldType> </indexRecordFieldMapping> - <indexRecordFieldMapping> - <name>CUSTOMERCODE.value</name> - <indexFieldType>STRING</indexFieldType> - </indexRecordFieldMapping> <indexRecordFieldMapping> <name>CONTACT_ID.value</name> <indexFieldType>STRING</indexFieldType> diff --git a/entity/Order_entity/recordcontainers/index/query.js b/entity/Order_entity/recordcontainers/index/query.js index 63f49bc6ea56f4a5754372cdd2184319f5a2c519..f0f600b464a18cfbe610b23dbd3889337d28dc15 100644 --- a/entity/Order_entity/recordcontainers/index/query.js +++ b/entity/Order_entity/recordcontainers/index/query.js @@ -12,7 +12,6 @@ var querySelect = newSelect("SALESORDERID " // as "_uid_" + ", " + sqlHelper.concat([sqlHelper.cast("SALESORDERCODE", SQLTYPES.CHAR, 10)], " | ") // as "_title_" + ", " + sqlHelper.concat(["ORGANISATION.NAME"], " | ") // as "_description_" + ", SALESORDERCODE" - + ", CUSTOMERCODE" + ", SALESORDER.CONTACT_ID" + ", CONTACT.ORGANISATION_ID " //as CONTACT_ORG_ID + ", ORGANISATION.NAME ") //as "CONTACT_ORG_ID.displayValue" diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 446f310d7bc96179cfbcae4721156500e1110b61..61aa30e669c5d98bfa405cc9fb26e8848dfa290c 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -1490,10 +1490,6 @@ <isFilterable v="true" /> <filtertype>EXTENDED</filtertype> </consumerMapping> - <dbRecordFieldMapping> - <name>OrganisationContactId.value</name> - <expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/organisationcontactid.value/expression.js</expression> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>ORGANISATION_CONTACTID.value</name> <expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/organisation_contactid.value/expression.js</expression> diff --git a/entity/Person_entity/recordcontainers/db/recordfieldmappings/organisationcontactid.value/expression.js b/entity/Person_entity/recordcontainers/db/recordfieldmappings/organisationcontactid.value/expression.js deleted file mode 100644 index 56d6932fbb4a5a6202133f0da069a1cf3243a4a6..0000000000000000000000000000000000000000 --- a/entity/Person_entity/recordcontainers/db/recordfieldmappings/organisationcontactid.value/expression.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.result"); -import("Sql_lib"); - -result.string("(select CONTACTID from CONTACT orgContact where PERSON_ID is null and ORGANISATION.ORGANISATIONID = orgContact.ORGANISATION_ID)"); \ No newline at end of file diff --git a/entity/SalesprojectSource_entity/SalesprojectSource_entity.aod b/entity/SalesprojectSource_entity/SalesprojectSource_entity.aod index e1b1ae86aa099b9a04db9c5c87bdac18327e69e5..7480acbbffe1ba2eab7426d9778cf3aa20b5ae3a 100644 --- a/entity/SalesprojectSource_entity/SalesprojectSource_entity.aod +++ b/entity/SalesprojectSource_entity/SalesprojectSource_entity.aod @@ -110,10 +110,6 @@ <name>SALESPROJECT_ID.value</name> <recordfield>SALESPROJECT_TOUCHPOINT.SALESPROJECT_ID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>SOURCE.displayValue</name> - <expression>%aditoprj%/entity/SalesprojectSource_entity/recordcontainers/db/recordfieldmappings/source.displayvalue/expression.js</expression> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>INFO.value</name> <recordfield>SALESPROJECT_TOUCHPOINT.INFO</recordfield> diff --git a/entity/SalesprojectSource_entity/recordcontainers/db/recordfieldmappings/source.displayvalue/expression.js b/entity/SalesprojectSource_entity/recordcontainers/db/recordfieldmappings/source.displayvalue/expression.js deleted file mode 100644 index 9c2c59e5d23fee5e9c0318ba05d33739a47af82e..0000000000000000000000000000000000000000 --- a/entity/SalesprojectSource_entity/recordcontainers/db/recordfieldmappings/source.displayvalue/expression.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.result"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); - -var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesprojectSource(), "SALESPROJECT_TOUCHPOINT.TOUCHPOINT"); -result.string(sql); diff --git a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod index 5719de94c66c1f01c91b39451f9d96deb117f2c6..155a2f033dee8feaa814013907c364934edb0bd2 100644 --- a/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod +++ b/entity/WorkflowDefinition_entity/WorkflowDefinition_entity.aod @@ -38,6 +38,12 @@ <iconId>VAADIN:EXTERNAL_LINK</iconId> <stateProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/tableactions/children/openmodeler/stateProcess.js</stateProcess> </entityActionField> + <entityActionField> + <name>createModel</name> + <title>Create model</title> + <onActionProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/tableactions/children/createmodel/onActionProcess.js</onActionProcess> + <iconId>NEON:PLUS</iconId> + </entityActionField> </children> </entityActionGroup> <entityField> @@ -197,6 +203,17 @@ <entityField> <name>VERSION_TITLE</name> </entityField> + <entityParameter> + <name>IsWorkflowImport_param</name> + <expose v="true" /> + </entityParameter> + <entityActionField> + <name>editWorkflow</name> + <title>Edit workflow</title> + <onActionProcess>%aditoprj%/entity/WorkflowDefinition_entity/entityfields/editworkflow/onActionProcess.js</onActionProcess> + <iconId>VAADIN:EDIT</iconId> + <tooltip>Edit workflow</tooltip> + </entityActionField> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/WorkflowDefinition_entity/entityfields/editworkflow/onActionProcess.js b/entity/WorkflowDefinition_entity/entityfields/editworkflow/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..bc22afc6b2cfb545954d6a8c15c873387b97fde5 --- /dev/null +++ b/entity/WorkflowDefinition_entity/entityfields/editworkflow/onActionProcess.js @@ -0,0 +1,14 @@ +import("system.vars"); +import("Workflow_lib"); +import("system.workflow"); +import("system.util"); +import("system.neon"); + +var processXML = workflow.getProcessXML(vars.get("$field.UID")); +if (processXML) +{ + processXML = util.decodeBase64String(processXML); + var model = new WorkflowModelerApiCall().processXML(processXML).importModel(); + if (model) + neon.openUrl(WorkflowUtils.getModelerUrl(model.id, true), false); +} \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/entityfields/tableactions/children/createmodel/onActionProcess.js b/entity/WorkflowDefinition_entity/entityfields/tableactions/children/createmodel/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..82689600b7a620743de9485b99a43849e497c01b --- /dev/null +++ b/entity/WorkflowDefinition_entity/entityfields/tableactions/children/createmodel/onActionProcess.js @@ -0,0 +1,3 @@ +import("system.neon"); + +neon.openContext("WorkflowModel", null, null, neon.OPERATINGSTATE_NEW, {}); \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/entityfields/tableactions/children/openmodeler/onActionProcess.js b/entity/WorkflowDefinition_entity/entityfields/tableactions/children/openmodeler/onActionProcess.js index d9191cac3d1dade9d54d832816f6b93943aac2f2..802a66fb9632b688fbdf95e3a471edcac47c652c 100644 --- a/entity/WorkflowDefinition_entity/entityfields/tableactions/children/openmodeler/onActionProcess.js +++ b/entity/WorkflowDefinition_entity/entityfields/tableactions/children/openmodeler/onActionProcess.js @@ -3,4 +3,4 @@ import("system.neon"); var modelerUrl = WorkflowUtils.getModelerUrl(); if (modelerUrl) - neon.openUrl(modelerUrl, true); \ No newline at end of file + neon.openUrl(modelerUrl + "/#/processes", true); \ No newline at end of file diff --git a/entity/WorkflowDefinition_entity/recordcontainers/jdito/onInsert.js b/entity/WorkflowDefinition_entity/recordcontainers/jdito/onInsert.js index d4269f1ca146ecab555909a1aa39a34420ea345b..bb8e8692e251f74c6d0813b81ae8d4f18e7347dc 100644 --- a/entity/WorkflowDefinition_entity/recordcontainers/jdito/onInsert.js +++ b/entity/WorkflowDefinition_entity/recordcontainers/jdito/onInsert.js @@ -1,17 +1,24 @@ -import("Employee_lib"); import("system.workflow"); import("system.neon"); import("system.vars"); -import("system.util"); import("system.notification"); import("Document_lib"); +import("Employee_lib"); +import("system.translate") +import("Workflow_lib"); var upload = new FileUpload(vars.get("$field.FILEUPLOAD")); var rowData = vars.get("$local.rowdata"); -var xml = util.decodeBase64String(upload.bindata); - -//the xml could be invalid -try { - workflow.deployProcess(rowData["KEY.value"], xml); -} catch (ex) {} +if (upload.isFilled()) +{ + if (workflow.deployProcess(rowData["KEY.value"], upload.getBase64DecodedData()) === null) + { + var notificationConfig = notification.createConfig() + .addUserWithId(EmployeeUtils.getCurrentUserId()) + .notificationType("WorkflowDeployFailed") + .caption(translate.text("Workflow deploy failed")) + .description(translate.text("The workflow could not be deployed")); + notification.addNotificationWith(notificationConfig); + } +} \ No newline at end of file diff --git a/entity/WorkflowModel_entity/WorkflowModel_entity.aod b/entity/WorkflowModel_entity/WorkflowModel_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..0829152a67cdfd9ff43a5f9514a755d47cb36b91 --- /dev/null +++ b/entity/WorkflowModel_entity/WorkflowModel_entity.aod @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.14" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.14"> + <name>WorkflowModel_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/entity/WorkflowModel_entity/documentation.adoc</documentation> + <title>Workflow Model</title> + <contentTitleProcess>%aditoprj%/entity/WorkflowModel_entity/contentTitleProcess.js</contentTitleProcess> + <recordContainer>jdito</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + </entityProvider> + <entityActionField> + <name>openModelEditor</name> + <title>and open modeler</title> + <onActionProcess>%aditoprj%/entity/WorkflowModel_entity/entityfields/openmodeleditor/onActionProcess.js</onActionProcess> + <isSaveAction v="true" /> + </entityActionField> + <entityField> + <name>KEY</name> + <title>Key</title> + <mandatory v="true" /> + </entityField> + <entityField> + <name>UID</name> + </entityField> + <entityField> + <name>DESCRIPTION</name> + <title>Description</title> + <contentType>LONG_TEXT</contentType> + </entityField> + <entityField> + <name>NAME</name> + <title>Name</title> + <mandatory v="true" /> + </entityField> + </entityFields> + <recordContainers> + <jDitoRecordContainer> + <name>jdito</name> + <contentProcess>%aditoprj%/entity/WorkflowModel_entity/recordcontainers/jdito/contentProcess.js</contentProcess> + <onInsert>%aditoprj%/entity/WorkflowModel_entity/recordcontainers/jdito/onInsert.js</onInsert> + <recordFieldMappings> + <jDitoRecordFieldMapping> + <name>UID.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>KEY.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>NAME.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>DESCRIPTION.value</name> + </jDitoRecordFieldMapping> + </recordFieldMappings> + </jDitoRecordContainer> + </recordContainers> +</entity> diff --git a/entity/AnyContact_entity/entityfields/contacts/children/contactid_param/valueProcess.js b/entity/WorkflowModel_entity/contentTitleProcess.js similarity index 52% rename from entity/AnyContact_entity/entityfields/contacts/children/contactid_param/valueProcess.js rename to entity/WorkflowModel_entity/contentTitleProcess.js index 7b6137b4d105e9ba592cf8ef6e796fb838a32b09..28fd67de270b497ba718dd4e91766bd22936f67e 100644 --- a/entity/AnyContact_entity/entityfields/contacts/children/contactid_param/valueProcess.js +++ b/entity/WorkflowModel_entity/contentTitleProcess.js @@ -1,4 +1,4 @@ import("system.vars"); import("system.result"); -result.string(vars.get("$field.CONTACTID")); \ No newline at end of file +result.string(vars.get("$field.NAME")); \ No newline at end of file diff --git a/entity/WorkflowModel_entity/documentation.adoc b/entity/WorkflowModel_entity/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..fbcfd36592f56a682d0c2c2e81ec8ffc58580c09 --- /dev/null +++ b/entity/WorkflowModel_entity/documentation.adoc @@ -0,0 +1,4 @@ += WorkflowModel_entity + +This entity is used to represent workflow models inside the workflow modeler. The jdito-recordcontainer uses the modeler's REST api to retrieve the process +models. Because of that, this entity needs the workflow modeler to be running. \ No newline at end of file diff --git a/entity/WorkflowModel_entity/entityfields/openmodeleditor/onActionProcess.js b/entity/WorkflowModel_entity/entityfields/openmodeleditor/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..a7ebffe2899cad5a9213dd85275a7cf4cf147c99 --- /dev/null +++ b/entity/WorkflowModel_entity/entityfields/openmodeleditor/onActionProcess.js @@ -0,0 +1,10 @@ +import("system.vars"); +import("system.neon"); +import("Workflow_lib"); + +var createdModelId = vars.exists("$context.createdModelId") ? vars.get("$context.createdModelId") : null; +if (createdModelId) +{ + vars.set("$context.createdModelId", null); + neon.openUrl(WorkflowUtils.getModelerUrl(createdModelId, true), false); +} \ No newline at end of file diff --git a/entity/WorkflowModel_entity/recordcontainers/jdito/contentProcess.js b/entity/WorkflowModel_entity/recordcontainers/jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..530ee738d5243e1eec82ae1bf38a43d4daa45d76 --- /dev/null +++ b/entity/WorkflowModel_entity/recordcontainers/jdito/contentProcess.js @@ -0,0 +1,29 @@ +import("system.result"); +import("system.vars"); +import("Workflow_lib"); + +var models; + +if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) +{ + models = vars.get("$local.idvalues").map(function (id) + { + return new WorkflowModelerApiCall().modelId(id).getModel(); + }); +} +else + models = new WorkflowModelerApiCall().getModels(); + +models = models.map( +/** @param {WorkflowModel} model */ +function (model) +{ + return [ + model.id, + model.key, + model.name, + model.description + ]; +}); + +result.object(models); \ No newline at end of file diff --git a/entity/WorkflowModel_entity/recordcontainers/jdito/onInsert.js b/entity/WorkflowModel_entity/recordcontainers/jdito/onInsert.js new file mode 100644 index 0000000000000000000000000000000000000000..cc77bbf874e9985fecc1fedc734982713112b86b --- /dev/null +++ b/entity/WorkflowModel_entity/recordcontainers/jdito/onInsert.js @@ -0,0 +1,9 @@ +import("system.vars"); +import("Workflow_lib"); + +var rowdata = vars.get("$local.rowdata"); + +var workflowModel = new WorkflowModel(rowdata["UID.value"], rowdata["NAME.value"], rowdata["KEY.value"], rowdata["DESCRIPTION.value"]); +var createdModel = new WorkflowModelerApiCall().model(workflowModel).createModel(); +if (createdModel) + vars.set("$context.createdModelId", createdModel.id); \ No newline at end of file diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index ad03b6522afbd48721fe07d03882c99076bef351..7d8ec08a7b60354c748b9a25bfb6c35dd7a7c297 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -81,6 +81,10 @@ <key>Has marketing approved this step?</key> <value>Hat das Marketing diesem Schritt zugestimmt?</value> </entry> + <entry> + <key>Create model</key> + <value>Modell erstellen</value> + </entry> <entry> <key>Task done</key> <value>Aufgabe abgeschlossen</value> @@ -695,6 +699,10 @@ <key>None</key> <value>Keine</value> </entry> + <entry> + <key>Edit workflow</key> + <value>Workflow bearbeiten</value> + </entry> <entry> <key>Date of request</key> <value>Datum der Anforderung</value> @@ -2089,6 +2097,10 @@ <key>{$TASK_STATUS}</key> <value>Status</value> </entry> + <entry> + <key>and open modeler</key> + <value>und Modeler öffnen</value> + </entry> <entry> <key>Task</key> <value>Aufgabe</value> diff --git a/neonContext/WorkflowModel/WorkflowModel.aod b/neonContext/WorkflowModel/WorkflowModel.aod new file mode 100644 index 0000000000000000000000000000000000000000..4b31ba4526e5e0890fe3da72d0dfa974bdf39474 --- /dev/null +++ b/neonContext/WorkflowModel/WorkflowModel.aod @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1"> + <name>WorkflowModel</name> + <title>Workflow Model</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <editView>WorkflowModelEdit_view</editView> + <lookupView>WorkflowModelLookup_view</lookupView> + <entity>WorkflowModel_entity</entity> + <references> + <neonViewReference> + <name>4d3b7269-7dc9-4e00-8a09-e337ca0df800</name> + <view>WorkflowModelEdit_view</view> + </neonViewReference> + <neonViewReference> + <name>82156d4a-1db1-48d4-88e7-f098ca1f432a</name> + <view>WorkflowModelLookup_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonNotificationType/WorkflowDeployFailed/WorkflowDeployFailed.aod b/neonNotificationType/WorkflowDeployFailed/WorkflowDeployFailed.aod new file mode 100644 index 0000000000000000000000000000000000000000..0dafa63d64f6b95f97e57c35925e18c59cc9dca3 --- /dev/null +++ b/neonNotificationType/WorkflowDeployFailed/WorkflowDeployFailed.aod @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonNotificationType xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonNotificationType/1.1.0"> + <name>WorkflowDeployFailed</name> + <title>Workflow deploy failed</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <icon>VAADIN:EXCLAMATION_CIRCLE</icon> + <deletePerLogout v="true" /> +</neonNotificationType> diff --git a/neonView/WorkflowDefinitionEdit_view/WorkflowDefinitionEdit_view.aod b/neonView/WorkflowDefinitionEdit_view/WorkflowDefinitionEdit_view.aod index 59a9e0f0bd08a03da9afa0b0d6ec613276279bce..d0aaeebbaa361abc7c40f805605710e08afe8167 100644 --- a/neonView/WorkflowDefinitionEdit_view/WorkflowDefinitionEdit_view.aod +++ b/neonView/WorkflowDefinitionEdit_view/WorkflowDefinitionEdit_view.aod @@ -3,6 +3,7 @@ <name>WorkflowDefinitionEdit_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> <size>SMALL</size> + <isOverlay v="false" /> <overlayOrientation>PORTRAIT</overlayOrientation> <layout> <boxLayout> @@ -16,17 +17,13 @@ <entityField>#ENTITY</entityField> <fields> <entityFieldLink> - <name>bfec3b64-2cc5-4e51-b321-6d898ddaca9e</name> + <name>42a373cb-956d-4c0a-8a4e-ece1b64c9a95</name> <entityField>FILEUPLOAD</entityField> </entityFieldLink> <entityFieldLink> <name>88c2c956-966a-4ad9-b744-ccb729b024bc</name> <entityField>KEY</entityField> </entityFieldLink> - <entityFieldLink> - <name>14bd4671-d876-430e-8574-277118395ff0</name> - <entityField>ISACTIVE</entityField> - </entityFieldLink> </fields> </genericViewTemplate> </children> diff --git a/neonView/WorkflowDefinitionPreview_view/WorkflowDefinitionPreview_view.aod b/neonView/WorkflowDefinitionPreview_view/WorkflowDefinitionPreview_view.aod index 4262fe6771f9726d021ba92d834d13feabf867b8..de087d4217ef8d9c72ab6850fff3f142e215cb04 100644 --- a/neonView/WorkflowDefinitionPreview_view/WorkflowDefinitionPreview_view.aod +++ b/neonView/WorkflowDefinitionPreview_view/WorkflowDefinitionPreview_view.aod @@ -13,7 +13,9 @@ <iconField>DIAGRAM</iconField> <titleField>NAME</titleField> <subtitleField>KEY</subtitleField> + <favoriteAction1>editWorkflow</favoriteAction1> <entityField>#ENTITY</entityField> + <isEditable v="false" /> </cardViewTemplate> <genericViewTemplate> <name>Generic</name> @@ -33,10 +35,6 @@ <name>9ae7bada-afb2-48d4-9aa0-b2bd5bd17379</name> <entityField>ISACTIVE</entityField> </entityFieldLink> - <entityFieldLink> - <name>013085a5-c833-42ee-b907-aa268edb1ea3</name> - <entityField>CATEGORY</entityField> - </entityFieldLink> <entityFieldLink> <name>6b06cf99-37b1-4901-a502-81bb590faa92</name> <entityField>DESCRIPTION</entityField> diff --git a/neonView/WorkflowModelEdit_view/WorkflowModelEdit_view.aod b/neonView/WorkflowModelEdit_view/WorkflowModelEdit_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..b03c3813ded7ad328d49edd4da3f22ecd3656dac --- /dev/null +++ b/neonView/WorkflowModelEdit_view/WorkflowModelEdit_view.aod @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6"> + <name>WorkflowModelEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <size>SMALL</size> + <isOverlay v="true" /> + <overlayOrientation>PORTRAIT</overlayOrientation> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericViewTemplate> + <name>Generic</name> + <editMode v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>9dfd354c-7745-4b84-a69a-34308e9186f0</name> + <entityField>NAME</entityField> + </entityFieldLink> + <entityFieldLink> + <name>70c10b5d-3058-45b8-9a24-69a91259f058</name> + <entityField>KEY</entityField> + </entityFieldLink> + <entityFieldLink> + <name>86472557-ab8c-475c-8e83-c9423e5125b4</name> + <entityField>DESCRIPTION</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> +</neonView> diff --git a/neonView/WorkflowModelLookup_view/WorkflowModelLookup_view.aod b/neonView/WorkflowModelLookup_view/WorkflowModelLookup_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..051bb98fe84d47bcf0d18813b114e93eedf42076 --- /dev/null +++ b/neonView/WorkflowModelLookup_view/WorkflowModelLookup_view.aod @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6"> + <name>WorkflowModelLookup_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <tableViewTemplate> + <name>Table</name> + <entityField>#ENTITY</entityField> + <columns> + <neonTableColumn> + <name>1860eca1-6350-4071-b36a-c57397c60a24</name> + <entityField>NAME</entityField> + </neonTableColumn> + <neonTableColumn> + <name>187c1d79-44d9-4028-8c1a-5f7f3df6501b</name> + <entityField>KEY</entityField> + </neonTableColumn> + <neonTableColumn> + <name>dc760770-4bd5-4ba8-babf-b7c2965200c3</name> + <entityField>DESCRIPTION</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod index cb973daa809b01fb7c5410887cac797840a2fddb..2c486ae8a6b6c5f2b17883cfe535de5f164d468e 100644 --- a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod +++ b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod @@ -100,7 +100,7 @@ <customStringProperty> <name>workflow.modelerUrl</name> <description></description> - <property>http://localhost:8080/flowable-modeler/#/processes</property> + <property>http://localhost:8080/flowable-modeler/</property> </customStringProperty> </customProperties> <customConfigProperties> diff --git a/process/AttributeFilter_lib/process.js b/process/AttributeFilter_lib/process.js index fba1180f3e320d66a2c09961d1eba5cfc49380bd..5b093fee0e2d95cd7ccb60bf5851513fcc3f7e74 100644 --- a/process/AttributeFilter_lib/process.js +++ b/process/AttributeFilter_lib/process.js @@ -222,7 +222,7 @@ AttributeFilterExtensionMaker.getFilterCondition = function(pObjectType, pFilter condition = newWhere(["AB_ATTRIBUTERELATION", dbField], SqlUtils.escapeVars(pRawValue), pOperatorName == "=" ? SqlBuilder.EQUAL() : SqlBuilder.NOT_EQUAL()); else { - condition = pCondition.replace(new RegExp(pColumnPlaceholder, "g"), dbField); + condition = StringUtils.replaceAll(pCondition, pColumnPlaceholder, dbField); } //a SqlBuilder.IN() in a newWhere is not used here since the subselect can contain a placeholder diff --git a/process/DocumentTemplate_lib/process.js b/process/DocumentTemplate_lib/process.js index 486e493fefb492ead224c144e88f270af6d84634..ae3c193044abef89337c2be2e823dc4020ce1008 100644 --- a/process/DocumentTemplate_lib/process.js +++ b/process/DocumentTemplate_lib/process.js @@ -23,6 +23,7 @@ import("Keyword_lib"); import("Placeholder_lib"); import("Email_lib"); import("MimeType_lib"); +import("Util_lib"); /** * Object for working with document templates, holds the content and type of the template. @@ -105,8 +106,9 @@ DocumentTemplate.prototype._resolveEmbeddedTemplate = function () }); // Note: some embedded templates in embedded templates may be replaced, but this is NOT SUPPORTED, as it only works if the second template is not already replaced at that time. - placeholders.forEach(function(pPlaceholder) { - replacedContent = replacedContent.replace(new RegExp(PlaceholderUtils.formatPlaceholder(pPlaceholder[0]), "g"), pPlaceholder[1]) + placeholders.forEach(function(pPlaceholder) + { + replacedContent = StringUtils.replaceAll(replacedContent, PlaceholderUtils.formatPlaceholder(pPlaceholder[0]), pPlaceholder[1], "g"); }, this); this._subtemplatedContent = util.encodeBase64String(replacedContent); @@ -669,8 +671,8 @@ TemplateHelper._getReplacedODT = function (pTemplate, pReplacements, pTableData) */ for (let placeholder in replacements) { - currentBody = currentBody.replace(new RegExp(placeholder, "ig"), - replacements[placeholder].replace(/\n/ig, "<text:line-break/>").replace(/&/ig, "&")); + currentBody = StringUtils.replaceAll(currentBody, placeholder, + replacements[placeholder].replace(/\n/ig, "<text:line-break/>").replace(/&/ig, "&"), "ig"); } @@ -709,8 +711,8 @@ TemplateHelper._getReplacedODT = function (pTemplate, pReplacements, pTableData) var styles = util.decodeBase64String(pack.getFromZip(pODTFileName, "styles.xml")); for (let placeholder in pReplacements[0]) { - styles = styles.replace(new RegExp(placeholder, "ig"), - pReplacements[0][placeholder].replace(/\n/ig, "<text:line-break/>").replace(/&/ig, "&")); + styles = StringUtils.replaceAll(styles, placeholder, + pReplacements[0][placeholder].replace(/\n/ig, "<text:line-break/>").replace(/&/ig, "&"), "ig"); } pack.addToZip(pODTFileName, "styles.xml", util.encodeBase64String(styles)); return true; diff --git a/process/Entity_lib/process.js b/process/Entity_lib/process.js index 2e00cc8b9f1b726bab18bca4603751b12ec94c4d..93360446bcf5ed3682da3749fd127d9c10002322 100644 --- a/process/Entity_lib/process.js +++ b/process/Entity_lib/process.js @@ -1,3 +1,4 @@ +import("system.process"); import("system.translate"); import("system.entities"); import("system.result"); @@ -371,4 +372,149 @@ EntityConsumerUtils.rmInsertedConsumerRows = function(pConsumer) { neon.deleteRecord(pConsumer, row["#UID"]); }); -}; \ No newline at end of file +}; + +/** + * Object that makes getting the current consumer rows of an entity easier. + * + * @param {Array} [pRows] The rows that should be initially loaded into the object, in most cases that would be the stored records. + */ +function EntityConsumerRowsHelper (pRows) +{ + this._uidField = "#UID"; + this._consumer = null; + this._rows = pRows || []; +} + +/** + * Static function for getting all current rows of a consumer with all changes applied (insertedRows, changedRows, deletedRows). + * + * @param {String} pConsumer the name of the consumer + * @param {String[]} pFields the entity fields that should be loaded, this only affects the stored rows that are loaded from the consumer entity + * @return {Object[]} current consumer rows + * @example + * var currentAttributes = EntityConsumerRowsHelper.getCurrentConsumerRows("Attributes", ["AB_ATTRIBUTE_ID", "VALUE"]); + */ +EntityConsumerRowsHelper.getCurrentConsumerRows = function (pConsumer, pFields) +{ + return new EntityConsumerRowsHelper() + .consumer(pConsumer) + .fetchRowsFromConsumer(pFields) + .applyConsumerRowChanges() + .getRows(); +} + +/** + * Sets the consumer that is used for loading the rows. + * + * @param {String} pConsumer the name of the consumer + * @return {EntityConsumerRowsHelper} current object + */ +EntityConsumerRowsHelper.prototype.consumer = function (pConsumer) +{ + this._consumer = pConsumer; + return this; +} + +/** + * Loads the stored rows from the consumer into the object. + * + * @param {String[]} pFields the entity fields that should be loaded + * @return {EntityConsumerRowsHelper} current object + */ +EntityConsumerRowsHelper.prototype.fetchRowsFromConsumer = function (pFields) +{ + if (!pFields) + pFields = [this._uidField]; + else if (pFields.indexOf(this._uidField) === -1) + pFields.push(this._uidField); + + var loadConfig = entities.createConfigForLoadingConsumerRows() + .consumer(this._consumer) + .fields(pFields); + this._rows = entities.getRows(loadConfig); + return this; +} + +/** + * Applies all current changes to the consumer rows (insertedRows, changedRows, deletedRows). + * + * @return {EntityConsumerRowsHelper} current object + */ +EntityConsumerRowsHelper.prototype.applyConsumerRowChanges = function () +{ + var insertedRows = vars.get("$field." + this._consumer + ".insertedRows"); + var changedRows = vars.get("$field." + this._consumer + ".changedRows"); + var deletedRows = vars.get("$field." + this._consumer + ".deletedRows"); + + if (deletedRows && deletedRows.length > 0) + this.removeRows(deletedRows); + if (changedRows && changedRows.length > 0) + this.changeRows(changedRows); + if (insertedRows && insertedRows.length > 0) + this.appendRows(insertedRows); + + return this; +} + +/** + * Adds rows to the object. + * + * @param {Object[]} pRowsToAppend the rows that should be added (insertedRows) + * @return {EntityConsumerRowsHelper} current object + */ +EntityConsumerRowsHelper.prototype.appendRows = function (pRowsToAppend) +{ + this._rows = this._rows.concat(pRowsToAppend); + return this; +} + +/** + * Updates the given rows in the object. + * + * @param {Object[]} pRowsToChange the rows that should be changed, they replace existing rows based on the uid (changedRows) + * @return {EntityConsumerRowsHelper} current object + */ +EntityConsumerRowsHelper.prototype.changeRows = function (pRowsToChange) +{ + var changeCatalog = {}; + pRowsToChange.forEach(function (changedRow) + { + changeCatalog[changedRow[this._uidField]] = changedRow; + }); + this._rows = this._rows.map(function (row) + { + return row[this._uidField] in changeCatalog ? changeCatalog[row[this._uidField]] : row; + }); + return this; +} + +/** + * Removes the given rows from the object. + * + * @param {Object[]} pRowsToRemove the rows that should be removed (deletedRows) + * @return {EntityConsumerRowsHelper} current object + */ +EntityConsumerRowsHelper.prototype.removeRows = function (pRowsToRemove) +{ + var deleteCatalog = {}; + pRowsToRemove.forEach(function (deletedRow) + { + deleteCatalog[deletedRow[this._uidField]] = true; + }); + this._rows = this._rows.filter(function (row) + { + return !deleteCatalog[row[this._uidField]]; + }); + return this; +} + +/** + * Returns all rows inside the object. + * + * @return {Object[]} all the current rows + */ +EntityConsumerRowsHelper.prototype.getRows = function () +{ + return this._rows; +} diff --git a/process/Util_lib/process.js b/process/Util_lib/process.js index 9f046efd158cd92f8d7334fec36d43353692258e..30e6b6b27aac5415eadfcaa53db1fcfc88a9ad5a 100644 --- a/process/Util_lib/process.js +++ b/process/Util_lib/process.js @@ -15,6 +15,34 @@ import("system.datetime"); import("Offer_lib"); import("Date_lib"); +/** + * Class containing static utility functions for regular expression objects (RegExp) + * Do not create an instance of this + * + * @class + */ +function RegExpUtils(){} + +/** + * Escapes characters of a string that shall be passed to a RegExp 1:1 <br/> + * This is necessary because the RegExp-constructor uses the given string directly as pattern as you can see here:<br/> + * new RegExp("^t.*t$") <=> /^t.*t$/<br/> + * while<br/> + * new RegExp(escapeStr("^t.*t$")) <=> /\^t\.\*t\$/<br/> + * The first will match any string taht starts with "t" and ends with "t" like the word "test". <br/> + * The second one will match only the string "^t.*t$".<br/> + * You have to decide what you want to use as a RegExp and what is correct for your case.<br/> + * + * @param {String} pStringForRegExp <p/>The plain string that has to be escaped to be used as an RegExp + * + * @return {String} the escaped string + */ +RegExpUtils.escapePatternStr = function (pStringForRegExp) +{ + //source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping + return pStringForRegExp.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string +}; + /** * Class containing static utility functions for string-actions * Do not create an instance of this @@ -23,6 +51,58 @@ import("Date_lib"); */ function StringUtils(){} +/** + * Searches and replaces all matches of a string within another string with a given replacement. + * This will not modifiy the original string but return a new string with the applied replacements. + * In the current version of the rhino-javascript-engine the String.prototype.replaceAll-function is not implemented, therefor it's necessary to have + * a separate function for this. + * + * @param {String} pPlainInputStr <p/>String where the matches of the searched word are replaced + * @param {String} pPlainSearchStr <p/>Value that is replaced in the pPlainInputStr; this has to be a plain string + * @param {String|function} pReplacement <p/>A string or a function for the replacement-value just like the String.prototype.replace(...) accepts + * @param {String} [pFlags="g"] <p/>If specified, flags is a string that contains the modifier-flags to add + * (for exmaple "i", "m", "im", etc.; + * <p/> for more details take a look at the constructor of the standard-javascript RegExp the "g" modifier + * is added automatically, so there is no need to set this modifier + * + * @return {String} <p/>A new string, with all matches of the given search string replaced by a replacement + * + * @example + * + * var is = "an apple is an apple is an APPLE"; + * + * var r1 = StringUtils.replaceAll(is, "apple", "orange"); + * var r2 = StringUtils.replaceAll(is, "apple", "orange", "g"); + * var r3 = StringUtils.replaceAll(is, "apple", "orange", "i"); + * var r4 = StringUtils.replaceAll(is, "apple", "orange", "ig"); + * var r5 = StringUtils.replaceAll(is, "apple", function (){ + * return "orangeFn"; + * }, "ig"); + * var r6 = StringUtils.replaceAll("example with RegExp symbols like: - * [] / \\ $$", "$$", "dollarsymbols"); + * + * logging.log("r1:" + r1) //logs: r1:an orange is an orange is an APPLE + * logging.log("r2:" + r2) //logs: r2:an orange is an orange is an APPLE + * logging.log("r3:" + r3) //logs: r3:an orange is an orange is an orange + * logging.log("r4:" + r4) //logs: r4:an orange is an orange is an orange + * logging.log("r5:" + r5) //logs: r5:an orangeFn is an orangeFn is an orangeFn + * logging.log("r6:" + r6) //logs: r6:example with RegExp symbols like: - * [] / \ dollarsymbols + */ +StringUtils.replaceAll = function(pPlainInputStr, pPlainSearchStr, pReplacement, pFlags) +{ + //flags after creating the RegExp object are read only, so we have to determine the flags to bet set before creating the RegExp object + var regExpFlags; + if (pFlags) + if (pFlags.search("g") != -1) + regExpFlags = pFlags; + else + regExpFlags = "g" + pFlags; + else + regExpFlags = "g"; + + var searchRegExp = new RegExp(RegExpUtils.escapePatternStr(pPlainSearchStr), regExpFlags); + return pPlainInputStr.replace(searchRegExp, pReplacement); +}; + /** * concats severel elements by a separator; the separator is only applied if a element is not null and not an empty string ""; * diff --git a/process/Workflow_lib/process.js b/process/Workflow_lib/process.js index 179875a721eeee920de4ed7fa72752661fcefbe9..2387f13ee8f9bf28e21f6c0d5123178a7d14518e 100644 --- a/process/Workflow_lib/process.js +++ b/process/Workflow_lib/process.js @@ -8,6 +8,10 @@ import("system.vars"); import("system.entities"); import("system.workflow"); import("KeywordRegistry_basic"); +import("system.net"); +import("system.auth"); +import("system.util"); +import("MimeType_lib"); /** * Provides general functions for working with workflows and the workflow engine. @@ -80,9 +84,17 @@ WorkflowUtils.engineIsEnabled = function () * * @return {String} the url of the workflow modeler */ -WorkflowUtils.getModelerUrl = function () +WorkflowUtils.getModelerUrl = function (pModelId, pIsEditor) { - return project.getPreferenceValue("custom.workflow.modelerUrl", ""); + var modelerUrl = project.getPreferenceValue("custom.workflow.modelerUrl", "").replace(/\/$/, ""); + if (pModelId) + { + if (pIsEditor) + modelerUrl += "/#/editor/" + pModelId; + else + modelerUrl += "/#/processes/" + pModelId; + } + return modelerUrl; } /** @@ -391,3 +403,251 @@ WorkflowServiceTaskParameter.ENUM = function () { return "enum"; } + +/** + * Representation of a process model from the modeler + */ +function WorkflowModel (pId, pName, pKey, pDescription) +{ + this.id = pId; + this.name = pName; + this.key = pKey; + this.description = pDescription || ""; + this.lastUpdated = new Date(); + this.createdBy = WorkflowModelerApiCall.getDefaultRestUser(); + this.lastUpdatedBy = this.createdBy; + this.latestVersion = true; + this.version = 1; + this.comment = null; + this.modelType = 0; + this.tenantId = null; +} + +/** + * Creates a new WorkflowModel object with the properties of the given object. This is used for deserialization. + * + * @param {Object} pPropertyObj object containing the properties to set + * @return {WorkflowModel} a new WorkflowModel object with the given properties + */ +WorkflowModel.fromObject = function (pPropertyObj) +{ + return Object.assign(new WorkflowModel(), pPropertyObj); +} + +/** + * An object that provides functions for using the REST API of the workflow modeler + */ +function WorkflowModelerApiCall () +{ + this._baseUrl = WorkflowUtils.getModelerUrl(); + this._modelId = null; + this._model = null; + this._processXML = null; + + this._authUser = WorkflowModelerApiCall.getDefaultRestUser(); + this._authPassword = WorkflowModelerApiCall.getDefaultRestPassword(); + +} + +/** + * Configuration for the urls that are used for webservices of the modeler's rest api + */ +WorkflowModelerApiCall.urls = { + MODEL : function (pModelId) + { + return "/api/editor/models/" + pModelId; + }, + MODEL_NEWVERSION : function (pModelId) + { + return "/api/editor/models/" + pModelId + "/newversion"; + }, + MODEL_THUMBNAIL : function (pModelId) + { + return "/api/editor/models/" + pModelId + "/thumbnail"; + }, + MODEL_JSON : function (pModelId) + { + return "/api/editor/models/" + pModelId + "/editor/json"; + }, + MODEL_IMPORT : function () + { + return "/api/editor/import-process-xml"; + }, + MODELS : function () + { + return "/api/editor/models"; + } +}; + +/** + * Gets the default user for the rest api. + * + * @return {String} the username + */ +WorkflowModelerApiCall.getDefaultRestUser = function () +{ + return "admin"; +} + +/** + * Gets the default password for the rest api. + * + * @return {String} the password + */ +WorkflowModelerApiCall.getDefaultRestPassword = function () +{ + return "test"; +} + +/** + * Sets the model id. + * + * @param {String} pModelId + * @return {WorkflowModelerApiCall} current object + */ +WorkflowModelerApiCall.prototype.modelId = function (pModelId) +{ + this._modelId = pModelId; + return this; +} + +/** + * Sets the workflow model that is required for create and update. + * + * @param {WorkflowModel} pModel + * @return {WorkflowModelerApiCall} current object + */ +WorkflowModelerApiCall.prototype.model = function (pModel) +{ + this._model = pModel; + if (this._modelId == null && pModel.id != null) + this._modelId = pModel.id; + return this; +} + +/** + * Sets the process xml that is required for an import to the modeler. + * + * @param {String} pProcessXML the bpmn2.0 process xml + * @return {WorkflowModelerApiCall} current object + */ +WorkflowModelerApiCall.prototype.processXML = function (pProcessXML) +{ + this._processXML = pProcessXML; + return this; +} + +/** + * Sets the user and the password for basic auth + * + * @param {String} pUser the user + * @param {String} pPassword the password + * @return {WorkflowModelerApiCall} current object + */ +WorkflowModelerApiCall.prototype.setBasicAuth = function (pUser, pPassword) +{ + this._authUser = pUser; + this._authPassword = pPassword; + return this; +} + +/** + * Helper function to make rest calls + */ +WorkflowModelerApiCall.prototype._callWebservice = function (pUrl, pHttpMethod, pHeaders, pBody, pDataTypeSend, pQueryParams) +{ + if (!this._baseUrl) + return null; + + var restConfig = net.createConfigForRestWebserviceCall() + .url(this._baseUrl + pUrl) + .dataTypeJDitoAccept(util.DATA_TEXT) + .dataTypeJDitoSend(util.DATA_TEXT) + .dataTypeSend(pDataTypeSend || MimeTypes.JSON()) + .dataTypeAccept(MimeTypes.JSON()) + .actionType(pHttpMethod); + + if (pHeaders) + { + for (let headerName in pHeaders) + restConfig.addHeader(headerName, pHeaders[headerName]); + } + if (pQueryParams) + { + for (let paramName in pQueryParams) + restConfig.addQueryParameter(paramName, pQueryParams[paramName]); + } + if (pBody) + restConfig.requestEntity(pBody); + + var authConfig = this._authUser != null + ? auth.createConfigForBasicAuth().userName(this._authUser).password(this._authPassword) + : auth.createConfigForNoAuth(); + + return net.callRestWebservice(restConfig, authConfig); +} + +/** + * Retrieves a process model from the workflow modeler rest api + * + * @return {WorkflowModel} + */ +WorkflowModelerApiCall.prototype.getModel = function () +{ + var modelJson = this._callWebservice(WorkflowModelerApiCall.urls.MODEL(this._modelId), net.GET); + if (!modelJson) + return null; + + return WorkflowModel.fromObject(JSON.parse(modelJson)); +} + +/** + * Loads the models from the workflow modeler. + * + * @return {WorkflowModel[]} array of models + */ +WorkflowModelerApiCall.prototype.getModels = function (pFilter) +{ + var headers = pFilter ? {filter : pFilter} : null; + var modelsJson = this._callWebservice(WorkflowModelerApiCall.urls.MODELS(), net.GET, headers); + + if (!modelsJson) + return []; + + var models = JSON.parse(modelsJson).data || []; + + return models.map(function (model) + { + return WorkflowModel.fromObject(model); + }); +} + +/** + * Creates a new process model in the workflow modeler over the rest api + * + * @return {WorkflowModel} representation of the created model + */ +WorkflowModelerApiCall.prototype.createModel = function () +{ + var modelJson = this._callWebservice(WorkflowModelerApiCall.urls.MODELS(), net.POST, null, JSON.stringify(this._model)); + if (!modelJson) + return null; + + return WorkflowModel.fromObject(JSON.parse(modelJson)); +} + +/** + * Imports a bpmn2.0 xml into the workflow modeler. If a model with the same key already exists, a new version will be created. + * + * @return {WorkflowModel} representation of the created model + */ +WorkflowModelerApiCall.prototype.importModel = function () +{ + var modelJson = this._callWebservice(WorkflowModelerApiCall.urls.MODEL_IMPORT(), net.POST, null, this._processXML, MimeTypes.TXT(), {userName : this._authUser}); + if (!modelJson) + return null; + + return WorkflowModel.fromObject(JSON.parse(modelJson)); +} + + diff --git a/process/workflowDeploy_rest/process.js b/process/workflowDeploy_rest/process.js new file mode 100644 index 0000000000000000000000000000000000000000..82c3ed4a98aedf4504ec4d250b36a6d6f4e19f90 --- /dev/null +++ b/process/workflowDeploy_rest/process.js @@ -0,0 +1,22 @@ +import("system.workflow"); +import("system.util"); + +function restpost (pRequest) +{ + var request = JSON.parse(pRequest); + + var processObj = JSON.parse(util.decodeBase64String(request.body)); + if (processObj && processObj.processXML) + { + var processIds = workflow.getProcessIds(processObj.processXML); + processIds = processIds != null ? JSON.parse(processIds) : []; + if (processIds.length > 0) + { + processObj.deploymentId = workflow.deployProcess(processIds[0], processObj.processXML); + request.response.statuscode = 200; + request.response.body = JSON.stringify(processObj); + } + } + + return JSON.stringify(request); +} \ No newline at end of file diff --git a/process/workflowDeploy_rest/workflowDeploy_rest.aod b/process/workflowDeploy_rest/workflowDeploy_rest.aod new file mode 100644 index 0000000000000000000000000000000000000000..05c891a90280224cd574f42e6347203f67386f3a --- /dev/null +++ b/process/workflowDeploy_rest/workflowDeploy_rest.aod @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> + <name>workflowDeploy_rest</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/workflowDeploy_rest/process.js</process> + <publishAsWebservice v="true" /> + <style>REST</style> + <restAcceptedMimeType>application/json</restAcceptedMimeType> + <restDeliveredMimeType>application/json</restDeliveredMimeType> + <jditoWebserviceUser>flowableIdmService</jditoWebserviceUser> + <variants> + <element>EXECUTABLE</element> + </variants> +</process>