What about super global process variable?

Hello everybody!
I confused with bpmn modeling. Please, advice me how to implement my task.

I have got a process with call activity which starts subprocess.

Here will be created three instance of “Subprocess”, but I need to execute “Execute only once” activity only once for all instances. I mean, if one instance has executed “Execute only once” activity then rest must skip it. How to implement it? I tried with process variable but it doesn’t work because the scope of variable is restricted by process instance. It could be create if I could defind global variable at parent process and then update and read it from child (subprocesses).

Are each of your call activities calling the same sub-process? If yes, what is the use case?

When you want to only execute the “Execute Only Once” activity, what is the condition to make this happen? Is it the first subprocess?

Can you provide some more detail about your general use case?

Yes, the sub-process is the same. The use case: the sub-process is a department (three for example) which does some work, 3 departments do some work to perform some product. When all departments finish thier work (done thier part) then we need to send an email to client about his product is ready. We have to send an email only once when all parts (all departments have finished thier work) of the product is ready not each time when a part is ready.

You need Multi-Instance Sub-Process or Multi-Instance Tasks:

Check out: Idiomatic solution for the 1-n problem - #3 by StephenOTT

Another variation: Splitting batch with sequential multiple instance - #4 by StephenOTT

Another variation: Pattern Review: DMN Looping for Array Input

Good Reference if you are working with JSON data: How to return a collection to be used in a multi instance sub process from an external task service? - #8 by StephenOTT

1 Like