订阅

UiPath 开发者

The UiPath Developer Guide

关于活动 SDK

The UiPath.Activities.API SDK package is hosted on the Official activities feed (https://www.myget.org/F/workflow).

Among others, the package is used for:

📘

Important!

UiPath.Activities.API SDK 包必须用作自定义项目中的开发依赖项。阅读有关开发依赖项的更多信息。

如何使用 API

将活动加载到 Studio 后,系统将通过以下几种方式提供对 IWorkflowDesignApi 的引用:

  1. IRegisterMetadata 实施内部,添加 public void Initialize(object api) 方法。在活动加载过程中,系统将调用此方法,并且活动可以存储 api 参数供以后使用。
  2. 定义实施 IRegisterWorkflowDesignApi 的类别。在活动加载过程中,系统将调用方法 IRegisterWorkflowDesignApi.Initialize(IWorkflowDesignApi api),并且活动可以存储 api 参数供以后使用。使用此方法时,只有 2019.6 以上版本的 Studio 才能加载您的包。
  3. 通过调用 context.Services.GetService<IWorkflowDesignApi>() 引用 api 对象,其中 contextSystem.Activities.Presentation.EditingContext,通常供活动设计人员使用。

Design Feature Keys

重要的是,对 DesignFeatureKeys 执行初步检查以查看是否支持所需的功能键。

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
           }

List of Feature Keys

Feature Key

Version

AccessProvider

Studio 2019.8 and up.

InstallExtensions

Studio 2020.4 and up.

LibraryService

Studio 2020.4-beta and up.

LibraryServiceV2

Studio 2020.4 and up.

ProjectProperties

Studio 2020.2 and up.

ScopedActivities

Studio 2020.2 and up.

Settings

Studio 2019.8 and up.

SettingsV2

Studio 2020.4 and up.

Telemetry

Studio 2019.10 and up.

Theme

Studio 2019.8 and up.

Wizards

Studio 2019.8 and up.

WizardsV2

Studio 2020.2 and up.

WizardsV3

Studio 2020.3 and up.

WorkflowAnalyzer

Studio 2019.10 and up.

WorkflowAnalyzerV2

Studio 2019.10.2 and up.

WorkflowAnalyzerV3

Studio 2019.10.3 and up.

WorkflowAnalyzerV4

Studio 2020.2 and up.

Interfaces

IExtensionsInstallerService Interface

Methods

void InstallExtension(string extensionName)
Member of UiPath.Studio.Activities.Api.IExtensionsInstallerService

IRegisterAnalyzerConfiguration Interface

Component called by the analyzer application in each rule assembly, in order to configure the host analyzer.

Methods

void Initialize(UiPath.Studio.Activities.Api.Analyzer.IAnalyzerConfigurationService workflowAnalyzerConfigService)
Member of UiPath.Studio.Activities.Api.IRegisterAnalyzerConfiguration

Summary:
Offers an injection point to the implementing assembly in order to access UiPath.Studio.Activities.Api.Analyzer.IAnalyzerConfigurationService capabilities.

Parameters:
workflowAnalyzerConfigService: The analyzer interface.

IRegisterWorkflowDesignApi Interface

Workflow designer API registration. It follows the same pattern as IRegisterMetadata. Studio scans the types in your assembly for implementations of this interface.

If an implementation is found, an instance is created by Studio and the API instance is handed through UiPath.Studio.Activities.Api.IRegisterWorkflowDesignApi.Initialize(UiPath.Studio.Activities.Api.IWorkflowDesignApi).

Note that older Studio versions that do not ship with the API are not able to load your assembly. If you want to keep the compatibility with the older Studio versions, instead of implementing this interface, add an Initialize(object) method on the implementation of IRegisterMetadata, that Studio will discover through reflection. Cast the object parameter to UiPath.Studio.Activities.Api.IWorkflowDesignApi on your side. The same UiPath.Studio.Activities.Api.IWorkflowDesignApi instance may be retrieved from the designer context through GetService.

Methods

void Initialize(UiPath.Studio.Activities.Api.IWorkflowDesignApi api)
Member of UiPath.Studio.Activities.Api.IRegisterWorkflowDesignApi

Summary:
Register the API instance

IWorkflowDesignApi Interface

Offers capabilities to query runtime support of a feature.

Properties

Summary

AccessProvider { get; }

Part of IAccessProvider interface, runtime service exposes a method for obtaining OAuth 2.0 access tokens.

ExtensionsInstallerService { get; }

Part of public interface IExtensionsInstallerService.

ProjectPropertiesService { get; }

Part of IProjectPropertiesService, the entry point for expression language-related functionality.

Requires feature ProjectPropertiesV1.

ScopedActivitiesService { get; }

Part of IScopedActivitiesService, which exposes the functionality of adding scope activity types with their suggested activity types.

Requires feature ScopedActivitiesV1

Settings { get; }

Part of IActivitiesSettingsService interface, the entry point for settings related functionality.

Telemetry { get; }

Part of ITelemetryService, the telemetry service.

Theme { get; }

Part of IThemeService, the entry point for theme-related functionality.

Wizards { get; }

Part of IWizardsService, interface for adding wizards to Studio.

WorkflowAnalyzerConfigService { get; }

Part of IAnalyzerConfigurationService, which represents components that configure the Workflow Analyzer.

10 个月前更新



关于活动 SDK


Suggested Edits are limited on API Reference Pages

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