studio
latest
false
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

Studio 用户指南

上次更新日期 2026年3月4日

基于模板的工作流

使用工作流模板作为其他工作流的基础模型。您可以使用内置模板(例如序列全局异常处理程序、创建自定义模板,或使用项目中安装的库中的模板。

条件:

  • 模板特定于项目类型和语言。
  • 文件模板无法转换为工作流,也无法进行编译或发布。
  • 您可以创建基于其他模板的模板。

模板来源

When you add a new workflow to a project, you can choose a template on which to base it. The templates that you can choose from vary depending on the type of file you are adding (workflow or test case), whether you've installed libraries that contain file templates, and whether you've previously added templates to your project Templates folder.

内置文件模板

序列

如果您要设计具有作为单个块的顺序活动的工作流,则“序列”模板很有用。此模板仅可用于工作流。

流程图

使用“流程图”模板设计具有多个分支的工作流。 此模板仅可用于工作流。

状态机

使用状态机模板设计具有根据指定状态触发的活动的工作流。此模板仅可用于工作流。

本地文件模板

当您将文件提取为模板将模板添加到“模板”文件夹时,本地模板会在项目的“模板”文件夹中创建。本地文件模板在您创建它们的项目中可用。 在库项目中添加的本地模板将在作为依赖项安装库的项目中可用。

您可以创建三种类型的本地模板:执行模板、工作流模板和测试用例模板。当您将文件提取为模板时,会根据您提取的文件类型(工作流或测试用例)自动应用模板类型。 当您手动将模板添加到“模板”文件夹时,您需要选择要创建的模板类型。

包文件模板

包文件模板是包含在库或活动包中的文件模板,这些包作为依赖项安装在项目中。

When you create a workflow, you can find workflow templates from installed libraries under Package file templates in the Template dropdown.

docs image

添加本地文件模板

You can use the contextual menu in the Project panel to manually add workflow, execution, and test case templates based on other templates to your project. After you add a template, you can edit it in the Designer, and then use it as a starting point for creating other files.

docs image

To add a workflow template, right-click the Templates folder, and then select Add > Workflow Template. You can then select a template on which to base the new template.

docs image

将文件提取为模板

如果要将现有工作流作为未来文件的模板提供,请将其提取为模板。

In the Project panel, right-click a workflow, and then select Extract as Template.

docs image

The extracted file is added to the Templates folder. The following image shows a workflow template created from a sequence and two test case templates.

docs image

库中的工作流模板

您可以在库中创建工作流模板,就像在流程中创建工作流模板一样。发布库后,标记为“公共”的模板将作为包文件模板在安装库的项目中可用。

根据模板创建工作流

  1. 创建空白流程。

  2. 构建要用作模板的任何工作流。在此示例中,示例工作流将创建一个表单(受访者可在其中提供其全名和年龄),然后输出受访者在表单中填写的年龄。

  3. 构建工作流后,右键单击它,然后选择“提取为模板”。 为模板命名,选择“Templates”文件夹作为存储模板的位置,然后选择“创建”。在此示例中,模板的名称为“MyFirstLocalTemplate”。

    docs image

  4. Go to the Design tab, in the File group, select New > Workflow. The New Workflow window is displayed.

  5. Give it an appropriate name and choose the location as the Templates folder, and select the template that you previously created from the Template dropdown list. For this example, choose MyFirstLocalTemplate.

    docs image

Example: Check out the sample XAML project below.

删除模板

To remove a template, expand the Templates folder in the Project panel, right-click the template, and then select Delete.

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新