diff --git a/entity/Organisation_entity/afterOperatingState.js b/entity/Organisation_entity/afterOperatingState.js index 95c27335097d5a484f25b37e679dbc332eb8302a..1dea5d13d3bc15a4c3ea5d89f6c4bebdc4fd0007 100644 --- a/entity/Organisation_entity/afterOperatingState.js +++ b/entity/Organisation_entity/afterOperatingState.js @@ -5,4 +5,5 @@ if (vars.exists("$context.workflowQueue") && vars.get("$context.workflowQueue")) { WorkflowStarter.inserted(vars.get("$context.workflowQueue")); vars.set("$context.workflowQueue", null); -} \ No newline at end of file +} +WorkflowSignalSender.doInsertedOrUpdated(); diff --git a/entity/Organisation_entity/recordcontainers/db/onDBDelete.js b/entity/Organisation_entity/recordcontainers/db/onDBDelete.js index a964f1770ac6b37ae9ddc69d963436b9bb9661d9..f17ef01bdde97defb85b512fc778df3cb61bae4e 100644 --- a/entity/Organisation_entity/recordcontainers/db/onDBDelete.js +++ b/entity/Organisation_entity/recordcontainers/db/onDBDelete.js @@ -5,4 +5,5 @@ import("DuplicateScanner_lib"); let contactId = vars.get("$field.CONTACTID"); DuplicateScannerUtils.DeleteCachedDuplicate(contactId); -WorkflowStarter.deleted(); \ No newline at end of file +WorkflowStarter.deleted(); +WorkflowSignalSender.deleted(); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/onDBInsert.js b/entity/Organisation_entity/recordcontainers/db/onDBInsert.js index 658ba4e14cb08f09df3fd7347906ed6b6db7324d..f4265e2aa520a94c84d0395e3dd25241cf251ccf 100644 --- a/entity/Organisation_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Organisation_entity/recordcontainers/db/onDBInsert.js @@ -1,4 +1,6 @@ +import("Workflow_lib"); import("system.vars"); //start the execution in afterOperatingState, because here the dataset is not yet inserted -vars.set("$context.workflowQueue", {}); \ No newline at end of file +vars.set("$context.workflowQueue", {}); +WorkflowSignalSender.markInserted(); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js b/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js index 5738b35a68a596799ae8c74974107c811a9e6aea..166750a8ae152b299fa2eea4555f5cee52401e3c 100644 --- a/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/Organisation_entity/recordcontainers/db/onDBUpdate.js @@ -15,4 +15,5 @@ FieldChanges.assimilateChangeAndDispose("$field.STANDARD_PHONE_COMMUNICATION", f CommUtil.setStandardPhone(uid, value); }); -WorkflowStarter.updated(); \ No newline at end of file +WorkflowStarter.updated(); +WorkflowSignalSender.markUpdated(); \ No newline at end of file diff --git a/entity/Person_entity/afterOperatingState.js b/entity/Person_entity/afterOperatingState.js index 95c27335097d5a484f25b37e679dbc332eb8302a..e793ce58bd20d6ec97ea7fb7f1fc8b645ab6c493 100644 --- a/entity/Person_entity/afterOperatingState.js +++ b/entity/Person_entity/afterOperatingState.js @@ -5,4 +5,5 @@ if (vars.exists("$context.workflowQueue") && vars.get("$context.workflowQueue")) { WorkflowStarter.inserted(vars.get("$context.workflowQueue")); vars.set("$context.workflowQueue", null); -} \ No newline at end of file +} +WorkflowSignalSender.doInsertedOrUpdated(); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/onDBDelete.js b/entity/Person_entity/recordcontainers/db/onDBDelete.js index a964f1770ac6b37ae9ddc69d963436b9bb9661d9..f17ef01bdde97defb85b512fc778df3cb61bae4e 100644 --- a/entity/Person_entity/recordcontainers/db/onDBDelete.js +++ b/entity/Person_entity/recordcontainers/db/onDBDelete.js @@ -5,4 +5,5 @@ import("DuplicateScanner_lib"); let contactId = vars.get("$field.CONTACTID"); DuplicateScannerUtils.DeleteCachedDuplicate(contactId); -WorkflowStarter.deleted(); \ No newline at end of file +WorkflowStarter.deleted(); +WorkflowSignalSender.deleted(); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/onDBInsert.js b/entity/Person_entity/recordcontainers/db/onDBInsert.js index 39b660ad34493019ba48bf77c9f5d688b0f72820..c9a099d7e32d80d60f678746b1f520b4bec5cc61 100644 --- a/entity/Person_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Person_entity/recordcontainers/db/onDBInsert.js @@ -1,3 +1,4 @@ +import("Workflow_lib"); import("system.util"); import("Sql_lib"); import("system.db"); @@ -10,6 +11,7 @@ DataPrivacyUtils.notifyNeedDataPrivacyUpdate(contactId); //start the execution in afterOperatingState, because here the dataset is not yet inserted vars.set("$context.workflowQueue", {}); +WorkflowSignalSender.markInserted(); //let valuesToCheck = {}; // diff --git a/entity/Person_entity/recordcontainers/db/onDBUpdate.js b/entity/Person_entity/recordcontainers/db/onDBUpdate.js index 0e8c2769a286c142ab77ddf31f284d62c33347e0..b62e00ce63a175bdf7e5e3e0132917661ed27b5e 100644 --- a/entity/Person_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/Person_entity/recordcontainers/db/onDBUpdate.js @@ -43,4 +43,5 @@ vars.get("$local.changed").forEach(function(fieldName) DataPrivacyUtils.notifyNeedDataPrivacyUpdate(uid); -WorkflowStarter.updated(); \ No newline at end of file +WorkflowStarter.updated(); +WorkflowSignalSender.markUpdated(); \ No newline at end of file diff --git a/entity/WorkflowSignal_entity/WorkflowSignal_entity.aod b/entity/WorkflowSignal_entity/WorkflowSignal_entity.aod index 294159191527fe53bc9bc5861361c3b05c987992..ba7132b64300d6f70d888c795b9b908e69693f1a 100644 --- a/entity/WorkflowSignal_entity/WorkflowSignal_entity.aod +++ b/entity/WorkflowSignal_entity/WorkflowSignal_entity.aod @@ -15,6 +15,7 @@ <entityField> <name>SIGNAL_NAME</name> <title>Signal</title> + <mandatory v="true" /> <dropDownProcess>%aditoprj%/entity/WorkflowSignal_entity/entityfields/signal_name/dropDownProcess.js</dropDownProcess> </entityField> <entityField> @@ -35,10 +36,11 @@ <name>TRIGGER_EVENT</name> <title>Trigger</title> <consumer>TriggerKeyword</consumer> + <mandatory v="true" /> </entityField> <entityField> <name>OBJECT_CONDITION</name> - <title>Condition</title> + <title>${CONDITION}</title> <contentType>FILTER_TREE</contentType> <valueProcess>%aditoprj%/entity/WorkflowSignal_entity/entityfields/object_condition/valueProcess.js</valueProcess> </entityField> @@ -84,6 +86,10 @@ <expose v="true" /> <mandatory v="true" /> </entityParameter> + <entityField> + <name>ICON</name> + <contentType>IMAGE</contentType> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -120,6 +126,7 @@ <dbRecordFieldMapping> <name>TRIGGER_EVENT.value</name> <recordfield>WORKFLOWSIGNAL.TRIGGER_EVENT</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>TRIGGER_EVENT.displayValue</name> @@ -129,6 +136,10 @@ <name>PROCESSDEFINITION_KEY.value</name> <recordfield>WORKFLOWSIGNAL.PROCESSDEFINITION_KEY</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ICON.value</name> + <expression>%aditoprj%/entity/WorkflowSignal_entity/recordcontainers/db/recordfieldmappings/icon.value/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/WorkflowSignal_entity/entityfields/signal_name/dropDownProcess.js b/entity/WorkflowSignal_entity/entityfields/signal_name/dropDownProcess.js index f61a89cec96de12e7b0e21d989540d72401de0f4..50e53ca72a8aa2cd220405357914682f63e92a56 100644 --- a/entity/WorkflowSignal_entity/entityfields/signal_name/dropDownProcess.js +++ b/entity/WorkflowSignal_entity/entityfields/signal_name/dropDownProcess.js @@ -1,13 +1,13 @@ -//import("system.result"); -//import("system.workflow"); -//import("system.vars"); -// -//var processDefinitionId = vars.get("$param.ProcessDefinitionId_param"); -//var signals = processDefinitionId -// ? JSON.parse(workflow.getSignalDefinitions(processDefinitionId)) -// : []; -// -//result.object(signals.map(function (signal) -//{ -// return [signal.name, signal.name]; -//})); \ No newline at end of file +import("system.result"); +import("system.workflow"); +import("system.vars"); + +var processDefinitionId = vars.get("$param.ProcessDefinitionId_param"); +var signals = processDefinitionId + ? JSON.parse(workflow.getSignalDefinitions(processDefinitionId)) + : []; + +result.object(signals.map(function (signal) +{ + return [signal.name, signal.name]; +})); \ No newline at end of file diff --git a/entity/WorkflowSignal_entity/recordcontainers/db/recordfieldmappings/icon.value/expression.js b/entity/WorkflowSignal_entity/recordcontainers/db/recordfieldmappings/icon.value/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/WorkflowTask_entity/WorkflowTask_entity.aod b/entity/WorkflowTask_entity/WorkflowTask_entity.aod index f7a1b1a9539d11f520ea7dbbf9c294e6a9efcb95..326f57420cfa813f242b21e35904ba0a7a38765b 100644 --- a/entity/WorkflowTask_entity/WorkflowTask_entity.aod +++ b/entity/WorkflowTask_entity/WorkflowTask_entity.aod @@ -120,6 +120,7 @@ <name>ISACTIVE</name> <title>Active</title> <contentType>BOOLEAN</contentType> + <dropDownProcess>%aditoprj%/entity/WorkflowTask_entity/entityfields/isactive/dropDownProcess.js</dropDownProcess> </entityField> <entityField> <name>CLAIM_TIME</name> diff --git a/entity/WorkflowTask_entity/entityfields/isactive/dropDownProcess.js b/entity/WorkflowTask_entity/entityfields/isactive/dropDownProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..a5eec56c41ae0c48e898c88e9a5f81ab17c043af --- /dev/null +++ b/entity/WorkflowTask_entity/entityfields/isactive/dropDownProcess.js @@ -0,0 +1,7 @@ +import("system.translate"); +import("system.result"); + +result.object([ + ["true", translate.text("Yes")], + ["false", translate.text("No")] +]); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index d6cfab21d345b7514e619d3e44ccd9b00ea15118..00d7b607eb6d7d4091c752db80066f35724867b9 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -6074,6 +6074,9 @@ <entry> <key>{SEARCH_INDEX_TITLE}</key> </entry> + <entry> + <key>${CONDITION}</key> + </entry> <entry> <key>${CANCELLED}</key> </entry> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 8dcdc61707fa3ffe4a65f4477e3b5fb03690430d..5fab92102f80050fb46b6a10304c2225ee393d20 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -10,6 +10,10 @@ <key>{SEARCH_INDEX_TITLE}</key> <value>Suche</value> </entry> + <entry> + <key>Signals</key> + <value>Signale</value> + </entry> <entry> <key>Data imported. Contact not found.</key> <value>Daten importiert. Keine weiteren Personendaten gefunden.</value> @@ -101,6 +105,10 @@ <key>No letters</key> <value>Keine Briefe</value> </entry> + <entry> + <key>${CONDITION}</key> + <value>Bedingung</value> + </entry> <entry> <key>Failed</key> <value>Fehlgeschlagen</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 90ce4c7dde7e321231c5e7675790cb42502c7730..982fb10ef62a569a307343e26a3c353f01546c2b 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -6133,6 +6133,10 @@ <key>{SEARCH_INDEX_TITLE}</key> <value>Search</value> </entry> + <entry> + <key>${CONDITION}</key> + <value>Condition</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/WorkflowSignal/WorkflowSignal.aod b/neonContext/WorkflowSignal/WorkflowSignal.aod index af6b238d6feb60c6467deb3b70de3624cb81ce94..23a00e62cef23dbba1b7d79d22cc17a91969d7a0 100644 --- a/neonContext/WorkflowSignal/WorkflowSignal.aod +++ b/neonContext/WorkflowSignal/WorkflowSignal.aod @@ -5,6 +5,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <filterView>WorkflowSignalFilter_view</filterView> <editView>WorkflowSignalEdit_view</editView> + <previewView>WorkflowSignalPreview_view</previewView> <entity>WorkflowSignal_entity</entity> <references> <neonViewReference> diff --git a/neonView/WorkflowSignalPreview_view/WorkflowSignalPreview_view.aod b/neonView/WorkflowSignalPreview_view/WorkflowSignalPreview_view.aod index 2b648167cc55f5892350e33645fec4ca4c398bf5..141af77b7e7980f0cab82d741b371b15006d5a9e 100644 --- a/neonView/WorkflowSignalPreview_view/WorkflowSignalPreview_view.aod +++ b/neonView/WorkflowSignalPreview_view/WorkflowSignalPreview_view.aod @@ -7,4 +7,29 @@ <name>layout</name> </headerFooterLayout> </layout> + <children> + <cardViewTemplate> + <name>Card</name> + <titleField>SIGNAL_NAME</titleField> + <entityField>#ENTITY</entityField> + </cardViewTemplate> + <genericViewTemplate> + <name>Generic</name> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>6647006f-e790-4317-9374-d1a560464a12</name> + <entityField>TRIGGER_EVENT</entityField> + </entityFieldLink> + <entityFieldLink> + <name>bc231729-e6d0-457e-8eae-f8c972d8a79a</name> + <entityField>OBJECT_TYPE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>134903ad-9033-4057-9693-ab0fd5b3b6c4</name> + <entityField>OBJECT_CONDITION</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> </neonView> diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index b07b9e75034a620e2cbfc8fceb6bdc84dcd681fe..09ddf0d0c55da6670fb793b886db9bfef8938ecf 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -1055,17 +1055,14 @@ SqlBuilder.prototype.join = function(pTable, pCondition, pTableAlias, pPrefix, p if (pPrefix) prefix = pPrefix + " " + prefix; - var postfix = "on"; + var postfix = pCondition ? "on" : ""; if (pTableAlias) postfix = pTableAlias + " " + postfix; else if (pTable instanceof SqlBuilder && pTable._subselectAlias) postfix = pTable._subselectAlias + " " + postfix; - if (!pCondition) - postfix = ""; - - var joinPart = SqlBuilder._getStatement(pTable, prefix, postfix); + var joinPart = SqlBuilder._getStatement(pTable, prefix, postfix.trim()); if (pCondition) { diff --git a/process/Workflow_lib/process.js b/process/Workflow_lib/process.js index c30ab64c7b24a07b391c859629d805fcb4869c77..56b195bb0c108d9292c82873635991e99d2985bf 100644 --- a/process/Workflow_lib/process.js +++ b/process/Workflow_lib/process.js @@ -134,6 +134,7 @@ WorkflowStarter._startProcessByAction = function (pAction, pVariables, pTargetId }); } + function WorkflowSignalSender () {} WorkflowSignalSender.EVENT_INSERT = function ()