I am implementing a multi-instance service task like this
myCollection is a list of maps. I am getting the elements and adding a new variable to each map like this using a Java class that extends AbstractBpmnActivityBehavior
public class Test extends AbstractBpmnActivityBehavior{
@Override
public void execute(ActivityExecution execution) {
var inputData = (Map<String, String>) execution.getVariable("myItem");
inputData.put("additionalVariable", "additional value");
}
}
You can see that I am not updating the process instance variables per se, but just adding a new entry to the object inputData
However, I see that myItem variables are being updated automatically as shown below

I wanted to ask why the value of myItem is updated automatically even if I did not explicitly update the value with execution.setVariable(…)

