知识卡片
补偿撤销业务效果
Saga将长业务事务拆成已提交步骤,失败时执行对应撤销操作,而非依赖数据库回滚。已寄出的SIM卡无法物理收回,可停用并通知客户;这说明补偿只是业务上可接受的逆操作。BPMN补偿事件可关联步骤与撤销步骤,引擎记录哪些操作需要清理。其复杂性来自现实中的非原子业务边界。
结构图:
flowchart TD
创建CRM客户 --> 创建计费客户
创建计费客户 -->|失败| 补偿已完成步骤
补偿已完成步骤 --> 停用CRM客户
停用CRM客户 --> 恢复业务一致状态
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 工作流引擎与集成挑战 · 查看原书依据
The Saga pattern describes long-running transactions in distributed systems. The main idea is simple: when you can’t roll back tasks, you undo them. The name Saga refers back to a paper written in the 1980s about long-lived transactions in databases. BPMN supports this through compensation events, which can link tasks with their undo tasks. Figure
参考来源
- 位置:《Practical Process Automation》第9章《工作流引擎与集成挑战》(来源项目:book-sources;源文件:extracted/Practical Process Automation (Bernd Ruecker)/_epub-src/OEBPS/ch09.xhtml)
- 结论依据:原文给出的机制、实例与边界支持本卡的解释。
- 原始内容:The Saga pattern describes long-running transactions in distributed systems. The main idea is simple: when you can’t roll back tasks, you undo them. The name Saga refers back to a paper written in the 1980s about long-lived transactions in databases. BPMN supports this through compensation events, which can link tasks with their undo tasks. Figure