maestro
latest
false
- 简介
- 入门指南
- 使用 BPMN 进行流程建模
- 使用 案例管理 进行流程建模
- Process modeling with Flow
- 入门指南
- 核心概念
- Node reference
- Build guides
- 最佳实践
- 参考
- 流程实施
- 流程运营
- 流程监控
- 流程优化
- 参考信息
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。
Maestro 用户指南
操作
Routes a process to one of multiple paths based on ordered conditions. Takes the first match.
When to use this vs Decision
| Use Switch when... | Use Decision when... |
|---|---|
| You have three or more outcomes | You have exactly two outcomes |
| You're routing by multiple distinct conditions | The condition is a simple yes/no |
| You need a default/fallback branch |
Configuration reference
| 字段 | 必填 | 默认 | 描述 |
|---|---|---|---|
| case 子句 | 是 | 2 empty cases | Ordered branch list. Each case has a handle label and a JavaScript expression; the first truthy expression is taken. |
| Include default | 否 | true | Whether to add a Default branch that is taken when no case expression matches. |
Writing case expressions
Each case expression uses the same JavaScript environment as the Script and Decision nodes:
// Case 1 — high priority
$vars.ticket1.output.priority === "high"
// Case 2 — medium priority
$vars.ticket1.output.priority === "medium"
// Case 3 — low priority (or use Default to catch everything else)
$vars.ticket1.output.priority === "low"
// Case 1 — high priority
$vars.ticket1.output.priority === "high"
// Case 2 — medium priority
$vars.ticket1.output.priority === "medium"
// Case 3 — low priority (or use Default to catch everything else)
$vars.ticket1.output.priority === "low"
More specific conditions should appear first. A broader condition higher in the list will match before a more specific one below it.
示例
Example 1 — Route by HTTP status code
| Case 分支 | 表达式 | 分支 |
|---|---|---|
| 成功 | $vars.httpRequest1.output.statusCode === 200 | → process response |
| Not Found | $vars.httpRequest1.output.statusCode === 404 | → handle missing resource |
| 默认 | (fallback) | → handle unexpected error |
Example 2 — Route by string value
| Case 分支 | 表达式 | 分支 |
|---|---|---|
| 已批准 | $vars.form1.output.status === "approved" | → continue process |
| 已拒绝 | $vars.form1.output.status === "rejected" | → notify rejection |
| 待处理 | $vars.form1.output.status === "pending" | → wait for review |
| 默认 | (fallback) | → handle unknown status |
相关页面
- Decision node — for exactly two branches
- Variables and data flow —
$varssyntax and expression patterns - Error handling — handling failures vs conditional branching