How to Bind Input and Output Parameters in Workflow?

When you add a SendActivity activity to your workflow, it contains the standard properties that are required to implement the SendActivity functionality. When you define the ServiceOperationInfo property and specify the method to call, Visual Studio automatically adds any parameters that are required by the service method invocation to the activity property list. They will appear at the bottom of the list of properties in the Properties pane. You can then bind these properties to member variables in the workflow or exposed properties on other objects and activities in the workflow.

To bind input and output parameters to a SendActivity activity:

  1. Configure the ServiceOperationInfo property. Visual Studio uses the operation contract to determine the required method parameters and return type, and then adds the properties to the SendActivity object in the designer code. The Properties pane is then updated to enable you to bind the properties.

  2. Click a property, right-click the activity, and then click Bind Property 'PropertyName' to display the binding wizard.

  3. Select the locally available property from the list. The Bind Property dialog box restricts you to selecting type-safe properties, which means that you cannot select incompatible types when you bind properties.

Tip: There is a second method that you can use to bind a variable to a property. You can also click the property in the Properties pane and then click the ellipsis (...) button. This method will also open the Bind Property dialog box, but should not be used when you bind collections to a property. When you bind a collection, use the process that is described in the steps above.