cancel
Showing results for 
Search instead for 
Did you mean: 

Error boundary event does not cancel the subprocess

3on
Champ in-the-making
Champ in-the-making
Hi,

first thank you for all your dilligent work on the Activiti engine.

I'd like to discuss an issue when trying to interrupt a subprocess when an error event occurs.

We have designed a main subprocess with 2 parallel branches between two parallel gateways. There is a call activity in each branch calling a subprocess (let's call them Subprocess A and Subprocess B) which may end in an error end state with the same error code. On the boundary of the subprocess with 2 branches there is an error boundary event catching the error event and connected to further activities. See attached diagram.

When either Subprocess A or Subprocess B end in the error state, the error is caught on the boundary event and the corresponding parallel branch is interrupted. Unfortunately the other parallel branch continues its execution until the parallel join where it stops and the process remains active although the end state in the error flow was reached.

When we attach another error boundary event directly to one of the call activities and connect it to an error end state, the error boundary event is never reached and again one branch is interrupted and the other one continues until the parallel join.

How can we design the process in the way that an error stops the execution of the whole subprocess and not only one branch in it?

Thanks and best regards,
Michal
5 REPLIES 5

frederikherema1
Star Contributor
Star Contributor
If you want both parallel flows ended, wrap those flows in a subprocess and add the boundary-event to that instead. If it has cancelActivity=true, all active paths in the subprocess will be destroyed…

3on
Champ in-the-making
Champ in-the-making
Hi Frederik,

this is exactly what I did - both parallel flows are in a subprocess with error boundary event, which should cancel the subprocess by default (there is no setting for cancelActivity). However when an error is thrown in one of the parallel flows, only that particular branch is cancelled, while the other one continues. Is it a bug?

Thanks,
Michal

frederikherema1
Star Contributor
Star Contributor
Michal,

In case cancelActivity is not defined in the XML, it reverts to 'true' so the subprocess should be ended.
Can you create a unit-test (see sticky in the forum) demonstrating this issue (with a simpler process, maybe)? That would be great for us to quickly see what's going on…

3on
Champ in-the-making
Champ in-the-making
I've created the simplest test case and attached it to the Jira issue ACT-1764.
Thanks for your help, Frederik.

trademak
Star Contributor
Star Contributor
Thanks for creating the test case. The bug is that the error end event is not propagated to the parent process. We'll look into the issue.