cancel
Showing results for 
Search instead for 
Did you mean: 

My usage error retrieving variable ?

dthknt
Champ on-the-rise
Champ on-the-rise
I created an subprocess with multiInstanceLoopCharacteristics as follows:


<subProcess id="sp_preencherPUA" name="Gera PUAs">
   <multiInstanceLoopCharacteristics isSequential="false">
      <loopDataInputRef>assignees</loopDataInputRef>
      <inputDataItem name="assignee" />
   </multiInstanceLoopCharacteristics>
   
   <startEvent id="inicioPUA" name="Inicia PUA" />   
   …..
   <endEvent id="fimSp_preencherPUA" name="End" />
</subProcess>


And as the FAQ describes "Each of the executions will have a process variable named assignee".
When I try to get it using
runtimeService.getVariable(processInstanceId, assignee); 
, as I use it everywhere on the system, it returns null.
If I change processInstanceId to executionId value, it works !
I checked the table "ACT_RU_VARIABLE", both process and execution values are there and match with Task instance values.

Is it some multi instance limitation ?

Thanks
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
The variable is indeed stored execution-local. Otherwise you'd have x 'assignee' variables on the process instance level.