- 发行说明
- 入门指南
- UiPath Assistant
- 安装和升级
- 机器人类型
- 机器人组件
- 许可
- 将机器人连接到 Orchestrator
- 流程与活动
- 日志记录
- Robot JavaScript SDK
- 特定场景
- 故障排除
A process can be stopped through Kill or Cancel commands. The command can be sent from Orchestrator,Assistant or Studio.
当机器人收到取消命令时,它会取消执行当前活动并开始执行最终步骤。如果该流程的执行时间超过 3 秒,即会终止。
另一方面,当机器人收到终止流程的命令时,它会先尝试取消执行流程,如果流程未在 3 秒钟内取消,即会终止。
Try-Catch 方案
在“Try-Catch (捕获)”工作流中,当流程停止时,事务状态可能会显示为“成功”,而实际上该事务并未完成。
取消流程
当机器人收到取消命令时,如果执行位于 Try 或 Catch 块中,则跳至 Finally 块,以检查是否有任何错误。如果未发现错误,则 Finally 块便会认为执行已成功完成,原因是不存在失败事件(它们为空)。
终止流程
当机器人收到终止命令时,如果执行位于 Try 或 Catch 块中,它会先尝试取消流程,并跳至 Catch 块。如果在收到取消命令后 3 秒内,Finally 块中的逻辑未完成,则整个执行将终止,并且由于已经跳过 Catch 块,因此未在日志中记录任何错误,从而可视为整个流程已在日志中成功完成。
避免误报
- 在完成流程逻辑之后,只能在 Try 块内将流程状态设置为
Successful。 - 在完成错误处理逻辑之后,只能在 Try 块内将状态设置为
Failed。 - Finally 块中应该只存在清除逻辑,因为无论执行成功与否,系统都会执行该逻辑。
REFramework 流程方案
In the REFramework scenario, when a process is stopped, the block containing the error logic is skipped and the final block is executed. This causes the values for the BusinessError and SystemError to stay null and the overall process status is considered successful. The behavior described is intended.
如果跳过包含错误逻辑的块,则 BusinessError 和 SystemError 的值保留为 null,并且由于未记录任何错误,因此将整个过程状态视为 successful。