How to Terminate Parent Process from Subprocess

Our workflow model consists of master model and subprocesses in the form of Call Activity. One use case is to be able to terminate entire process, i.e. master workflow, from within a subproess.

Attached is the mocked models.

However, it didn’t work. As the user task in subprocess is completed, it went on to the user task in the master model, which is totally unexpected.

I have searched through the internet, it doesn’t seem the same question has already been posted. I guess we could’ve had some hacking to make it work, but we are looking for a clean out-of-box solution.

Thank you for your help.

Master model:

Subprocess Model:
image

1 Like

Hi - So I’m a bit confused as to how you want this to work based on your description but I’ll take a shot at providing a solution.

I think what you want is an “Error Boundary Event” on the call activity.
Master model:
image

This way, the subprocess can either complete successfully and your master process can continue, or it can throw an error and end the master workflow.

Subprocess model:
image

You are correct in that, as is currently implemented, a “terminate end event” is functionally no different than a normal “end event” so that is why when the subprocess completes, the master process continues to the next step.

3 Likes

Hi @jchen5580,

it is not, because the termination only applies to the current scope and the subscopes: https://docs.camunda.org/manual/7.12/reference/bpmn20/events/terminate-event/

This is how the termination end event is defined in the BPMN 2.0 specification.

@jwarren s solution is the best to handle your case. Logically you can go without terminate end event in the super process as there is only a single token in the process instance. A non end event is enough.

Hope this helps, Ingo

1 Like

@jwarren/@Ingo_Richtsmeier, thank you so much for your prompt reply. Now I believe I have a better understanding the difference between the end and terminate event - there isn’t much difference in terms of scope of termination.

Here is the model that better reflects my real use use:
image

Based on I learned from @jwarren, here seems to be the solution. By the way, I am using Escalation End and Escalation Boundary event.
image

Can you please confirm?

Thank you
Jason

1 Like

Hi @jchen5580 - yes I think your updated implementation looks correct to me. You are using an escalation throw event in the subprocess, which seems to trigger when a message is received, that will then interrupt the parent process and end it. This sounds like it solves your use case and is the proper use of an escalation event.