Multi instance variable aggregation result in empty json

Hello, I am trying to use multi instance variable aggregation feature in BPMN diagrams but unfortunately with no success.
I have one bpmn diagram which has call activity configured as multi instance and this call activity execute another bpmn diagram which has one service task calling JavaDelegate implemented class. Inside this class variable is set by calling “execution.setVariable(“servicesToCreate”,“someValue”)” and this is done by multiple instances of that call activity. After all instances of call activity finished I try to read aggregated variable from parent bpmn diagram in service task but I receive ArrayNode with multiple JsonNode objects(count in the list depends on multi instance execution) but they are empty and I cannot find why I can’t get these values.

part from my bpmn xml:

<callActivity id=“processBatchesSequentially” name=“Process Resource Batches Sequentially” flowable:async=“true” calledElement=“processBatches” flowable:calledElementType=“key” flowable:inheritVariables=“true” flowable:completeAsync=“true” flowable:fallbackToDefaultTenant=“false”>

<multiInstanceLoopCharacteristics isSequential=“true” flowable:collection=“batchesToProcess” flowable:elementVariable=“batchToProcess”>

<extensionElements >

<flowable:variableAggregation target=“servicesToCreateAgg”>

<variable source=“servicesToCreate” ></variable>

</flowable:variableAggregation >

</extensionElements >

</multiInstanceLoopCharacteristics >

</callActivity >

I have identified why this feature doesn’t work in my scenario. It turns out that multi instance variable aggregation doesn’t work for multi instance call activities. All variables should be set in the same execution in order to enable this feature which I think it’s not good solution.
Could we expect this feature to work with multi instance call activities?

Not entirely sure but I’ve had this working with call activities in a parallel setting instead of sequential. I see no reason why this wouldn’t work for sequential.
Why do you have completeAsync on true?

Hey @theghost5800 ,

This is incorrect. As @CElbersen said it works properly for call activities.

The reason why it doesn’t work for you, is due to the fact that you have not defined any out parameters for your call activity. This means that when the called process is done, none of its variables are passed to the existing process instance and thus you get empty objects.