Dependency from multi instance call activity to main process

i have 3 levels of processes and they are multi instance.
process-> (n) subprocess1 -> (m) subprocess2.
n and m are number of instances captured at process and subprocess1 respectively.

starter.bpmn (12.3 KB)

how can i create dependency between all the T1.1.1 to T2.
i wouldnt know how many instances its going to be.
PS: I am using call activity, not Subprocess. i used subprocess in the bpmn just to explain my problem


BPMN diagram

Hi @Nishant_Agrawal,

you can model it this way, but you should use conditional events instead of signal receive events and service- or script tasks instead of signal throw events.

Throwing a signal is a broadcast that triggers all waiting process instances. (https://docs.camunda.org/manual/7.12/reference/bpmn20/events/signal-events/)

Hope this helps, Ingo

1 Like

Thank you very much for pointing out to conditional events.
Is there any way i can collect the process variables of each subprocess (multi instance) and somehow show it in the main process task.
My thoughts-
What if i create a map variable and keep appending from each subprocess. But not sure how would i display that in the form. Because i dont know how many instances are going to come. And how can i use map/list to show values in the form.

Hi @Nishant_Agrawal,

I understand your use case, that both branches should only continue after all user tasks T1 and T1.1.1 are completed.

For this it would be sufficient to compare a process variable against a counter (conditional event) and increase the process variable each time a user completes its task.

Hope this helps, Ingo

1 Like

i tried using conditional event and increment the count from the subprocess. but the conditional event is not resolving even if the condition is fulfilled.
is there anything i am missing

i had tried by putting variable name as cktCount an dvariable event as ‘Update’ as well (in the conditional event). but it didnt work either.
can you suggest what can be corrected?

PS:
cktCount i am incrementing everytime a task is completed in subprocess.
totalCount i am setting from one of the subprocess variable.
while the conditional event is active both variable will change but the totalCount will always be more than cktCount and at some point cktCount will be equal to totalCount, at that point i want the execution to move forward.

CircuitDetails.bpmn (3.4 KB) PrimaryProcess.bpmn (7.3 KB) SiteDetails.bpmn (4.0 KB)

attaching bpmn, just in case you want to check

i manged to solve this. the problem was i was setting the variable using superExecution method, whereas it seems the trigger works when we update the variable using runtimeservice.

Hi @Nishant_Agrawal,

glad that you the issue yourself. Thanks for updating the post.

Cheers, Ingo

1 Like