See Correct compensation event usage - #2 by Niall
The documentation suggests attaching a compensation handler to the Call Activity itself and invoking a separate “undo” process. However, that undo process has no built-in knowledge of which activities in the called process actually completed.
Parent Process
└─ Call Activity (Fulfillment)
Fulfillment Process
├─ Reserve Stock
│ ↳ Release Stock (compensation)
├─ Charge Card
│ ↳ Refund Card (compensation)
└─ Ship Goods
↳ Cancel Shipment (compensation)
If only Reserve Stock and Charge Card completed before cancellation, the child process’ compensation model contains the necessary state to compensate only those activities.
If compensation is instead delegated to a separate “Undo Fulfillment” process attached to the Call Activity, how is that process expected to determine which activities completed in the original called process? Does Camunda expose compensation state from the called process, or is the recommended approach to explicitly maintain state/flags and implement a custom saga-style undo process?