Example: Workflow parameters and return values (start)

The Workflow Parameters and Return Values screen appears whenever you click the Parameters action. It shows the parameters and return values for the workflow.

An example best explains how to use the Workflow Parameters and Return Values screen. The following figure starts this example with a subflow workflow containing variables to hold the input parameters and the value to be returned. The example could also be a synchronous workflow, except the parameters must be optional. Or the example could be an asynchronous workflow, where the parameters must be optional and return values are not supported. The following figure shows the Start task of the example workflow; the user is about to click the Parameters action.
Figure 1. Start task example
The image is explained in the text.
The Workflow Parameters and Return Values screen appears as shown in the following figure. Note there are two sections: the Parameters section and the Return Values section. Clicking Add in the Parameters section allows you to define input parameters. Clicking Add in the Return Values section allows you to define return values. In order to have either of these the workflow must contain some variables. Variables are defined with the Variable Definition task, which is described in "Variable definition task".
Figure 2. Initial Workflow Parameters and Return Values screen
The image is explained in the text.
Click Add in the Parameters section. The Workflow Parameter Definition screen appears as shown in the following figure.
Figure 3. Adding a required parameter
The image is explained in the text.
Give the parameter a Name. The choices in the Variable drop down are the variables defined in the workflow. Check the Required check box if the parameter is required. For synchronous and asynchronous workflows, this option is not available because all parameters are optional. The following figure shows adding an optional parameter.
Figure 4. Adding an optional parameter
The image is explained in the text.
Click the Add action in the Return Values section. If the workflow is asynchronous, return values are not supported and will be ignored if added. When adding a Return Value, specify its Name and select its source from the Variable drop-down list, as shown in the following figure.
Figure 5. Adding a return value
The image is explained in the text.
Now the Workflow Parameters and Return Values screen looks like the following figure.
Figure 6. Example of workflow parameters and return values
The image is explained in the text.

To see how this example Start task is used with a calling workflow, see the Call Workflow task discussion in "Example: Workflow parameters and return values".