Skip to content
Snippets Groups Projects
Commit 305fd250 authored by S.Listl's avatar S.Listl
Browse files

Optimisation of workflow signals and workflow_lib

parent ae2ee267
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
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
......@@ -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>
......
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
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
......@@ -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>
......
......@@ -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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment