When you use custom activities in your workflows, you need to understand how shared settings of custom activities work.
All settings (display name, short name, description, PowerShell script, and user interface elements) that you specify for custom activities created from scratch are shared that is, if you modify any of these settings for a custom activity included in or excluded from a workflow, the changes will be automatically propagated to all instances of this activity in all workflows and Management Policies.
If you create a custom activity by converting a built-in activity, the custom activity has two types of settings: built-in and shared. Built-in settings are the settings inherited from the built-in activity. Such settings are not shared. If you modify them, the changes will be applied only to the current activity instance. But if you modify the shared settings (display name, short name, description, PowerShell script), such changes will be propagated throughout all instances of this activity.
For example, if you modify the PowerShell script for your custom activity My Custom CAPTCHA, when you save the activity, the updated settings will be applied to all instances of the My Custom CAPTCHA activity used in other workflows and Management Policies. But if you modify the built-in setting (noise level) of the My Custom CAPTCHA activity, when you save the activity, the changes will be applied only to this instance of the activity. The noise level setting of other instances of the My Custom CAPTCHA activity will not be changed.
When you create a custom activity from scratch or by converting a built-in activity, the created custom activity in the Custom group of the activities list in the workflow designer. If you want to copy the created activity, hover over the activity in the left pane of the workflow designer, and click Copy.
Note, that this functionality is available only after you turn on the extensibility features.
To turn extensibility features on
-
Open the Administration site and click the General Settings tab.
-
On the General Settings page, select the Extensibility tab.
-
On the Extensibility settings page, click the upper Turn on button.
To create a custom activity from scratch
-
On the Administration site, open the workflow designer, expand the Custom group in the left pane, and click Add new custom activity.
-
On the User Interface Designer tab, enter the main instruction for the activity in the default language. You can translate the main instruction text into other languages by clicking the Add new language link. This text will be displayed on the page of the Self-Service or Helpdesk site page when the activity is executed. Any user interface elements that you add will be displayed below the main instruction.
-
To add user interface elements, click Add new element in the User interface elements section.
-
In the Add New Element dialog, select the user interface element you want to add and enter the element’s ID and label. Select the following options if required:
-
Click OK:
-
Disable the element on the user interface: Select this check box if you want to make this element disabled on the Self-Service or Helpdesk site.
-
Hide the element on the user interface: Select this check box if you want to hide this element from the Self-Service or Helpdesk site.
-
On the Activity Name tab, specify the following options:
-
Activity short name: The activity name that should be used in PowerShell scripts to refer to the activity.
-
Activity display name: The activity name displayed in the activities list and workflow designer.
-
Activity description : Your description of the custom activity.
-
On the PowerShell Script tab, enter the PowerShell script to set the activity behavior. For more information on how to create and use activity scripts, refer to the Password Manager SDK.
-
Click OK.
Any built-in activity (Self-Service or Helpdesk) can be converted to a custom one by clicking the Convert to custom activity link on a built-in activity in the activities list or the workflow designer. If you want to copy the created activity, hover over the activity in the left pane of the workflow designer, and click Copy.
To convert a built-in activity to a custom activity
-
On the Administration site, open the workflow designer, select the built-in activity you want to convert, and click the Convert to custom activity link on the activity.
-
Hover over the created activity and click the Shared settings link.
-
On the Activity Name tab, specify the following options:
-
Activity short name . The activity name that should be used in PowerShell scripts to refer to the activity.
-
Activity display name. The activity name displayed in the activities list and workflow designer
- Activity description . Your description of the custom activity.
-
On the PowerShell Script tab, enter the PowerShell script to set the activity behavior. For more information on how to create and use activity scripts, refer to the Password Manager SDK.
-
Click OK.
Using the import and export custom activity functionality, you can effortlessly share and copy custom activities that you created. If you want to reuse a custom activity in another workflow, export the activity to an archive file and then import it to the required workflow.
Note that you can import and export custom activities only. This functionality is available only after you turn on the extensibility features.
To turn extensibility features on
-
Open the Administration site and click the General Settings tab.
-
On the General Settings page, select the Extensibility tab.
-
On the Extensibility settings page, click the upper Turn on button.
To export custom activity
-
On the Administration site, open the workflow designer, expand the Custom group in the left pane of the workflow designer, hover over the custom activity you want to export, and click Export.
-
Depending on your browser settings, specify where you want to save the archive file and download the archive.
When you import custom activities, note that existing custom activities with the same name will be replaced. You can back up existing activities by exporting them when prompted.
IMPORTANT: When you import custom activities, it is strongly recommended to audit activities’ scripts before using activities in a production environment. This is required because security-sensitive information can be accessed via PowerShell scripts included in a custom activity. Import custom activities from a trusted source only.
To import custom activity
-
On the Administration site, open the workflow designer, expand the Custom group in the left pane of the workflow designer, and click Import custom activity.
-
In the Import Custom Activity dialog box, click Upload to select the activity archive file and then click OK.
To remove a custom activity, click the Remove link on the custom activity in the workflow designer or in the activities list.
NOTE: You can permanently remove the custom activity only if it is removed from all workflows where it is used first.