- 开始使用
- 最佳实践
- 功能
- 技能
- CLI
- 示例
- 高级
- 帮助
方法:使用 REFramework 实现基于队列的流程
使用 REFramework 模板构建事务 RPA 流程,该流程从 Orchestrator 队列中拉取项目,并提供重试、日志记录和异常处理功能。
本秘钥根据机器人企业框架 (REFramework) 模板构建事务流程:它从 Orchestrator 队列中拉取项目,处理每个项目,并以企业流程应有的方式处理重试和异常。本图展示了编码智能体如何与 UiPath 的标准模板配合使用,以实现有弹性的大批量自动化。
先决条件
- 为 UiPath 设置的编码智能体,可使用经过身份验证的会话(请参阅安装和设置)。
- 一个至少包含 2 个示例项目的 Orchestrator 队列,或让智能体创建一个示例项目的请求。
构建流程
-
在空项目文件夹中打开编码智能体。
-
描述任务并为模板命名:
"使用 REFramework 模板创建新的 RPA 项目,以处理 Orchestrator 中的
Invoices队列中的项目。对于每个项目,读取发票字段,将其过账到我们的财务系统,设置事务状态,并在失败时重试。” -
Review the generated project: the Init, Get Transaction Data, Process Transaction, and End Process states, the configuration file in the
Datafolder, and the built-in logging and exception handling. -
Complete the Process Transaction state with the business logic for each transaction.
-
Set the queue, retry count, and assets without hard-coding them:
- In a
Config.jsonproject, set the retry count inConfig.json, select the queue on the Get Transaction Item activity inFramework\GetTransactionData.xaml, and read each asset with Get Asset or Get Credential in the workflow that uses it. - In a
Config.xlsxproject, set the queue name, retry count, and assets inConfig.xlsx.
- In a
-
要求智能体运行工作流分析器和单个测试事务。
-
确认项目以正确的状态在队列中移动,例如成功、失败或已重试。
-
确认已记录异常。
结果:基于 REFramework 构建的队列驱动事务流程,具有重试、日志记录和异常处理功能。
生成的结构和运行命令因智能体和提示而异。从队列项目状态和日志中确认成功,而不是从智能体的“完成”消息中确认。