- 发行说明
- 在开始之前
- 入门指南
- Activities (活动)
- 操作
- 流程
- 通知
UiPath.Persistence.Activities.ExternalTask.CreateExternalTask
描述
使用给定的数据、任务标题、任务优先级和任务目录创建外部操作。
项目兼容性
Windows - 旧版 | Windows | 跨平台
Windows、Windows - 旧版配置
设计器面板
- 任务标题- 要创建的操作的标题。此字段仅支持字符串和
String变量。 - 任务优先级- 用于选择操作的优先级。默认情况下,该属性设置为TaskPriority.MEDIUM ,提供以下选项: TaskPriority.Low 、 TaskPriority.MEDIUM 、 TaskPriority.High和TaskPriority.Critical 。
- TaskCatalog - An optional business classification of task items. This field supports strings and
Stringvariables only. - TaskData - A collection of business data, in the form
Dictionary<String,Argument>, that you want to store in a given action. ModifyingOutandIn/Outarguments maps them back to the workflow after the action is completed. This field supportsDictionary<String,Argument>objects only. - TaskObject(Output) - The task object that is returned from Orchestrator as an
ExternalTaskDataobject after the action is created. This object can be passed to the Wait for External Task and Resume activity in order to suspend the execution of the workflow until the action is completed.
属性面板
常见
- “出错时继续”- 指定在活动引发错误时是否应继续自动化操作。该字段仅支持“布尔值”(True 和 False)。默认值为 False。因此,如果该字段为空且活动引发错误,系统将停止执行项目。如果该值设为“True”,则无论出现何种错误,系统都将继续执行项目。
如果“Try Catch 异常处理”中包含该活动且“出错时继续”属性的值为“True”,则系统在执行项目时不会捕获任何错误。
- “显示名称”- 活动的显示名称。
- “超时(毫秒)”- 指定最长等待时间(以毫秒为单位),如果超出该时间后活动并未运行,系统便会抛出错误。默认值为 30000 毫秒(30 秒)。
输入
- External Tag - A tag that can be used to identify the external system which is the source for the data in the given action. This field supports strings and
Stringvariables only. - 标签- 机器人将输入的标签添加到操作中,以便于将来进行筛选。该字段仅支持字符串值,并有命名限制。
要允许通过“暂留”活动标记自动操作,执行工作流的机器人帐户需要对标签 的查看、创建和删除权限 。
- Orchestrator 文件夹路径- 当前流程不在其中运行的Orchestrator 文件夹的路径(要在其中创建任务)。要了解有关 Orchestrator 文件夹的更多信息,请转到此处。对于传统文件夹,此属性只能用于浮动机器人,并且仅在当前用户在目标文件夹中具有正确的任务权限时才可用。对于新式文件夹,不支持文件夹路径覆盖。此字段仅支持字符串和
String变量。
仅当必须从当前文件夹以外的文件夹创建或查询任务时,才必须使用“文件夹路径”属性。如果执行此操作的用户没有目标文件夹所需的权限,则创建任务将失败并引发严重错误。您可以在此处查看有关文件夹权限的更多信息。
- TaskCatalog - An optional business classification of task items. This field supports strings and
Stringvariables only.
在创建操作之前,请确保操作目录存在。否则,操作创建将失败,并显示以下错误消息:“不存在名称为 [action_catalog_name] 的任务目录,错误代码:2451”。
- TaskData - A collection of business data, in the form
Dictionary<String,Argument>, that you want to store in a given action. ModifyingOutandIn/Outarguments maps them back to the workflow after the action is completed. This field supportsDictionary<String,Argument>objects only. - 任务优先级- 用于选择操作的优先级。默认情况下,该属性设置为TaskPriority.MEDIUM ,提供以下选项: TaskPriority.Low 、 TaskPriority.MEDIUM 、 TaskPriority.High和TaskPriority.Critical 。
- 任务标题- 要创建的操作的标题。此字段仅支持字符串和
String变量。
其他
- “私有”- 选中后将不再以“Verbose”级别记录变量和参数的值。
输出
- TaskObject(Output) - The task object that is returned from Orchestrator as an
ExternalTaskDataobject after the action is created. This object can be passed to the Wait for External Task and Resume activity in order to suspend the execution of the workflow until the action is completed.
跨平台配置
- 任务标题- 要创建的操作的标题。此字段仅支持字符串和
String变量。 - 任务优先级- 用于选择操作的优先级。默认情况下,该属性设置为TaskPriority.MEDIUM ,提供以下选项: TaskPriority.Low 、 TaskPriority.MEDIUM 、 TaskPriority.High和TaskPriority.Critical 。
- TaskCatalog - An optional business classification of task items. This field supports strings and
Stringvariables only.
在创建操作之前,请确保操作目录存在。否则,操作创建将失败,并显示以下错误消息:“不存在名称为 [action_catalog_name] 的任务目录,错误代码:2451”。
- TaskData - A collection of business data, in the form
Dictionary<String,Argument>, that you want to store in a given action. ModifyingOutandIn/Outarguments maps them back to the workflow after the action is completed. This field supportsDictionary<String,Argument>objects only. - TaskObject(Output) - The task object that is returned from Orchestrator as an
ExternalTaskDataobject after the action is created. This object can be passed to the Wait for External Task and Resume activity in order to suspend the execution of the workflow until the action is completed.
高级选项
常见
- “出错时继续”- 指定在活动引发错误时是否应继续自动化操作。该字段仅支持“布尔值”(True 和 False)。默认值为 False。因此,如果该字段为空且活动引发错误,系统将停止执行项目。如果该值设为“True”,则无论出现何种错误,系统都将继续执行项目。
如果“Try Catch 异常处理”中包含该活动且“出错时继续”属性的值为“True”,则系统在执行项目时不会捕获任何错误。
- “超时(毫秒)”- 指定最长等待时间(以毫秒为单位),如果超出该时间后活动并未运行,系统便会抛出错误。默认值为 30000 毫秒(30 秒)。
输入
- 标签- 机器人将输入的标签添加到操作中,以便于将来进行筛选。该字段仅支持字符串值,并有命名限制。
要允许通过“暂留”活动标记自动操作,执行工作流的机器人帐户需要对标签 的查看、创建和删除权限 。
- Orchestrator 文件夹路径- 当前流程不在其中运行的Orchestrator 文件夹的路径(要在其中创建任务)。要了解有关 Orchestrator 文件夹的更多信息,请转到此处。对于传统文件夹,此属性只能用于浮动机器人,并且仅在当前用户在目标文件夹中具有正确的任务权限时才可用。对于新式文件夹,不支持文件夹路径覆盖。此字段仅支持字符串和
String变量。
仅当必须从当前文件夹以外的文件夹创建或查询任务时,才必须使用“文件夹路径”属性。如果执行此操作的用户没有目标文件夹所需的权限,则创建任务将失败并引发严重错误。您可以在此处查看有关文件夹权限的更多信息。
- “引用” - 此标签可用于识别作为给定操作中数据来源的外部系统。此字段仅支持字符串和
String变量。
创建外部操作
要创建外部操作,请在以下过程中选择:
- 将“创建外部任务”活动添加到工作流中,并为以下属性字段提供信息:
- 任务标题
- 任务优先级
- 任务数据 (集合)
- 外部标签- 指定标签以唯一标识要从第三方系统检索的外部任务批次。您可以使用此标签将外部任务与外部系统同步。此外,您可以根据用户在第三方系统中执行的操作使用此标签完成任务。
- 使用 API创建外部操作。
将外部操作与第三方工具同步
要将外部操作与其他外部系统同步,您需要首先在外部系统内为其创建相应的对象,然后使用 API 调用检索第三方系统创建的任务或任务批次。
-
在外部系统内创建对象,例如:
-
在 Swagger 中调用以下 API: GET
/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFolders。例如: GET
<ORCH_URL>/odata/Tasks/UiPath.Server.Configuration.OData.GetTasksAcrossFolders?$filter=(Type eq 'ExternalTask') and (IsDeleted eq false) and (ExternalTag eq 'JiraTasks') and (Status ne 'Completed')&$count=true。
检索外部操作
调用以下 API,使用任务 ID和组织单位 ID (Orchestrator 文件夹的 ID)检索有关外部任务的信息: GET /tasks/GenericTasks/GetTaskDataById 。您可以使用检索到的详细信息在第三方系统中创建类似任务。
下面的屏幕截图显示了 Swagger 中的 API 参数和响应。要在 Swagger 中访问租户,请按照“访问 Swagger 文件”过程进行操作。
完成外部操作
使用任务 ID和组织单位 ID (Orchestrator 文件夹的 ID)调用以下 API 以完成外部任务: POST /tasks/GenericTasks/CompleteTask 。
有关更多详细信息,请访问 Orchestrator API 指南中的“完成外部任务”过程。
工作流示例
如需获取示例或供日后参考,请查看示例项目