Skip to content

Commit

Permalink
style(formatting): standard review
Browse files Browse the repository at this point in the history
  • Loading branch information
christinaausley committed Mar 27, 2024
1 parent faf86aa commit 0d0951e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
---
id: compensation-events
title: "Compensation events"
description: "Compensation events are used to undo tasks already executed"
description: "Compensation events are used to undo tasks that have already been executed."
---

Compensation events are 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.
Compensation events assist with undoing steps that were already successfully completed in the case that their results are no longer desired and need to be reversed.

![Process with compensation throw event](assets/compensation-throw-event.gif)

The example above shows the execution of compensation event:
The example above shows the execution of a compensation event:

- After the service task `A` is completed, the process reaches the compensation intermediate throw event
- This invokes the compensation handler `undo A` attached to the compensation boundary event
- Once the compensation handler `undo A` is completed, the process completes the compensation intermediate throw event and takes the outgoing sequence flow
1. After the service task `A` is completed, the process reaches the compensation intermediate throw event.
2. This invokes the compensation handler `undo A` attached to the compensation boundary event.
3. Once the compensation handler `undo A` is completed, the process completes the compensation intermediate throw event and takes the outgoing sequence flow.

:::info
**Compensation activity:** is an activity with compensation boundary event attached, it can be compensated only if completed first.
**Compensation handler:** is an activity with compensation marker, it is the activity in charge of reverting the effects of the compensation activity attached to. For more info, look at the [compensation handler](../compensation-handler/compensation-handler.md) section
**Compensation activity:** An activity with a compensation boundary event attached. This can be compensated only if completed first.
**Compensation handler:** An activity with a compensation marker, and the activity in charge of reverting the effects of the compensation activity attached. For more information, visit the [compensation handler documentation](../compensation-handler/compensation-handler.md).
:::

## Triggering compensation

By default, a compensation intermediate throw or end event triggers the compensation within its scope. If the compensation throw event is on the process level then it invokes all at once all the compensation handlers of the process, without any specific order. The compensation throw event remain active until all the compensation handlers are completed.
By default, a compensation intermediate throw or end event triggers the compensation within its scope. If the compensation throw event is on the process level, it invokes all at once all the compensation handlers of the process without any specific order. The compensation throw event remains active until all the compensation handlers are completed.

Compensation handlers are triggered for [subprocesses](#embedded-subprocess) but not for child processes.

Expand All @@ -34,7 +33,7 @@ Besides the broadcasting of the compensation event, a compensation throw event c

On a compensation intermediate throw or end event, it is possible to specify the activity to compensate by using the property `activityRef`. The referenced activity must have a compensation boundary event and must be in the same scope of the compensation throw event.

### Multi instance activity
### Multi-instance activity

If an activity is a multi-instance activity or multi-instance subprocess, the compensation handler is invoked once. The compensation handler is responsible for compensating the effect of all instances of the multi-instance activity.

Expand All @@ -44,7 +43,7 @@ The compensation handler is invoked if all instances of the multi-instance activ

## Triggering compensation from an event subprocess

An interrupting or non-interrupting event subprocess can contain compensation intermediate throw events or a compensation end event. These compensation events can specify an activity or broadcast the compensation in the parent scope of the event subprocess. If the compensation throw event specifies an activity and the activity is completed then it invoke only the compensation handler of this activity.
An interrupting or non-interrupting event subprocess can contain compensation intermediate throw events or a compensation end event. These compensation events can specify an activity or broadcast the compensation in the parent scope of the event subprocess. If the compensation throw event specifies an activity and the activity is completed, it invokes only the compensation handler of this activity.

![Trigger compensation from an event subprocess](assets/compensation-event-subprocess.png)

Expand All @@ -66,7 +65,7 @@ If the subprocess is interrupted, all the compensation handlers within the subpr

### XML representation

A intermediate compensation throw event with referenced activity:
An intermediate compensation throw event with referenced activity:

```xml
<intermediateThrowEvent id="CompensationThrowEvent">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: compensation-handler
title: "Compensation handler"
description: "A compensation handler is an activity used to undo already executed tasks"
description: "A compensation handler is an activity used to undo tasks that have already been executed."
---

The following activities can be marked as compensation:
Expand All @@ -23,7 +23,7 @@ Compensation handlers are activities or subprocesses attached to other activitie

If the compensation handler has input variable mappings, those are applied before completing the compensation handler. At the same way, if the compensation handler has output variable mappings, those are applied after invoking the compensation handler.

Compensation handlers might be interrupted if the process or subprocess is terminated, interrupted compensation handlers aren't reactivatable.
Compensation handlers might be interrupted if the process or subprocess is terminated, interrupted compensation handlers can't be re-activated.

### Embedded subprocess as compensation handler

Expand All @@ -37,7 +37,7 @@ The subprocess contains the steps to undo the actions of the compensation activi

The call activity contains the steps to undo the actions of the compensation activity. Using a call activity can be useful in combination with a call activity as the compensation activity since compensation isn't propagated to the child process.

### Multi instance activity as compensation handler
### Multi-instance activity as compensation handler

![Process with multi instance activity as compensation handler](assets/multi-instance-compensation-handler.png)

Expand Down

0 comments on commit 0d0951e

Please sign in to comment.