diff --git a/entity/WorkflowSignal_entity/WorkflowSignal_entity.aod b/entity/WorkflowSignal_entity/WorkflowSignal_entity.aod index 22dc96a8eb8d17d0d5e17b8e8c9ad8f9e5d736f8..05b77e9fea96cde4f1b68245d886d207ff6d41df 100644 --- a/entity/WorkflowSignal_entity/WorkflowSignal_entity.aod +++ b/entity/WorkflowSignal_entity/WorkflowSignal_entity.aod @@ -154,9 +154,6 @@ <name>PROCESSDEFINITION_KEY.value</name> <recordfield>WORKFLOWSIGNAL.PROCESSDEFINITION_KEY</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>ICON.value</name> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>VARIABLES.value</name> <recordfield>WORKFLOWSIGNAL.VARIABLES</recordfield> diff --git a/entity/WorkflowSignal_entity/recordcontainers/db/conditionProcess.js b/entity/WorkflowSignal_entity/recordcontainers/db/conditionProcess.js index 1bae28698e6ca6fea69f1f2327b507defec4368e..f923d3d4080f7f52d60664e2d6fefe329ff35cf2 100644 --- a/entity/WorkflowSignal_entity/recordcontainers/db/conditionProcess.js +++ b/entity/WorkflowSignal_entity/recordcontainers/db/conditionProcess.js @@ -1,6 +1,16 @@ +import("system.vars"); +import("system.workflow"); import("Sql_lib"); import("system.result"); -var cond = newWhereIfSet("WORKFLOWSIGNAL.PROCESSDEFINITION_KEY", "$param.ProcessDefinitionKey_param"); +//include all signals with the same names as the ones in the current workflow definition to avoid conflicts +var signals = JSON.parse(workflow.getSignalDefinitions(vars.get("$param.ProcessDefinitionId_param"))); +var signalNames = signals.map(function (signal) +{ + return signal.name; +}); + +var cond = newWhereIfSet("WORKFLOWSIGNAL.PROCESSDEFINITION_KEY", "$param.ProcessDefinitionKey_param") + .orIfSet("WORKFLOWSIGNAL.SIGNAL_NAME", signalNames, SqlBuilder.IN()); result.string(cond.toString()); \ No newline at end of file diff --git a/entity/WorkflowStartConfig_entity/WorkflowStartConfig_entity.aod b/entity/WorkflowStartConfig_entity/WorkflowStartConfig_entity.aod index d0a308b0c5f3f4c97b54e14d9797bb4a35b055b5..52186117b0ede7cb65a57fce5de0b5b2056a2c14 100644 --- a/entity/WorkflowStartConfig_entity/WorkflowStartConfig_entity.aod +++ b/entity/WorkflowStartConfig_entity/WorkflowStartConfig_entity.aod @@ -4,6 +4,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/WorkflowStartConfig_entity/documentation.adoc</documentation> <title>Usage</title> + <imageProcess>%aditoprj%/entity/WorkflowStartConfig_entity/imageProcess.js</imageProcess> <titlePlural>Usage</titlePlural> <recordContainer>db</recordContainer> <entityFields> @@ -18,6 +19,7 @@ <title>Module</title> <consumer>Contexts</consumer> <mandatory v="true" /> + <displayValueProcess>%aditoprj%/entity/WorkflowStartConfig_entity/entityfields/object_type/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>TRIGGER_EVENT</name> diff --git a/entity/WorkflowStartConfig_entity/entityfields/object_type/displayValueProcess.js b/entity/WorkflowStartConfig_entity/entityfields/object_type/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..af662ad2474d3da0e5b3deab7764de0ad29d39bc --- /dev/null +++ b/entity/WorkflowStartConfig_entity/entityfields/object_type/displayValueProcess.js @@ -0,0 +1,6 @@ +import("Context_lib"); +import("system.result"); +import("system.vars"); + +var context = vars.get("$field.OBJECT_TYPE"); +result.string(context ? ContextUtils.getTitle(context, true) : ""); \ No newline at end of file diff --git a/entity/WorkflowStartConfig_entity/imageProcess.js b/entity/WorkflowStartConfig_entity/imageProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..34147b89bd271ec01be2bb3fa1c6eb055186963f --- /dev/null +++ b/entity/WorkflowStartConfig_entity/imageProcess.js @@ -0,0 +1,6 @@ +import("system.result"); +import("system.vars"); +import("system.project"); + +var contextModel = project.getDataModel(project.DATAMODEL_KIND_CONTEXT, vars.get("$field.OBJECT_TYPE")); +result.string(contextModel ? contextModel[5] : ""); \ No newline at end of file diff --git a/neonView/WorkflowStartConfigFilter_view/WorkflowStartConfigFilter_view.aod b/neonView/WorkflowStartConfigFilter_view/WorkflowStartConfigFilter_view.aod index 4b53e42cfc3e3ad67b10f25653df09bf611a0fe7..cdac1faccf7f16acf27044fd57f434dea9502e3c 100644 --- a/neonView/WorkflowStartConfigFilter_view/WorkflowStartConfigFilter_view.aod +++ b/neonView/WorkflowStartConfigFilter_view/WorkflowStartConfigFilter_view.aod @@ -15,12 +15,12 @@ <autoNewRow v="true" /> <columns> <neonTableColumn> - <name>0784e90b-133d-4d2b-b499-ac731a690f64</name> - <entityField>OBJECT_TYPE</entityField> + <name>4935777f-8760-4759-a70a-0ad64c506418</name> + <entityField>#IMAGE</entityField> </neonTableColumn> <neonTableColumn> - <name>c8b4032c-ce59-45fe-ab03-e393f8cdc050</name> - <entityField>TRIGGER_EVENT</entityField> + <name>0784e90b-133d-4d2b-b499-ac731a690f64</name> + <entityField>OBJECT_TYPE</entityField> </neonTableColumn> </columns> </tableViewTemplate> diff --git a/process/Workflow_lib/process.js b/process/Workflow_lib/process.js index 39b2bdb10b70dc7c9f72e17087f1d144cdb59219..179875a721eeee920de4ed7fa72752661fcefbe9 100644 --- a/process/Workflow_lib/process.js +++ b/process/Workflow_lib/process.js @@ -204,8 +204,9 @@ WorkflowSignalSender.deleted = function (pTargetId, pTargetContext) * @param {String} pEvent event * @param {String} pTargetId uid of the dataset * @param {String} pTargetContext context of the dataset + * @param {Object} pVariables additional variables to set */ -WorkflowSignalSender.eventHappened = function (pEvent, pTargetId, pTargetContext) +WorkflowSignalSender.eventHappened = function (pEvent, pTargetId, pTargetContext, pVariables) { var variables = WorkflowVariables.getTargetVariables(pTargetId, pTargetContext); @@ -214,7 +215,7 @@ WorkflowSignalSender.eventHappened = function (pEvent, pTargetId, pTargetContext { if (_checkCondition(signal.entity, variables[WorkflowVariables.TARGET_ID()], signal.condition)) { - var filteredVariables = {}; + var filteredVariables = pVariables || {}; signal.variables.forEach(function (varName) { filteredVariables[varName] = variables[varName];