How to deal with Terminate Events when subprocesses are involved

1,418 views
Skip to first unread message

Alfonso Mateos Alarcón

unread,
Nov 11, 2013, 10:56:50 AM11/11/13
to camunda-...@googlegroups.com
Good Afternoon,

I'm trying to be able to terminate my process from several places inside the process, but when I try it from inside a subprocess I just get that subprocess cancelled, but the rest of activities remain active. My process is this:

My first approach was to use the Terminate Event like in the upper subprocess, without success. Then I tried to go the "cancel event with boundary" way, but then it requires a transaction, and I think it's an overhead that I don't need from the functional point of view.

The first terminate event reached from the process flow works as expected, and it terminates the whole process.

Can somebody help me to figure out how to do it and be able to terminate the process from the 4 desired places inside the process?

Thanks in advance!

Robert Gimbel

unread,
Nov 12, 2013, 10:57:21 AM11/12/13
to camunda-...@googlegroups.com
Hi Alfonso,

That is an interesting question.

I would propose to use throwing error events in combination with an interrupting error event subprocess. Like this, you can throw the same error anywhere in the diagram and catch it with the event subprocess, which will subsequently cancel everything that is ongoing in the instance.

Here is an example.

You could also catch the errors from within the subprocesses with an attached boundary event and subsequently throw them again. That could be considered better from an implementation perspective.

Does that answer your question?

Cheers
Robert

Alfonso Mateos Alarcón

unread,
Nov 15, 2013, 5:09:20 AM11/15/13
to camunda-...@googlegroups.com
Hi Robert,

Thanks a lot for your suggest, I tested it and it seems to solve my problem, but there are a couple of things I don't fully understand, may be you can help me to clarify them.

When I throw an error event from inside a subprocess, it seems to directly cancel the whole process, as I wanted, but I cannot get the event subprocess triggered, I know that because when I use the process in Camunda Task List the process does not stop at the user task I put inside my event subprocess.

My questions are:
- Why does that subprocess doesn't get triggered? What am I missing? The start event inside is configured to listen to the same error code.
- Why does the inner error inside the subprocess cancel the whole process? Shouldn't it cancel the scope where it was triggered? (the subprocess)

Thanks in advance, your way seems the way to go ;-)

Alfonso Mateos Alarcón

unread,
Nov 15, 2013, 7:33:05 AM11/15/13
to camunda-...@googlegroups.com
Hi again, Robert, I answer myself the first question:

- My Event Subprocess got triggered, but I forgot to set the "assignee" property to "demo" so that I could claim the task from Camunda Task list ;-D
- The question about the Subprocess, could it be caused because automatic scalation of the error from the subprocess to the main process?

Thanks again!
Reply all
Reply to author
Forward
0 new messages