- 简介
- 入门指南
- 可在任何画布上构建
- 使用案例构建
- 使用流构建
- Build with BPMN
- 运营
- 监控
- 正在优化
- 参考信息
配置错误处理
Configure error mappings on BPMN nodes to define how Maestro Orchestrate catches, evaluates conditions for, and routes runtime errors during process execution.
Each node in your BPMN process can have one or more error mappings that define how Maestro Orchestrate handles errors thrown at runtime. Use the Error mapping property in the properties panel to specify which errors a node catches, under what conditions, and how to route them.
错误和错误映射
Maestro Orchestrate distinguishes between two related concepts:
- 错误是在流程级别定义的。它们代表流程中任何节点都可以引用的命名错误类型。
- 错误映射是在元素级别定义的。每个节点都有自己的映射列表,这些映射列表可链接到流程级错误,并定义该特定节点的捕获条件。
When a node throws an error at runtime, Maestro Orchestrate evaluates its error mappings in priority order and applies the first mapping whose condition evaluates to true.
添加错误映射
要将 Error 映射添加到节点,请使用属性面板中的 Error 映射部分,定义节点捕获的 Error,以及在运行时如何路由这些 Error。
- 选择画布上的节点。
- 在属性面板中,转到“错误映射”。
- 选择“添加映射”。
- 配置映射字段(请参阅下面的“错误映射属性”)。
结果
The error mapping is added to the node. Maestro Orchestrate evaluates it at runtime when the node throws an error, applying the first mapping whose condition evaluates to true.
错误映射属性
| 字段 | 描述 |
|---|---|
| 错误 | 此映射捕获的流程级错误。在下拉菜单中进行选择,或单击“菜单”按钮以打开错误创建对话框,然后在行内定义新错误。选择错误时,会将映射的 errorRef 设置为选定流程级错误的 ID。 |
| 条件 | 定义此映射何时适用。使用变量选取器构建表达式,若为复杂条件,请切换到 JavaScript 或 C# 编辑器。留空即可无条件捕获错误。 |
| 详细信息 | 映射的自由文本描述。用于记录您团队的映射意图。 |
按优先级对映射进行重新排序
Maestro Orchestrate evaluates error mappings in the order they appear. To change evaluation order, drag a mapping to a new position in the list. The mapping at the top is evaluated first.
错误传播
Once an error mapping matches, Maestro Orchestrate routes the error to the appropriate handler attached to the node:
- 边界事件:错误会传播到节点上附加的错误边界事件,流程遵循边界事件的输出路径。
- 事件子流程:在父流程中提出的错误会传播到使用错误开始事件的事件子流程,触发子流程中定义的集中错误处理。
有关使用边界事件和事件子流程的建模模式,请参阅“错误和恢复”。
创建流程级错误
流程级错误在流程中的所有节点之间共享。要新建错误:
- 在任何映射的 Error 字段中,选择菜单按钮。
- 在打开的对话框中,输入名称,并可选择性地输入错误代码。
- 选择“创建”。
结果
错误将添加到流程中,并在当前映射中处于选中状态。它现在可供任何节点的错误映射引用。
同一个错误可以由多个节点上的映射引用。