AnsweredAssumed Answered

MultiInstance loop variable in execution listener

Question asked by h.ter.schuur on Dec 20, 2011

I'm struggling with multi instance behavior on a sub process. I have a workflow with a subprocess with multi instance behavior.
I start this workflow with a list of assignees. The subprocess should be executed for each assignee in the assignees list. Basically the multi instance behavior works as expected, the script task in the subprocess is correctly executed for each assignee.

However, the strange part is in the execution listener on the sub process. The sub process does not 'see' the loop variable in the first loop execution. In all further loop invocations the execution listener sees the correct loop variable.

I have attached a simplified maven project which demonstrates this case. The output when I perform a
mvn test
is the following:
From listener: null
From script task: john
From listener: jane
From script task: jane
From listener: matt
From script task: matt
I expect the first From listener to read:
From listener: john

Is this a bug or am I doing something wrong?