We have a recursive BPMN process. That is, one path through the flow can result in a Call activity to another instance of the process (at arbitrary depth). One of the first steps in the process is to send an email.
While the subprocess is executing, the parent process needs to be able to cancel that subprocess (basically take back control). If that happens, the subprocess needs to send a “this was canceled” email. That feels like compensation.
Our initial model placed an interrupting Message Boundary event on the Call activity. The problem is that when the boundary event message is received, the subprocess is immediately stopped.
We expect there is a good pattern for modeling such use cases, but haven’t been able to find one that seems elegant and natural, through searches on this forum, studying the BPMN docs, or the Real-Live BPMN book.
I’ve included example BPMN models, omitting recursion for clarity.
Just to clarify - You’ve got a Call Activity which calls a process - if some event happens while the process being called is still running - you want to a specific task in the sub process if it has been executed.
I’m wondering does this compensation ever need to happen after the sub process has been completed?