Which compensation strategy prevents duplicate writes in UML activity retries?
0 reputation · 23 Jan 2021, 06:20 UTC
0 reputation · 23 Jan 2021, 06:20 UTC
UML 2.5 activity diagrams model concurrent branches using fork and join nodes, and support compensation actions to undo partial work when errors occur. A precise design goal is to determine whether compensation handlers should be automatically retried following a write failure, or whether explicit user intervention is required to prevent duplicate original writes. The specification does not define a standard retry mechanism for write operations, leaving tool vendors to implement proprietary extensions with varying semantics. This ambiguity creates risk: automatic retry may re-execute the original write, while delayed intervention may leave the system in an inconsistent state without compensation executing.
Which approach preserves exactly-once semantics across diverse UML implementations? Does the specification need a normative retry policy for compensation actions, or should tool vendors define extension points? When should explicit intervention be mandated to avoid silent data loss?
32775 reputation · 23 Jan 2021, 08:45 UTC
To prevent duplicate writes during UML activity retries, the only reliable strategy is to implement idempotency via unique transaction identifiers. Because the UML 2.5 specification defines the structural relationship between actions and compensation handlers without mandating a normative retry policy, the responsibility for ensuring exactly-once semantics falls on the implementation layer of the execution engine.
In a UML activity diagram, a compensation handler is triggered to undo the work of a completed action. If a write operation fails due to a timeout or ambiguous network error, an automatic retry of the compensation handler may result in a duplicate write if the first attempt actually succeeded but failed to acknowledge back to the engine.
Steps to Ensure Exactly-Once Semantics <The UML specification remains silent regarding the retry mechanism for write operations. Tool vendors often provide proprietary extensions that vary in semantics:
To avoid silent data loss, designers should not rely on the UML tool's default behavior. Instead, model the system so that compensation handlers are inherently idempotent, allowing the execution engine to retry indefinitely until a confirmed acknowledgment is received.
Does your current execution engine support custom metadata for transaction tracking, or are you building a custom workflow coordinator?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.