Multi instance parallel call activity - super execution

What exactly is super execution?

I started a multi instance parallel subprocess with a list of orders. Element variable is order. Subprocess is a call activity.

Inside the subprocess, I am getting individual orders by
Order order = (Order) runtimeService.getVariable(execution.getSuperExecution().getId(), “order”);

Also I can get the orders list by
List orders = (ArrayList) runtimeService.getVariable(execution.getSuperExecution().getId(), “orders”);

Why I should use execution.getSuperExecution().getId() instead of execution.getId() to get individual orders.

What exactly is this super execution?

Hi @anigeorge,

getSuperExecution() method returns the execution which
executed the call activity in the super process instance.

See below link
https://docs.camunda.org/javadoc/camunda-bpm-platform/7.6/org/camunda/bpm/engine/delegate/DelegateExecution.html#getSuperExecution()

Notice: When process execution arrives at the call activity, a new process instance is created, which is used to execute the subprocess and orders collection is defined in the scope of the call activity’s execution which can be retrieved through the call of getSuperExecution() method in this case

2 Likes

So if there are 3 orders, there will be 3 super executions created?

No the super execution is only one.
The one which executed the call activity.
But there will be 3 new executions. One for each subprocess.

If I run execution.getSuperExecution().getId() inside the subprocess and if there are 3 orders, then I will get 3 different IDs. If there is only only super execution, then why there are 3 different super execution IDs?

May we see your model please?

Does call activity inside a multi instance subprocess? Or it calls a multi instance subprocess?

It seems your call activity is inside a multi instance subprocess, Right?

If, yes. Then you are right… You will have 3 super executions.

Yes subprocess is a multi instance call activity.

Ok, so now there are 3 super executions. execution.getSuperExecution().getId() will give super execution id and execution.getId() will give execution id. What is the difference between these super execution id and execution id. If there are 3 super executions created, then super execution id is enough to identify each subprocess instance right? Why there is one more execution id which is completely different from super execution id?

May we know where your code is located, please?
It seems your code is located inside the called subprocess.
Where each called subprocess creates a new execution too.

See below link
https://docs.camunda.org/manual/7.6/user-guide/process-engine/process-engine-concepts/#executions

By the way did you pass any variables to the called subprocess when you used call activity?