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

Start workflow serial action

parent 2944c57c
No related branches found
No related tags found
No related merge requests found
......@@ -919,6 +919,14 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
<iconId>VAADIN:ENVELOPES</iconId>
<tooltipProcess>%aditoprj%/entity/Person_entity/entityfields/campaignactiongroup/children/addtoserialletter/tooltipProcess.js</tooltipProcess>
</entityActionField>
<entityActionField>
<name>startMultipleWorkflows</name>
<title>Start workflow</title>
<onActionProcess>%aditoprj%/entity/Person_entity/entityfields/campaignactiongroup/children/startmultipleworkflows/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<isSelectionAction v="true" />
<iconId>VAADIN:PLAY</iconId>
</entityActionField>
</children>
</entityActionGroup>
<entityActionGroup>
......@@ -1078,13 +1086,6 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
<name>STANDARD_CITY</name>
<title>City</title>
</entityField>
<entityActionField>
<name>startWorkflow</name>
<title>Start workflow</title>
<onActionProcess>%aditoprj%/entity/Person_entity/entityfields/startworkflow/onActionProcess.js</onActionProcess>
<iconId>VAADIN:PLAY</iconId>
<state>INVISIBLE</state>
</entityActionField>
<entityProvider>
<name>QuickEntryContacts</name>
<titlePlural>Additional Contacts</titlePlural>
......@@ -1107,6 +1108,12 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
</entityParameter>
</children>
</entityProvider>
<entityActionField>
<name>startWorkflow</name>
<title>Start workflow</title>
<onActionProcess>%aditoprj%/entity/Person_entity/entityfields/startworkflow/onActionProcess.js</onActionProcess>
<iconId>VAADIN:PLAY</iconId>
</entityActionField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.vars");
import("Workflow_lib");
WorkflowUtils.openNewInstance(null, vars.get("$sys.selection"));
\ No newline at end of file
......@@ -2,4 +2,15 @@ import("Workflow_lib");
import("system.vars");
import("system.workflow");
var uid = workflow.startProcessByKey(vars.get("$local.rowdata")["KEY.value"], JSON.parse(vars.getString("$param.ProcessVariables_param")));
var variables = JSON.parse(vars.getString("$param.ProcessVariables_param"));
var targetIds;
if (Array.isArray(variables.targetId))
targetIds = variables.targetId.slice();
else
targetIds = [variables.targetId];
targetIds.forEach(function (id)
{
variables.targetId = id;
workflow.startProcessByKey(vars.get("$local.rowdata")["KEY.value"], variables);
});
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