Creating a Command Custom Activity
You can create an activity based on a user-defined command. The following procedure creates an activity to execute a SQL query against a specific database as an example.
- From your Workflow window in the Activities pane, click Create Activity.
In the New Activity Type dialog box, the Command activity type is selected by default.
- Click OK.
- In the New Command 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, SQLquery. This is the name you 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 SQLquery activity will need the following string variables to perform the query:
- sqlServer, which will be the name of the client where the SQL Server resides
- userName, which will the user account executing the SQL query
- password, which will be password for the user account
- database, which will be the name of the SQL database
- query, which will be the actual SQL query
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, sqlServer.
- Select string from the Variable Type list and click OK.
If applicable, you can specify default value for the inputs in the Value column.
- Click the Definition tab to specify the command details. If you need to specify a variable that you created, click Insert Variable and select the variable from the list.
Following our example, you can use this tab to specify the SQL query command details, as shown in the image below.
- 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/8/2018 8:43:08 PM