The UiPath.Activities.API SDK package is hosted on the Official activities feed (https://pkgs.dev.azure.com/uipath/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json
).
Among others, the package is used for:
- Building Custom Workflow Analyzer rules by adding descriptions, parameters, and integrating them in Studio's Workflow Analyzer Settings window.


- Building your own Activities Project Settings by adding categories, sections, numeric input fields, combo boxes, and integrating them in the Activity Project Settings window in Studio, much like activities from UiPath packages.


- Creating custom wizards and integrating them in the Studio ribbon.


重要
UiPath.Activities.API SDK 包必须用作自定义项目中的开发依赖项。阅读有关开发依赖项的更多信息。
如何使用 API
When the activities are loaded into Studio, a reference to IWorkflowDesignApi
is provided in several ways:
- 在
IRegisterMetadata
实施内部,添加public void Initialize(object api)
方法。在活动加载过程中,系统将调用此方法,并且活动可以存储api
参数供以后使用。 - Define a class that implements
IRegisterWorkflowDesignApi
. The methodIRegisterWorkflowDesignApi.Initialize(IWorkflowDesignApi api)
is called during the activity loading process, and the activity can store theapi
parameter for later usage. When using this method only Studio versions from 2019.6 are able to load your package. - 通过调用
context.Services.GetService<IWorkflowDesignApi>()
引用api
对象,其中context
为 System.Activities.Presentation.EditingContext,通常供活动设计人员使用。
Design Feature Keys
It is important to perform a preliminary check against the DesignFeatureKeys
to see if the needed feature keys are supported. For more information, see the list of feature keys.
In order to check for a feature, you need to call the HasFeature
method on the IWorkflowDesignApi
reference, otherwise calls to the relevant api methods might fail with MissingMemberException or MissingMethodException on older Studio versions.
IWorkflowDesignApi studioActivitiesApi;
// How to check for a feature.
if (studioActivitiesApi.HasFeature(UiPath.Studio.Activities.Api.DesignFeatureKeys.Settings))
{
// Call Method or lambda that is using specific feature
// This ensures that the code is JIT compiled only after the feature check
}
Interfaces
The following interfaces are available:
3个月前更新