Using element variable (multi instance) in expression in a form

#1

I have a service task that outputs a java.util.ArrayList<string>. I would like to create a user task for each item in that array. The user task should have a form in which the corresponding item is referenced. I have included a screenshot of my failed attempt below.

Suppose that items = ["A", "B", "C"]
This does indeed create 3 tasks: “Form: A”, “Form: B”, “Form: C”.
So far so good.
However, when I open any of the three forms, the expression within the form always evaluates to “C” (the last item in the array). Why does this happen? And how can I prevent this?

Note that everything works as expected if I use multi-instance type ‘sequential’ instead of ‘parallel’, but this is not an option because I would like to start all tasks at the same time.

Process

I couldn’t include a screenshot of the form as new users are only allowed to use one image. The form only has one expression: ${ item }.

#2

im also looking for a solution for this problem. as above mentioned i get same value for Element variable for all multi instances when i choose sequential false(parallel). can anyone suggest a solution to get element variable values in collection for each instance.

#3

Hi,

Following example could help you:

Regards
Martin