cancel
Showing results for 
Search instead for 
Did you mean: 

Loop over list and assign user tasks

gi00vani_kun
Champ in-the-making
Champ in-the-making
Hi,

I am new to Activiti.

I've been working on this for 1 month now and reaching the end of my project I've got into a problem, when iterating a list in a user task as sequential the items will have the same value and they'll be displayed (User inbox as one 1 item ) but they are actually one over another (because the engine assigns  the same id to each of them( my hunch) )


<userTask id="usertask2" name="Solve ">
      <multiInstanceLoopCharacteristics isSequential="true"  activiti:collection="list2process">
        <!–loopCardinality>5</loopCardinality –>
      </multiInstanceLoopCharacteristics>
    </userTask>


And when I'm iterating in parallel the user will receive only the last value of the list ! (hence all user tasks will have the same value and not a unique one)


<userTask id="usertask2" name="Solve ">
      <multiInstanceLoopCharacteristics isSequential="false"  activiti:collection="list2process">
        <!–loopCardinality>5</loopCardinality –>
      </multiInstanceLoopCharacteristics>
    </userTask>


What am I doing wrong ? it there a way to create multiple unique user tasks and each of them to get the right value from the list ?

2 REPLIES 2

gi00vani_kun
Champ in-the-making
Champ in-the-making
I've fixed the problem myself with:

<code>
<userTask id="miTasks" name="Solve " activiti:assignee="data">
<extentionElements>
   <activiti:formProperty id="speaker ${loopCounter}" variable="list2" />
</extentionElements>
  <multiInstanceLoopCharacteristics isSequential="false">
    <loopDataInputRef>list2process</loopDataInputRef>
    <inputDataItem name="list2" />
  </multiInstanceLoopCharacteristics>
</userTask>
</code>

jbarrez
Star Contributor
Star Contributor
Thanks for posting back. Indeed, using the 'hidden' variables is a way to differentiate.