BPMN element · Events

Cancel Event

Definition

A Cancel Event is used within a transaction subprocess to terminate and roll back all associated activities, ensuring consistency and integrity. This event acts as a safeguard against partial or inconsistent states by halting all operations within the transaction. It ensures that either all activities succeed or none do, providing a controlled mechanism for rolling back complex workflows.

Characteristics

  • Transaction-Specific: Cancel events are exclusive to transaction subprocesses, ensuring their actions are aligned with transactional logic.
  • Logical Unit of Work: They maintain the integrity of a transaction by guaranteeing that actions within the subprocess are either entirely completed or entirely reversed.
  • Rollback Assurance: Cancel events ensure all activities within the transaction are undone consistently when triggered.

Types of Cancel Events:

  • Boundary Cancel Event: Attached to a transaction subprocess, this event interrupts and terminates the process, triggering rollback procedures.
  • End Cancel Event: Concludes a transaction by ensuring a clean rollback and preventing lingering tasks from remaining active.

Example

Trigger warning - repost incoming!

At LeafBank, a customer kicks off a fund transfer between two accounts, simple on the surface, but under the hood, a lot is happening. The transaction subprocess carefully handles three key steps: debiting the source account, crediting the target account, and logging the transaction. During a short grace period, the customer can still change their mind, triggering a Cancel Event that rolls everything back and sends a confirmation that the transfer was stopped in time. But not all surprises are so polite: if a system failure strikes mid-process, an Error Event jumps in, halting the operation. The incident is logged, and a manual recovery process kicks off to sort things out, because even in the world of digital banking, you’ve got to be ready for the unexpected.