Sub process with a parallel gateway

I have a subprocess called by a Call Activity.

This process has a parallel gateway:

  • branch A has timeout and exists
  • branch B wait for message and exists

I need to return from the process when B ends. A still needs to be executed!
When A is executed and if B is finished, then we can terminate the process.

How to do that?

So the first thing you need to know is that the Call Activity will only be completed once there are no more live tokens in the process that has been called. So you can’t end the Call Activity without ending all tokens in it.

But what you can do is use events to trigger the parent to do stuff while the call activity is still running. Something like this might work: