cancel
Showing results for 
Search instead for 
Did you mean: 

How to get an MI UserTask variable on Java

luisalves00
Champ in-the-making
Champ in-the-making
Hello,


got this:


<userTask id="usertask2" name="Card Programming (${ppItem.pp.name})"
         activiti:candidateUsers="${ppItem.programmmers}">
         <multiInstanceLoopCharacteristics
            isSequential="false">
            <loopDataInputRef>ppList</loopDataInputRef>
            <inputDataItem name="ppItem" />
         </multiInstanceLoopCharacteristics>
      </userTask>

I was trying to do this:


//PPTaskModel ppModel = (PPTaskModel) getActivitiEngine().getRuntimeService().ge getVariable(task.getProcessInstanceId(), "ppItem"); 

but this is not a global process variable…how do I get it then?
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
The variables of a Multi instance are stored on the execution, not on the process instance.
This is because, if you have multiple parallel executions in the multi instance, they would override each other if you put them on the process instance.

So, execute the same method you have there, but instead of the process instance id, you now use the execution id of the task.

luisalves00
Champ in-the-making
Champ in-the-making
it's so easy Smiley Happy tks.

I understood the problem but was expecting some weird method to get the variables from the execution.