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.

Wichtig!
Das UiPath.Activities.API SDK-Paket muss als Entwicklungsabhängigkeit in Ihrem benutzerdefinierten Projekt verwendet werden. Lesen Sie mehr über Entwicklungsabhängigkeiten.
So verwenden Sie die API
When the activities are loaded into Studio, a reference to IWorkflowDesignApi
is provided in several ways:
- Fügen Sie innerhalb der
IRegisterMetadata
-Implementierung einepublic void Initialize(object api)
-Methode hinzu. Diese Methode wird während des Aktivitätsladevorgangs aufgerufen, und die Aktivität kann denapi
-Parameter für die spätere Verwendung speichern. - 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. - Rufen Sie einen Verweis auf das
api
-Objekt ab, indem Siecontext.Services.GetService<IWorkflowDesignApi>()
aufrufen, bei demcontext
ein System.Activities.Presentation.EditingContext ist, auf den in der Regel Aktivitätsdesigner zugreifen können.
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:
Aktualisiert vor 3 Monaten