uipath-cli
latest
false
UiPath CLI 用户指南
- 概述
- 开始使用
- 概念
- 使用 UiPath CLI
- 操作指南
- CI/CD 方法
- 命令参考
- 迁移
- 参考与支持
重要 :
请注意,此内容已使用机器翻译进行了本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。
UIP 规则调试
“uip rulesDebug”的语法和选项,用于将业务规则项目的解决方案上传到 Studio Web,并通过规则引擎对其进行评估。
uip rules debug将保存业务规则项目的解决方案上传到 Studio Web,并通过规则引擎评估一次项目。它会返回决策输出和任何评估错误,并且当规则引擎记录运行追踪时,会显示触发的规则的追踪 ID。
项目必须直接位于其解决方案文件夹中,因为uip rules init将创建该文件夹。首次运行会将 Studio Web 分配给解决方案的SolutionId写入解决方案的.uipx文件,因此以后的运行会覆盖相同的 Studio Web 解决方案。
该命令需要经过身份验证的会话。请参阅身份验证。
大纲
uip rules debug <project-path> [-i <json|@file.json>]
[--folder-path <path> | --folder-key <key>]
[--timeout <seconds>] [--login-validity <minutes>]
uip rules debug <project-path> [-i <json|@file.json>]
[--folder-path <path> | --folder-key <key>]
[--timeout <seconds>] [--login-validity <minutes>]
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<project-path> | 是 | 业务规则项目目录的路径。该目录必须包含project.uiproj 。 |
选项
| 短 | 长 | 值 | 默认 | 描述 |
|---|---|---|---|---|
-i | --inputs | JSON 对象或 @file.json | {} | 规则的输入值,可作为一个 JSON 对象或包含对象的文件路径,以@为前缀。 |
--folder-path | 字符串 | 您的个人工作区 | 要在其中评估并记录运行追踪的文件夹。 | |
--folder-key | GUID | 您的个人工作区 | 在其中评估并记录运行追踪的文件夹键。不能与--folder-path一起使用。 | |
--timeout | 整数 (1–3600) | 120 | 等待规则引擎评估的最长秒数。 | |
--login-validity | 整数 | 10 | 在运行之前触发会话刷新的最短分钟数,即令牌过期前的分钟数。 |
示例
# Evaluate with one set of inputs
uip rules debug ./LoanSolution/LoanEligibility --inputs '{"creditScore": 720}'
# Read the inputs from a file and evaluate in a specific folder
uip rules debug ./LoanSolution/LoanEligibility --inputs @inputs.json --folder-path Shared
# Evaluate with one set of inputs
uip rules debug ./LoanSolution/LoanEligibility --inputs '{"creditScore": 720}'
# Read the inputs from a file and evaluate in a specific folder
uip rules debug ./LoanSolution/LoanEligibility --inputs @inputs.json --folder-path Shared
数据形状(--输出 json)
Data键采用驼峰式命名法。
{
"Code": "RulesDebug",
"Data": {
"solutionId": "30823424-33e3-405e-f21c-08df1c789a14",
"projectId": "ee8a16e8-385c-42c1-81ee-1628ab7d7cb7",
"studioWebUrl": "https://cloud.uipath.com/acme/studio_/designer/ee8a16e8-385c-42c1-81ee-1628ab7d7cb7?solutionId=30823424-33e3-405e-f21c-08df1c789a14",
"fileName": "LoanEligibility.dmn",
"result": {
"decisions": [
{ "decisionName": "Eligibility", "outputs": { "eligible": true } }
]
},
"traceId": "499d9124f5da47462bd6535055483918"
}
}
{
"Code": "RulesDebug",
"Data": {
"solutionId": "30823424-33e3-405e-f21c-08df1c789a14",
"projectId": "ee8a16e8-385c-42c1-81ee-1628ab7d7cb7",
"studioWebUrl": "https://cloud.uipath.com/acme/studio_/designer/ee8a16e8-385c-42c1-81ee-1628ab7d7cb7?solutionId=30823424-33e3-405e-f21c-08df1c789a14",
"fileName": "LoanEligibility.dmn",
"result": {
"decisions": [
{ "decisionName": "Eligibility", "outputs": { "eligible": true } }
]
},
"traceId": "499d9124f5da47462bd6535055483918"
}
}
result.decisions保存每个决策的输出,或在决策失败时使用其error 。仅当引擎报告输入有错误时,才会显示result.errors和error 。
每当规则引擎记录运行追踪时, traceId都会出现。然后, Instructions会保留读取追踪的uip traces spans get命令。
退出代码
请参阅共享合同的退出代码。在以下情况下,命令将退出1 :
| 条件 | ErrorCode |
|---|---|
规则引擎会报告与输入相关的任何错误。Data保持与成功运行相同的状态,但引擎的错误位于Data.result和Data.error中。 | invalid_argument |
--inputs 不是 JSON 对象,或无法读取@file.json文件。 | invalid_argument |
项目目录的父文件夹不包含.uipx文件。 | invalid_argument |
--folder-path和--folder-key均会传递。 | invalid_argument |
规则引擎未在--timeout秒内做出响应。 | timeout |
| 租户未启用业务规则,或其区域未提供业务规则,或者该组织未在业务规则预览中注册。 | configuration_error |
| The connected environment does not serve the Business Rules engine. | not_supported |
configuration_error失败报告Result: "ConfigError" 。
When Studio Web does not let the rules engine read the uploaded project, the command reports Result: "AuthenticationError" with ErrorCode: "permission_denied" and exits 2.
相关命令
uip rules validate在运行前检查项目。uip traces spans get读取运行追踪。uip solution upload将解决方案上传到 Studio Web,而不对其进行评估。
另请参阅
uip rules查看工具概述和项目布局。