Given
A multi-instance service task.
When
I add an input parameter to the task accessing a variable local to its MI body (e.g. the "Element Variable" of the MI).
Then
The variable local to the MI body cannot be found in the input parameter resolution.
Expected
The variable can be accessed.
Hints
- the outer scope of the input parameter is the variable scope parent, which is fetched here: https://github.com/camunda/camunda-bpm-platform/blob/3dc270a8d08aabca335d15119cf7b36c43512d94/engine/src/main/java/org/camunda/bpm/engine/impl/core/variable/mapping/IoParameter.java#L51
- for a multi instance external task with I/O mapping, the outer variable scope is the MI body execution
- for a multi instance service task with I/O mapping, the outer variable scope is the parent of the MI body execution
- for a multi instance service task with I/O mapping, the inner activity is not a scope but should probably be one (is not set to a scope for MI here: https://github.com/camunda/camunda-bpm-platform/blob/0d9729426170b5ab66478b7014d9c96b235e4f2c/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L4553)
- this might become an issue for upgrade scenarios, as an old engine version might not create enough executions that a newer engine expects to correctly fix this (may be solvable similar to other legacy behaviors in https://github.com/camunda/camunda-bpm-platform/blob/0d9729426170b5ab66478b7014d9c96b235e4f2c/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L190)
- this might become an issue in a rolling update scenario if a newer engine creates more executions than the old one expects