Error boundary events vs. exclusive gateways


I have a somewhat philosophical question.

With an exclusive gateway (XOR) we can let the process take one of N possible paths. But the same can be achieved with error boundary events: An activity can throw BpmnError instances with appropriate error codes. Then we can attach N error boundary events to the activity and create the process paths accordingly. Of course this only remains readable for small N (max. 2, I’d say).

What are the pros and cons in using XOR gateways vs. boundary events for branching logic in the process?

Thank you for any thoughts!

Hi @fml2,

the error boundary event shows the reader that the service task was interrupted with an error. With the XOR Gateway the task was completed.

Technically it may be the same, but you should model the process to be understandable by your readers.

Hope this helps, Ingo

1 Like

OK, so it just depends on the definition / our understanding of what is an error and what is a situation that may well occur in the process. The line between the two is not very clear to me, but now I know where to look further. Thank you for your reply!

Hi @fml2,

As BPMN is ambigous with a lot of the symbols, the naming of the tasks is the best hint how to model it.

Have a look at this example:

But in the end you are right, it’s a thin line.