- 入门指南
- 设置和配置
- 自动化项目
- 依赖项
- 工作流类型
- 控制流程
- 文件比较
- 自动化最佳实践
- 源代码控件集成
- 调试
- 日志记录
- 诊断工具
- 工作流分析器
- 变量
- 参数
- 导入的命名空间
- 编码自动化
- 基于触发器的 Attended 自动化
- 对象存储库
- ScreenScrapeJavaSupport 工具
- 扩展程序
- Studio 测试
- 故障排除

Studio 用户指南
基于模板的工作流
条件:
- 模板特定于项目类型和语言。
- 文件模板无法转换为工作流,也无法进行编译或发布。
- 您可以创建基于其他模板的模板。
模板来源
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.

添加本地文件模板
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.

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.

将文件提取为模板
如果要将现有工作流作为未来文件的模板提供,请将其提取为模板。
In the Project panel, right-click a workflow, and then select Extract as Template.

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.

库中的工作流模板
您可以在库中创建工作流模板,就像在流程中创建工作流模板一样。发布库后,标记为“公共”的模板将作为包文件模板在安装库的项目中可用。
根据模板创建工作流
-
创建空白流程。
-
构建要用作模板的任何工作流。在此示例中,示例工作流将创建一个表单(受访者可在其中提供其全名和年龄),然后输出受访者在表单中填写的年龄。
-
构建工作流后,右键单击它,然后选择“提取为模板”。 为模板命名,选择“Templates”文件夹作为存储模板的位置,然后选择“创建”。在此示例中,模板的名称为“MyFirstLocalTemplate”。

-
Go to the Design tab, in the File group, select New > Workflow. The New Workflow window is displayed.
-
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.

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.