Can the local variables of one sequential multi-instance delegate clash with another multi-instance delegate within the same Camunda process

Hi,
I have a loans BPMN as shown.
loans.bpmn (5.7 KB)

This Camunda process is triggered from another process, but that is probably not relevant to this question.

In the Camunda process attached, we can see that there are 2 sequential multi-instance delegates. One delegate gets the collection from the Camunda variable “houseLoansList” and another delegate gets the collection from Camunda variable “personalLoansList”. But both delegates refer to the local variable name as “loan”.

Will this cause any functional issue? Or is it safe to assume that the “loan” variable is local to the respective multi-instance delegate, so the ‘loan’ local variable for delegate1 will not have any issues/clash with ‘loan’ local variable of the 2nd delegate even though both these delegates are within the same Camunda process.

Thanks.

Hi @firstpostcommenter

The element variable creates a local scoped variable for each instance of the multi-instance activity so the created local variables are completely isolated from each other.

So the element is isolated within the multiple multi instance of a delegate and also from other multi instance delegates using same name for element

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.