UiPath Documentation
maestro
latest
false
重要 :
新发布内容的本地化可能需要 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 outcomesYou have exactly two outcomes
You're routing by multiple distinct conditionsThe condition is a simple yes/no
You need a default/fallback branch

Configuration reference

字段必填默认描述
case 子句2 empty casesOrdered branch list. Each case has a handle label and a JavaScript expression; the first truthy expression is taken.
Include defaulttrueWhether 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

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新