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.
- Go to the Studio Backstage View > Start > Library. This opens the New Blank Library window.
- Fill in the name and pick a location for the library. The default location is
C:\Users\<current_user>\Documents\UiPath. Add a description, select the project compatibility and language, and then select Create. The new library is created and saved on your local machine.
- The library name cannot exceed 128 characters, and the description cannot exceed 500 characters.
- Do not use
libas a library name, as this will result in a compile error in projects where the library is installed.
- The Project Panel displays the tree view with the Project folder, Dependencies, and the
NewActivity.xamlwhich contains the actual workflow.
Each workflow file in a library is available as an activity in projects where the library is installed as a dependency. If you want to make a certain file private, right-click it and select Make Private. In this case, the file is included in the library package, but it is not available as a reusable component in the Activities panel.
By default, the dependencies available for new libraries are the same as for blank new projects, namely
UiPath.UIAutomation.Activities, with the Lowest Applicable Version runtime rule.
To add a tooltip and help link to an activity, right-click the workflow file in the Project panel and select Properties. The tooltip is visible when you hover over the activity in the Activities and Designer panels in projects where the library is installed. The Help Link opens when you select the activity in the Designer panel and press F1.
Arguments you define in the library become activity properties in the projects where the library is installed as a dependency. Arguments that are marked as required are available in the body of the activity in the Designer panel. Annotations you add to an argument in the library are displayed as a tooltip for the property in the resulting activity's Properties panel. For more information about arguments, see Arguments Panel.
- In the case of libraries, it is recommended to use
Nothingto assign a null value to a variable, rather than
"". This is done to avoid any inconsistencies when using the packaged library as a dependency to a project.
- The ImplementationVersion property of the
System.Activities.ActivityBuilderobject is not supported. Setting a value for this property results in arguments not being saved. This object is displayed in the Properties panel when you select the blank area of the Designer panel.
To configure the settings of a library project, open the Project Settings window by clicking Settings 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.
- Automation Hub URL - URL of an Automation Hub idea linked to the project. For more information, see Linking a Project to an Idea in Automation Hub.
- Project Icon - optionally, define a custom icon for the project. You can browse to and select a file, or enter a path or public URL to an
pngfile up to 1MB in size.
After the project is published, the icon is displayed next to the package in the Manage Packages window in Studio..
- Include Sources - set to Yes to include all
.xamlsources within the library package, including workflows that were previously made private. For Windows - Legacy libraries, the files are saved in the generated assembly file and in the
lib\net45folder in the
.nupkgfile. For Windows and cross-platform libraries, the files are saved in the
contentfolder in the
- Compile activities expressions - set to Yes to compile and package all activities expressions with the library. This results in an improved execution time. Available for Windows - legacy libraries only.
- Ready to Run - set to Yes to optimize the generated assemblies for faster JIT compilation at runtime. Available for Windows - legacy libraries only.
- 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
.xamlfiles they contain may not be successfully published.
- If a library contains a
.xamlfile and an argument that have the same name, the library cannot be published.
- Library projects with the Windows - Legacy compatibility cannot be published if they contain Invoke Workflow File activities with the Isolated option selected. An error message is displayed in the Output panel when you try to publish. This limitation does not apply to libraries that use the Windows or cross-platform compatibility.
- 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.
- If a library contains an activity that accepts a file path as input, when the component is used in a project, paths that include environment variables are interpreted as paths relative to the library folder. As a workaround, use either the
Environment.GetEnvironmentVariablemethod or a Get Environment Folder activity to retrieve the folder path, and then use the output to construct an absolute path to pass to the reusable component.
- If a workflow file placed inside a folder in a library is used as a namespace in a project, changing the folder name, republishing, and installing the updated library in the project results in unknown activities.
- Open or create a new project.
- Under the All Packages category, pick the feed under which the library is saved and install the package.
- Select OK and the package is added to the project definition.
- The activity is found in the custom category of the Activities panel.
- Libraries can only be installed in projects that have the same compatibility.
- If a cross-platform library contains a workflow with UI Automation activities, adding the generated activity in a cross-platform project results in a validation error when the project is executed.
- Errors may occur when you run a project that contains custom activities from a library that was created in a Studio version prior to 2019.10.1 and published from Studio 2019.10.1 or later. In this scenario, you must recreate and republish the library.
- When using Import Workflows to add a workflow that contains a library in a library project, the dependencies referenced in the library are not imported.
- When importing two versions of the same custom library in a project, 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 2 months ago