Pass multiple collections to multiple instance call activity

Hi,

I have created a multiple instance call activity process and need to pass due date, assignee and category to every task created in this multiple instance. The multiple instance task is getting created but with assignee as null.

variables.put("actionCount", 3);
Set<String> actionAssignees = new HashSet<>();
actionAssignees.add("bradpitt");
actionAssignees.add("angelinajolie");
actionAssignees.add("tomcruise");
variables.put("actionAssignees", actionAssignees);


<callActivity id="callactivity1" name="Call activity" calledElement="actionFlow" activiti:inheritVariables="false">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="actionAssignees" activiti:elementVariable="assignee">
<loopCardinality>${actionCount}</loopCardinality>
</multiInstanceLoopCharacteristics>
</callActivity>

As you can see, I am passing actionAssignees collection containing assignee name but when the actions are created in sub process the assignees are null.

I also need to pass different due dates to each task in the sub process created and want to set a common category. How do I pass collection of due dates in this multi instance loop ???

Awaiting for a response

Hi amit,

Did you use the variable “assignee” in the process modeler while setting the assignee for the task bcoz according to documentation, "activiti:elementVariable=“assignee” will set a variable named “assignee” to one of the names in the list in the local execution scope of the task, so then task will automatically pick up the name of the assignee from the variable.

For the due date part, i dont know how we can do it. curious to get an answer from someone on the flowable team.

Thank You,
Arpit Agrawal

Thanks but assignees is working now. But I need a solution how do I set duedate for every task??

Please guide. Thanks

Has anyone passed due dates to multi instance call activity ?? Please guide

Hi Amitshukla.

DueDates can be set only on userTasks. Set dueDate in the called subprocess.
see https://github.com/flowable/flowable-engine/blob/ee4f943f49f9b05b7fcc4bae0e11a78efa5a07b9/modules/flowable-engine/src/test/java/org/flowable/engine/test/bpmn/usertask/TaskDueDateExtensionsTest.java

<startEvent id="theStart" />

<sequenceFlow id="flow1" sourceRef="theStart" targetRef="theTask" />

<userTask id="theTask" name="my task" activiti:dueDate="${dateVariable}" />

<sequenceFlow id="flow2" sourceRef="theTask" targetRef="theEnd" />

<endEvent id="theEnd" />

Regards
Martin

Thanks for the reply martin. How can I get the new process instance Ids created in the multi instance call activity process. There seems to be no mapping of the call-activity sub process with the parent process id…

In the expression, you can use execution.processInstanceId to get the id of the process instance of the called process.

  1. Will this return parent process Id or call activity process instance Id ??? I have parent process Id stored. I am maintaining a table wherein I need to store mapping of call activity multi instance process Ids mapped to parent process Id. I need all the new process instance Ids created in the multi instance call activity process when the previous task is completed and transition happens to multi instance call activity…
  2. Where to put in the expression ???

How to retrieve the Process Instance IDs of the multi instance call activity subprocess from the parent process ID ?