Use the In-Process Consumer Activity to consume a Web service listener from another workflow, which enables you to pass complex objects between workflows. This activity also promotes encapsulation and modularity, which enables multiple workflows to consume the same Web service. The child workflow is executed in-process, not through HTTP protocol.
The In-Process Consumer works like a standard Web Service Consumer, except that it consumes a Web Service Listener from another workflow. The Web Service Listener is a standard Web Service Listener, except that its Access Mode property must be set to In-Process so that it can be consumed by an In-Process Consumer.
We'll walk you through an example to help understand how to set up and execute the In-Process Consumer.
- Create a Web Service Listener in workflow A.
- Create an In-Process Consumer in workflow B.
- Connect the In-Process Consumer in workflow B to the Web Service Listener in workflow A.
- Define data field bindings.
In this example of a Mortgage Claim workflow, the In-Process Consumer of the main workflow consumes a Web Service Listener in a second workflow, which calculates the Credit Score. This score is returned to the main workflow.
1. Add an In-Process Consumer activity to the main workflow.
2. Double-click the In-Process Consumer to define its properties. Provide an activity Name, Alias and Description. Click Next.
3. Click New. The In-Process Consumer Details screen appears.
4. Enter a Name for the In-Process Consumer, and select a Web Service Listener from the list of available Listeners. You can create or edit a Listener from Administration > Global Settings > Web Service Listener table. Click OK.
5. If the Web Service Listener is at the start of the second workflow:
In the Headers > ActivityMetadata > WorkflowSpaceName field, enter the Workflow Space name of the second workflow.
If the Web Service Listener is in the middle of the second workflow:
In the Headers > ActivityMetadata > , enter a unique identifier of the listener, for example enter its ActivityInstanceId.
Ensure that in the second workflow, the Web Service Listener has its Access Mode property set to In-Process. (The Remote Server and Local Server options may also be checked if needed).
6. In the In-Process Consumer Request Bindings screen, in the Body section, define input values for the data fields. You can enter values manually, select workflow fields from the tree, or define values as the result of an expression.
7. Click Finish.
The In-Process Consumer is defined, and will call the Web Service Listener when it is reached in the flow.