Complete Process In Subflow

I want to know if there is a way to complete the whole process when the subflow process completed.

When I say subflow, actually I mean a “Call Activity”.

Lets think that I have a root bpmn file in which has a Call Activity reference to another bpmn model. And this second bpmn has a Call Activity reference to a third bpmn model. This might get deeper depending on the use case.

At some point in these sub flows, I may decide to terminate the whole process.

How should I model it, or is this possible ?

In the model given below, Sub Flow Call 1 does what I want. However, if the flows runs into Sub flow Call 2, it always return to root process no matter it completes with an End event or not.

Hey @guvenc
You can throw an BPMN error inside the process you are calling and catch that BPMN error as an attached boundary event on the outside of your call activity and end the process.
Cheers
Nele

2 Likes

Thanks @Nele

I later found this thread in the forums which is exactly the same topic.

https://forum.camunda.io/t/how-to-terminate-parent-process-from-subprocess/19955/2

I didn’t give much credit at the beginning, but when I saw your comment suggesting the same solution, I decided to give it a try.

The reason I hesitated was, I was thinking that I had to attach a boundary event on each and every one of call activities in the subflows. That would be messy and not a good solution.

But the things did not go that way. I just added a boundary event on call activity inside my root model. I did not attach any boundary events in the subflow which stands in the middle. And it worked.

Diagram1 (root model)
image

Subflow1 (model in the middle which has no attached boundary event)
image

Subflow2 (model at the bottom which fires the escalation event
image

When this runs, Subflow2 ends with an escalation event, Diagram1 catches the event and terminates everything. Subflow1 never goes to the end.

Exactly what I wanted.

Sample models may not make sense, but they are just samples to prove the concept.

Thanks for the help.
Guvenc

1 Like