Skip to main content

Modify workflow to support parameters

In our first Process Studio HelloWorld workflow, we have given a hardcoded path for the input csv file and output xls files. However, these paths are specific to the machine where process studio is being used. The Process Studio workflows may be published by many individual tenants on various instances of AutomationEdge. Hence the hardcoded path is no longer relevant. We need to modify these using internal process studio variables and parameterization. Modelling of a business process using a Process Studio workflow or a Process Studio process would be incomplete without support for input parameters. Here we will see how parameters can be passed to and used in a workflow or a process. We will revisit HelloWorld workflow we built earlier and parameterize it.

To parameterize the workflow:

  1. Open the HelloWorld workflow properties dialog and click Parameters tab. Add two parameters Workflow_InputFile and Workflow_OutputFile for input file and output filename, respectively. Specify Type for:
    • Workflow_InputFile parameter as File. For parameter type File, specify the extension allowed in List of Values, for example, .csv.
    • Workflow_OutputFile parameter as String
tip

Keep Runtime option for both, Workflow_InputFile and Workflow_OutputFile. The Runtime option allows the user to provide the values at runtime during execution.

alt text

Provide a default value for the Workflow_InputFile parameter: ${Internal.Entry.Current.Directory}/sales_data.csv, where ${Internal.Entry.Current.Directory} is an internal Process Studio variable, which indicates directory where the file you are working on is saved. Provide a default value for Workflow_OutputFile. For example, sales_data_output.

  1. Change Read Sales Data step to use the Workflow_InputFile parameter. Edit the Filename property of the step. On a Windows machine, press Ctrl + Space keyboard characters with focus on Filename and you will see list of available parameters and variables. Select Workflow_InputFile or type in ${Workflow_InputFile}.

alt text

  1. Change the Microsoft Excel Output step to use the Workflow_OutputFile parameter. In the Extension field, see xls extension. Provide ${Internal.Entry.Current.Directory}, as the file path for the filename.

alt text

  1. Now run the workflow to open Run Options dialog. The dialog lets you specify value of input parameters before running the workflow. As we had provided correct default values for these parameters, we don’t have to provide a value for these again. But you can provide a value for any parameter to override the default value. Click Run to execute the workflow. Workflow gets executed as expected.

alt text

  1. We have parameterized and executed HelloWorld workflow in Process Studio Development Environment. Publish the workflow on AutomationEdge server. For publishing details, see Publish Sales Revenue Project on AutomationEdge. Agents execute the workflows after being published on the AutomationEdge server.