Returning a Value in a Workflow

When calling a workflow, the workflow might return a result. The results should be retrieved for the called workflow only after the workflow has completed. Typically, an event handler should listen to the End event of the workflow, so that it can then retrieve the workflow result using the GetResult function of the workflow.

To return a value in a workflow:

1. Click the step in the workflow for which you want to return a value.
2. Click Workflow result value type and select the type of value to be returned.

3. Invoke the Set Result function. This function is used to invoke a workflow from a web service. For example, you may have a workflow that is responsible for adding a new entity to the database. In this case, the Set Result function is used to return the ID of this entity in the workflow.

The GetResult function retrieves a result. It cannot be used within a workflow, however it can be used to retrieve the result from a workflow, once the workflow has completed.