Assistance with multi-instances

Greetings all,

I’m new to Camunda and require some assistance with parallel multi-instances.

I’m using the following versions

Powered by Spring Boot (v3.5.3)
Java Version: (17.0.11)
Camunda BPM: (v7.23.0)

My problem is this:
In my code I build a list of 2 different position objects and set a variable with a list. In the the expanded sub process I have set collection to the same variable. I have also set the element variable. This works and hits the user task which points to a form also attached. The issue is that if two tasks are created for the different positions when I select wither of the tasks the both have the same data. The data appears to be from the last task created. I also attached screenshots of what I see for each task.

I have attached both the bpmn and form files below.

pk_recon_process.bpmn (6.3 KB)

pk_positon_approval_form.form (1.7 KB)


Just for curiosity’s sake, have you tried to qualify the keys?

Hi Claudio,

Please can you clarify what you mean by ‘qualify the keys’?

As indicated in the screenshot, include the name of the element variable as prefix.

Hi Claudio,

I have implemented what you recommended above.

However, I now get this error

Is this the only field creating trouble?

The problem is more to do with the form populating with the same data for both instances of sub task.

Below are the two Position objects that make up the list passed into the sub process.

The below is the output of the individual positions passed into the sub process

Variable pkPosition = PKPosition [getAccount()=0042838, getInstrument()=ABG, getQuantity()=300015, getDifference()=15, getMessage()=Opening position: 300015, approval position: 300000, Difference: 15, getTimestamp()=2025/08/07 09:40:25]

Variable pkPosition = PKPosition [getAccount()=0042838, getInstrument()=PIK, getQuantity()=2472900, getDifference()=2472900, getMessage()=No approval found for equivalent opening position: , getTimestamp()=2025/08/07 09:40:25]

I have now removed the form for the benefit of understanding the problem. You will see below that both taks created from the 2 positions are showing as the same. In this case the are both showing the position for instrument ‘PIK’. I would expect 1 tasks to be for instrument ‘PIK’ and the other for the position of ‘ABG’


I don’t think the tasks should reference the array mismatches. This array is used by the engine to trigger each instance of the multi-instance subprocess.
Inside the subprocess you should have access the the variable pkPosition that points to each element of the array.

Data for the form should come from this variable.

I put together an example that looks like yours (Camunda 8).

The array is populated at the Start event:

Each instance of the Subprocess receives a variable emp.

And the form uses this variable to reference its fields:

When I run the process, 2 task are created:

And each task points to each element of the array:

1 Like

Thanks for the above Claudio. I appreciate the help. I’m going to try this with my project.

1 Like

That worked. Thank you Claudio

1 Like

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