Why does compensation after Transaction boundary events not work?

Hi there :slight_smile:

I noticed that it is not possible to compensate transactions after having left them via an interrupting boundary event.
The compensation task does not come up if the message arrives while waiting for the second user task to be completed.
I thought it would, because the transaction is interrupted and as far as I got it, active transactions can not be compensated.

With an adapted flow, where the transaction is left after all tasks are completed, the message receive event is placed not at the boundary but on the outgoing flow of the transaction, it works.

I am wondering why the way of leaving the transaction has an influence on if it can be compensated?
Is this intended?

For me, it is an obstacle at the moment.
But maybe there is a reason that I am overlooking?

Best

Hi @eddy,

This is expected as far as I understand the BPMN specification. A transaction subprocess is a special kind of subprocess. A subprocess can only be compensated after it has been successfully completed. An interrupting boundary event does not complete the subprocess, but interrupts it. Transaction cancellation has extra semantics of compensation defined. It can be only triggered via cancellation end events and can be caught with a cancel boundary event.

Now in order to get what you want, you could catch the message in an event subprocess inside the transaction and from there trigger the cancellation that you then again catch on the transaction’s boundary.

Cheers,
Thorben