AnsweredAssumed Answered

Multi-instance cardinality does not work with a variable

Question asked by kecondezo on May 7, 2016
Latest reply on May 16, 2016 by kecondezo
I have the next xml of my bpmn task where I am trying that the loopcounter be variable (watch the line <loopCardinality>${loopCounter}</loopCardinality> ) And This variable is part of the start event form.
     <startEvent id="startevent1" name="Start">
      <extensionElements>
        <activiti:formProperty id="customerName" name="Name" type="string" required="true"></activiti:formProperty>
        <activiti:formProperty id="customerEmail" name="email" type="string" required="true"></activiti:formProperty>
        <activiti:formProperty id="trainingTopic" name="Topic for Training" type="string" required="true"></activiti:formProperty>
        <activiti:formProperty id="trainingDate" name="Training Date" type="date" datePattern="dd-MM-yy" required="true"></activiti:formProperty>
        <activiti:formProperty id="loopCounter" name="Contador" type="long"></activiti:formProperty>
      </extensionElements>
    </startEvent>
    <userTask id="usertask1" name="Business Development Executive" activiti:assignee="gonzo">
      <extensionElements>
        <activiti:formProperty id="custName" name="Customer Name" type="string" expression="${customerName}" writable="false"></activiti:formProperty>
        <activiti:formProperty id="trainTopic" name="Training Topic" type="string" expression="${trainingTopic}" writable="false"></activiti:formProperty>
        <activiti:formProperty id="trainDate" name="Training Date" type="date" expression="${trainingDate}" datePattern="dd-MM-yy" writable="false"></activiti:formProperty>
        <activiti:formProperty id="trainerName" name="Trainer Name" type="string" required="true"></activiti:formProperty>
        <activiti:formProperty id="trainerMailId" name="Trainer ID" type="string" required="true"></activiti:formProperty>
      </extensionElements>
      <multiInstanceLoopCharacteristics isSequential="true">
        <loopCardinality>${loopCounter}</loopCardinality>
      </multiInstanceLoopCharacteristics>
    </userTask>


The issue is that when I start an instance, this automatically create 2  Business Development Executive tasks at the same time which is something that does not happen if I put the  loopCardinality variable fix ( I mean put 5 instead of loopcounter). Well the instance starts and as I said now "gonzo" has to Business Development Executive task but when gonzo try to complete the tasks this error message appears in activiti explorer:
 User Task Should not be signalled before complete 


So gonzo cannot close the tasks.

Outcomes