Ordering/Indexing a list of created parallel multi-instances

Hi,

I have a parallel multi-instance Call Activity which iterates over a collection (a list of objects, let’s say size=5 items).
I want for each of the new created (5) instances to assign an “order” (or name it priority or indexing), e.g. one gets order=1, the other order=2, etc.

Any ideas?
Does the created instance have any iterator that comes from the parent multi-instance Call Activity? If yes, how to get this value?

Thanks!

Hi @kontrag,

have a look at the documentation for the muti instance marker.

There it says:

Additionally, each of the created executions will have an execution-local variable (i.e., not visible for the other executions and not stored on process instance level) :

  • loopCounter : indicates the index in the for each loop of that particular instance

So yes, with execution.getVariable(“loopCounter”) you can get an index for your task.

Hope this helps.

Regards
Michael

3 Likes

Thanks @MichiDahm!

That should work!
I had missed this part in the documentation.