Subscribe

UiPath Studio

UiPath Studio 指南

关于库

A Library is a package which contains multiple reusable components. Libraries are saved as .nupkg files and can be installed as dependencies to workflows using Package Manager.

For example, you could create a library that collects data from an Excel spreadsheet and appends it to another, as explained in the Creating a Basic Library page. Next, the library can be packaged and used in other processes as an activity.

管理可重用的组件活动

A reusable component activity represents one or more workflows packaged together as a .nupkg file, and utilized in other processes.

创建库

  1. 转到“Studio 后台视图”>“开始”>“库”。这将打开新建空白库窗口。
  2. Fill in the name and pick a location for the library. The default location is C:\Users\<current_user>\Documents\UiPath. Add a description and select Create. The new library is created and saved on your local machine.
    Note: The library name cannot exceed 128 characters, and the description cannot exceed 500 characters.
  3. “项目”面板显示一个树视图,其中包括“项目”文件夹、“依赖项”以及包含实际工作流的 NewActivity.xaml

📘

Note:

默认情况下,新库可以使用的依赖项与空白新项目可以使用的依赖项相同,即 UiPath.Excel.ActivitiesUiPath.Mail.ActivitiesUiPath.System.ActivitiesUiPath.UIAutomation.Activities(“最低适用版本”规则有效)。

Add a tooltip and help link to a library by opening the Properties window.

The tooltip is visible in the Activities panel after you've added the new activity. The Help Link opens when you press F1 on the selected activity.

When creating a new library from a template, the Designer panel doesn’t automatically open the .xaml file, unless the library template has a Main.xaml file.

Add an annotation to a used argument in the library to have it displayed later as a tooltip in the activity's Properties panel. Read the Arguments Panel to find out more about adding annotations to arguments.

📘

Notes:

  • 就库而言,建议使用 Nothing(而非 "")将 null 值分配给变量。如此一来,在将打包的库作为依赖项用于项目中时,便能避免发生任何不一致的情况。
  • 不支持 System.Activities.ActivityBuilder 对象的“实现版本”属性。为该属性设置值将导致参数无法保存。当您选择“设计”面板的空白区域,该对象显示在“属性”面板中。

调整库设置

To configure the settings of a library project, open the Project Settings window by clicking Settings settings_iconsettings_icon in the Project panel.

The following options are available in the General tab:

  • Name - edit the name of the project.
  • Description - edit the description of the project.
  • Include Sources - set to Yes to package all .xaml sources within the generated assembly file, including workflows that were previously made private. This is helpful during debugging workflows.
  • Compile activities expressions - set to Yes to compile and package all activities expressions with the library. This results in an improved execution time.
  • Modern Design Experience - set to Yes to enable a modern experience of working with UI Automation, including new and improved activities, recorders, and wizards, as well as the Object Repository.

发布库

Publishing libraries is similar to publishing processes. For more information, see About Publishing Automation Projects.

发布库时的限制

When publishing libraries, take into account the following limitations:

  • Due to NuGet limitations:
    • You cannot publish libraries to locations that contain user-restricted subfolders using Windows environment path variables.
    • Release notes for published libraries are visible only in Orchestrator.
  • Libraries with special characters in the names of .xaml files they contain may not be successfully published.
  • Libraries containing Invoke Workflow File activities with the Isolated option selected cannot be published. An error message is displayed in the Output panel.
  • When using Invoke Workflow File activity, make sure the invoked file is located in the same folder as the library project.
  • The Launch Workflow Interactive activity is not supported for libraries.
  • Using Invoke Workflow File inside a library to reference the library itself is not supported.

向自动化项目中添加可重用组件

  1. 打开现有项目,或创建一个新项目。
  2. 在“所有包”类别下,选择保存库的订阅源并安装包。
  3. 选择“确定”,然后包将被添加到项目定义中。
  4. 该活动位于“活动”面板中的自定义类别中。

📘

Notes:

  • 库是向前兼容的,这意味着它们只能用于使用 Studio v2018.3 及更高版本创建的项目。库不能发布到版本低于 2018.3 的 Orchestrator。
  • 当您运行的项目包含自定义活动的项目时,可能会发生错误,这些自定义活动来自在 2019.10.1 之前的 Studio 版本中创建并通过 Studio 2019.10.1 或更高版本发布的库中。在这种情况下,您必须重新创建并重新发布库。

Please note that in a library project, when using Import Workflows to add a workflow that contains a library, the dependencies referenced in the library are not imported.

When importing two versions of the same custom library to a project in Studio, the extra custom activities contained only in the second library are not visible in the Activities panel unless you remove the first imported library.

Updated about a month ago



关于库


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.