sdk
latest
false
- Overview
- Custom activities
- Migrating Activities to .NET 6
- Release Notes
- Building Workflow Analyzer Rules
- Building Activities Project Settings
- Creating Custom Wizards
- Prioritize Activities by Scope
- UiPath.Activities.Api.Base
- UiPath.Studio.Activities.Api
- UiPath.Studio.Activities.Api.Activities
- UiPath.Studio.Activities.Api.BusyService
- UiPath.Studio.Activities.Api.ExpressionEditor
- UiPath.Studio.Activities.Api.Expressions
- UiPath.Studio.Activities.Api.Licensing
- UiPath.Studio.Activities.Api.Mocking
- UiPath.Studio.Activities.Api.ObjectLibrary
- UiPath.Studio.Activities.Api.PackageBindings
- UiPath.Studio.Activities.Api.ProjectProperties
- UiPath.Studio.Activities.Api.ScopedActivities
- UiPath.Studio.Activities.Api.Settings
- UiPath.Studio.Activities.Api.Wizards
- UiPath.Studio.Activities.Api.Workflow
- UiPath.Studio.Api.Controls
- UiPath.Studio.Api.Telemetry
- UiPath.Studio.Api.Theme
- Robot JavaScript SDK
- Triggers SDK
Developer Guide
Last updated Mar 23, 2024
Prioritize Activities by Scope
Using the UiPath.Activities.API package from the Official feed (
https://pkgs.dev.azure.com/uipath/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json
), you can set Studio to show activities that match the custom activity's scope at search. For information on how to use the
API, see Studio Activities SDK.
Therefore, when clicking the icon inside a custom activity the Command Palette offers suggestions of activities which fit the current scope.
To achieve this, use the
IScopedActivitiesService
interface, with the following methods:
SetScopedActivity
- Adds a pair made from a scope activity and an activity that is suitable to that scope.SetScopedActivities
- Adds a list of suitable activity types to the specified scope type.
Below is an example of how these methods should be used inside your custom activity:
public void Initialize(object argument)
{
try
{
if (!(argument is IWorkflowDesignApi api))
{
return;
}
if (api.HasFeature(DesignFeatureKeys.ScopedActivities))
{
api.ScopedActivitiesService.SetScopedActivities(typeof(FirstScopeActivity), new List<Type>() { typeof(FirstChildActivity), typeof(SecondChildActivity) });
api.ScopedActivitiesService.SetScopedActivity(typeof(SecondScopeActivity), typeof(ThirdChildActivity));
}
}
catch (Exception ex)
{
Trace.TraceError(ex.Message);
}
}
public void Initialize(object argument)
{
try
{
if (!(argument is IWorkflowDesignApi api))
{
return;
}
if (api.HasFeature(DesignFeatureKeys.ScopedActivities))
{
api.ScopedActivitiesService.SetScopedActivities(typeof(FirstScopeActivity), new List<Type>() { typeof(FirstChildActivity), typeof(SecondChildActivity) });
api.ScopedActivitiesService.SetScopedActivity(typeof(SecondScopeActivity), typeof(ThirdChildActivity));
}
}
catch (Exception ex)
{
Trace.TraceError(ex.Message);
}
}