Nested multi-instance activities do not work

Description

Multi-instance activity within another multi-instance activity does not work. The inner one is not initialized correctly.

The problem seems to be in this:

class MultiInstanceActivityBehavior, method execute(ActivityExecution execution);

originally it looks like this:

However, the inner multi-instance cycle "sees" here the loopCounter from the parent one, so it does not properly initialize its own instance. After replacing getLoopVariable call with "getLoopVariableLocal", looking e.g. like this:

it seems to run.

There seem to be more faults in code dealing with multi-instance things related to variable scopes, like several of "setLoopVariable" calls, which do not distinguish between scopes - they place all the information in the local scope, although some data should go to local scope, and other to the parent one (e.g. SequentialMultiInstanceBehavior, lines 43-46).

Environment

None

Assignee

Frederik Heremans

Reporter

Pavol Mederly

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure