AnsweredAssumed Answered

How to set input parameters in Multi-instance callActivity

Question asked by fuhang on Nov 4, 2016
Latest reply on Nov 4, 2016 by fuhang
I have a main process and the main process call a subprocess in callActivity, I have some trouble in multi-instance of callActivity.
1. process definition snippet:
<!– main process –>
<callActivity id="riskcontrol-department-handle-subprocess" name="callauditsubprocess" calledElement="audit-subprocess">
    <activiti:in source="cosponser" target="assignee"></activiti:in>
    <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${cosponsers}" activiti:elementVariable="cosponser"></multiInstanceLoopCharacteristics>

<!– subprocess: audit-subprocess–>
<process id="audit-subprocess" name="audit-subprocess" isExecutable="true">
    <userTask id="testTask" name="testTask" activiti:assignee="${assignee}"></userTask>

2. code snippet:
String taskId = "…";
List<String> cosponsers = new ArrayList<String>( 2 );
cosponsers.add( "x" );
cosponsers.add( "y" );
variables.put( "cosponsers", cosponsers );
taskService.complete( taskId, variables );

3. problem:
    I can't instance two testTasks in subprocess with the %{assignee} of task assignee, but the database record can be find a act_ru_task record without assignee. How to transfer activiti:elementVariable="cosponser" to activiti:assignee="${assignee}" ?