3

I am trying to model the deployment process for some software using BPMN. Various parts of the deployment could go wrong, and I want to indicate in the diagram what steps should be taken in each case.

At first, it seemed like I should use "compensation" events for this, but I ended up using "error" events. I have been unable to find a clear distinction between these two, but the best I have come up with is that "error" indicates what should happen immediately if the task generates an error, whereas "compensation" indicates what needs to happen if, sometime later, the process needs to be reversed.

The examples of compensation I have seen are things like a travel agent taking a hotel booking: the task to cancel the booking would then be a compensation event on the booking task. I haven't been able to find many appropriate examples of "error": am I correct to use "error" in my case?

Allan Lewis
  • 329
  • 2
  • 13

2 Answers2

5

Adding to the below answer ...

As of BPMN specification Page 302 " Compensation is concerned with undoing steps that were already successfully completed, because their results and possibly side effects are no longer desired and need to be reversed."

Error own its literary meaning and Page 235 "Error triggers are critical and suspend execution at the location of throwing.

arunvg
  • 1,009
  • 15
  • 28
4

Best I can figure, but it may not be true.

Compensation allows you to fix something so the process can still complete. A cancel is when an activity is abandoned. An error is when a process fails and an activity is triggered that does not fix the process.

Travel agent example: If the travel agent process simply cancelled, then a live booking may still exist (because it hadn't been undone), so a compensation activity is required. If the travel agent failed to book a room properly, an error process step would be required to provide notification to the travel agent, but no compensation is immediately activated by the system.
It would be up to the travel agent to handle a compensation activity.

Pizza order example: If a pizza order over the phone or internet was abandoned (cancel), no compensating activity would be required. If the payment system went down (error), the user would need to be notified, no compensation would automatically result. Compensation would allow for alternate arrangements to be made, like other cards or COD or a tab.

So if a process fails to complete on the standard path, an error or compensation might be required. If this alternate path is invoked, but further work (compensating activities) is not required, then an error will do. Cancellations don't tend to require alternate paths.

Adam Smith
  • 41
  • 3