cancel
Showing results for 
Search instead for 
Did you mean: 

A question about MultiInstance and Listener.

impulsehu
Champ in-the-making
Champ in-the-making
According to the following bpmn code, I create a usertask node, and add a create event listener and a multiinstanceloop element.
In BPMN2.0 , we all know that we need prepare some necessary params before create usertask at a multiinstanceloop task. Like demo code, we must prepare "vote1_ParticipatorCollection" and " vote1_ManualRate" params. So, i add a create event listener "xxx.UserTaskCreateListener" for this usertask. In this listener, i set params for the delegateTask of listener , but when i start a processinstance for this processdefinition, i receive a exception message for some var is not found.

Can someone explain to me for this exception and my code, thx.

<userTask id="vote1" name="vote1" activiti:assignee="${participator}">
   <extensionElements>
      <activiti:taskListener event="create" class="xxx.UserTaskCreateListener">
         <activiti:field name="interceptorStack">
            <activiti:string>MultiInst</activiti:string>
         </activiti:field>
      </activiti:taskListener>
   </extensionElements>
   <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="vote1_ParticipatorCollection" activiti:elementVariable="participator" >
      <completionCondition>${nrOfCompletedInstances/nrOfInstances >= vote1_ManualRate}</completionCondition>
   </multiInstanceLoopCharacteristics>
</userTask>
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
The variables need to be available BEFORE the multi instance. The task is only created once the multi instance is already started.