waitForCompletion - Compensation event

Hi,

I have the following scenario where the compensation task has to executed after error thrown. In my case there are not getting executed as it is in a transaction subprocess which is not COMPLETE yet. Any help?

I understood in the docs that (waitForCompletion=false) this is not yet supported. Is there any other alternative where I can achieve this? Or any updates when it will be supported in Camunda BPMN?

Thanks :slight_smile:

There is no need to use a transaction sub process. in fact it doesn’t work if you do - because unless the sub process is successfully completed completely then it will not run any compensations in it. So instead you need to use an event sub process:

https://cawemo.com/share/a75ce393-7156-4486-a81d-f9b6410948ca

1 Like

Hi Niall,

Thanks alot for the quick response. Yes I did the same thing (created a error start event). But I have an end listener at the of transaction sub process which adds some mandatory attributes to the execution variables. Those variables are supposed to be added at the end of transaction only. Is there any way?

Thanks,
Hetal

Is there any upcoming release which supports waitForCompletion=false?

Hi Niall, any updates on this?

Can you explain the functionality you would expect from this?

yea. so if I use waitForCompletion=False I would be able to execute compensation events (in case of failure) with the listeners which has to be executed at end of the process (in case of success).

Sorry, I don’t fully understand what the functionality you need is. could you explain it a little more detail, perhaps with a model as reference.

Ohh okay, here is a demo process which has a listener at the end of transaction process.Bootstrap Device.bpmn (33.1 KB)

Instead of putting the listener at the end of the sub process - if you want to have a listener run when the process ends - no matter if the sub process finishes or not, then you should attach the listener to the process level, not the sub process level.

1 Like

Yeah, It worked. :slight_smile: Thanks a lot Niall.