Creating an XML Operation Custom Activity
You can create an activity based on a user-defined XML operation. The following procedure creates an activity that creates a user.
- From your Workflow window, click Create Activity.
- In the New Activity Type dialog box, select XML Operation from the Activity Type list and click OK.
- In the New Operation Activity dialog box, click the General tab and provide the following general details:
- For the Name property, enter the name of the activity, for example, CreateUser. This is the name you will see in the Activities pane.
- For the Description property, specify what the activity does.
- For the Group property, select the activity group where you want to place the new activity, for example, Utilities. If you do not select a group, the new activity will be placed in the Ungrouped group.
- Click the Inputs tab to define the input variables that the activity will use.
In our example, the CreateUser activity will need the following string variables to perform the query:
- username, the name of the user account to be created
- password, the password for the user account
- fullname, the full name of the user for whom the account is being created
- email, the email account for the user account being created
To add the inputs follow these steps:
- Click Add.
- In the Add new property dialog box, enter the name of the variable in the Variable Name box, for example, CreateUser.
- Select string from the Variable Type list and click OK.
If applicable, you can specify a default value for the inputs in the Value column.
- Click the XML Input tab to specify the XML document details. If you need to specify a workflow variable or a variable that you created, click Insert Variable and select the variable from the list. Click OK.
Following our example, the code will retrieve the output of the XML request. You can use this output perform any sort of data manipulation that you require.
- Click the Outputs tab to retrieve the output from the XML operation activity. You can set the xpath statements directly in the value of the output. Click OK.
- The new activity should be listed in the left pane under a specific activity group. You can drag the activity to the design area to start using it in your workflow.
Last modified: 6/18/2018 4:06:43 PM