Description
Implement saga/compensation pattern to support rollback when actions fail mid-workflow.
Acceptance Criteria
Given 3 actions where action 2 fails
And each action can be compensated/rolled back
When action 2 throws an exception
Then action 1's rollback should execute
And the state should be restored
Technical Notes
- This requires a compensation/saga pattern
- Actions would need to implement a
Compensable interface with a compensate() method
- StateWorker would need to track executed actions and run compensations in reverse order on failure
Related
- Original scenario: 13.3 from acceptance-tests.md
- Priority: Low (advanced feature)
Description
Implement saga/compensation pattern to support rollback when actions fail mid-workflow.
Acceptance Criteria
Given 3 actions where action 2 fails
And each action can be compensated/rolled back
When action 2 throws an exception
Then action 1's rollback should execute
And the state should be restored
Technical Notes
Compensableinterface with acompensate()methodRelated