Genpact Cora Knowledge Center

Support

In-Process Consumer Activity Overview

V9.2

Overview

In-Process Consumer activities enable you to pass complex objects between workflows, by consuming data from a Web Service Listener or an HTTP Listener. In-Process Consumer activities promote encapsulation and modularity, as they enable multiple workflows to consume the same service (Web or HTTP). The child workflow is then executed in-process, not through the HTTP protocol. 

The In-Process Consumer activity works like a standard Web Service Consumer, except that it consumes a Web Service or HTTP Listener from another workflow. 

While creating an In-process Service Consumer, you can choose from the New Listener Type drop-down the type of listener (Web Service or HTTP) you need to support the In-process consumer.

Define the In-Process Consumer activity as blocking

You can define the In-Process Consumer Activity as a blocking activity. This means that the activity will wait for a response from the target workflow. If the response is received in the same execution, the behavior is not-blocking. If not, the activity status is set to Pending, and will wait until the target workflow returns an output by executing a Web Service/HTTP activity or fault activities. 

To define the activity as blocking, in the Properties panel, under Behavior, select the Blocking check box.

Important notes

  • If you define the activity as Blocking and One Way, the activity fails to execute with the exception Invalid operation.
  • If the source process was deleted or aborted, the output activity fails to execute.
  • If the output returns the result to the parent workflow while it is in executing state, redirect is not executed.
  • If there are two outputs in the function process, the output that is executed second will fail.
  • The user that executes the output activity is the user that is defined in the Update By property for the In-Process Consumer Activity.

General Procedure

  1. Create a Web Service/HTTP Listener in workflow A.
    If you select the Blocking feature, you should also use a Web Service/HTTP Listener input and output.
  2. Create an In-Process Consumer in workflow B.
  3. Connect the In-Process Consumer in workflow B to the Web Service/HTTP Listener in workflow A.
  4. Define data field bindings.

In-process service consumer for Web Service listeners

The Web Service Listener that you need to bind with the In-process activity has its Access Mode property set to In-Process

Procedure

  1. Add an In-Process Consumer activity to the main workflow.
  2. Double-click the In-Process Consumer activity to define its properties. 
  3. Enter an activity Name, Alias and Description. Click Next.
    InProcessCons3737.png
  1. Click New.
  2. Enter a Name for the In-Process Consumer, and select a Web Service from the list of available Listeners.
    You can create or edit a Web Service Listener at Administration > Global Settings > Web Service Listeners
  3. Click OK.
  4. Do one of the following:
    • If the Listener is at the start of the second workflow:
      In the Headers > ActivityMetadataHeader > WorkflowSpaceName field, enter the Workflow Space name of the second workflow.
    • If the Listener is in the middle of the second workflow:
      In the Headers > ActivityMetadataHeader, enter a unique identifier of the listener. For example, enter its ActivityInstanceId.
  5. In the In-Process Service 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.
  6. Click Finish.

In-process service consumer for HTTP listeners

All HTTP Listeners are by default set to "Public" (that can be consumed by all), and can be bind to the In-process activities without requiring any special configuration change. 

NOTE:
In case you need to explicitly define an operation as “Private” (that can only be consumed internally), change the AccessMode for listener to 'InProcess'.

Procedure

  1. Add an In-Process Consumer activity to the main workflow.
  2. Double-click the In-Process Consumer activity to define its properties. 
    1. Enter an activity Name, Alias and Description. Click Next.
  3. Click New.
  4. Enter a Name for the In-Process Consumer, and select an HTTP from the list of available Listeners.
    You can create or edit an HTTP Listener at Administration > Global Settings > HTTP Listeners
  5. Click OK.
  6. In the In-Process Service 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.

Set the in-process activities to run unrestrictedly

You can configure whether in-process activities require permissions check, or if in-process activities run unrestrictedly. This configuration improves system performance as it reduces the number of database queries. 

In the application web.config file, under appSettings, add the following key: PNMsoft.Sequence.InProcessServiceConsumers.RunUnrestricted.

ValueDescription
TrueWhen set to true, all in-process activities run in unrestricted mode.
FalseDefault value.
In-process activities require permission checks.


NOTE:
Use this configuration only if you need to improve system performance and there aren't potential security issues involved.


Want to learn by doing? 
Check out this hands-on exercise.
Note that only internal users can access the link.


V8.7

Overview

In-Process Consumer activities enable you to pass complex objects between workflows, by consuming data from a Web Service Listener. In-Process Consumer activities promote encapsulation and modularity, as they enable multiple workflows to consume the same Web service. The child workflow is executed in-process, not through the HTTP protocol. 

The In-Process Consumer activity works like a standard Web Service Consumer, except that it consumes a Web Service Listener from another workflow. The Web Service Listener's Access Mode property needs to be configured to allow In-Process  activities to consume it.

Define the In-Process Consumer activity as blocking

You can define the In-Process Consumer Activity as a blocking activity. This means that the activity will wait for a response from the target workflow. If the response is received in the same execution, the behavior is not-blocking. If not, the activity status is set to Pending, and will wait until the target workflow returns an output by executing a web service activity or fault activities. 

To define the activity as blocking, in the Properties panel, under Behavior, select the Blocking check box.

Important notes

  • If you define the activity as Blocking and One Way, the activity fails to execute with the exception Invalid operation.
  • If the source process was deleted or aborted, the output activity fails to execute.
  • If the output returns the result to the parent workflow while it is in executing state, redirect is not executed.
  • If there are two outputs in the function process, the output that is executed second will fail.
  • The user that executes the output activity is the user that is defined in the Update By property for the In-Process Consumer Activity.

Procedure

  1. Create a Web Service Listener in workflow A.
    If you select the Blocking feature, you should also use a Web Service Listener input and output.
  2. Create an In-Process Consumer in workflow B.
  3. Connect the In-Process Consumer in workflow B to the Web Service Listener in workflow A.
  4. Define data field bindings.

Example

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.

Prerequisite

  • The Web Service Listener that you need to bind with the In-process activity has its Access Mode property set to In-Process

Procedure

  1. Add an In-Process Consumer activity to the main workflow.
  2. Double-click the In-Process Consumer activity to define its properties. 
    1. Enter an activity Name, Alias and Description. Click Next. InProcessCons3737.png
  1. Click New.
  2. 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 Web Service Listener at Administration > Global Settings > Web Service Listener table
  3. Click OK.
  4. Do one of the following:
    • If the Web Service Listener is at the start of the second workflow:
      In the Headers > ActivityMetadataHeader > 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 > ActivityMetadataHeader, enter a unique identifier of the listener. For example, enter its ActivityInstanceId.
  5. 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.
  6. Click Finish.

Set the in-process activities to run unrestrictedly

You can configure whether in-process activities require permissions checks, or if in-process activities run unrestrictedly. This configuration improves system performance as it reduces the number of database queries. 

In the application web.config file, under appSettings, add the following key: PNMsoft.Sequence.InProcessServiceConsumers.RunUnrestricted.

ValueDescription
TrueWhen set to true, all in-process activities run in unrestricted mode.
FalseDefault value.
In-process activities require permission checks.


NOTE
Use this configuration only if you need to improve system performance and there aren't potential security issues involved.


V8.4 - V8.6

Context

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.

Define the In-Process Consumer Activity as Blocking

You can define the In-Process Consumer Activity as a blocking activity. This means that the activity will wait for a response from the target workflow. If the response is received in the same execution, the behavior is not-blocking. If not, the activity status is set to Pending, and will wait until the target workflow returns an output by executing a web service activity or fault activities. To define the activity as blocking, select the Blocking check box in the Properties panel.

Important Notes

  • If you define the activity as Blocking and One Way, the activity fails to execute with the exception Invalid operation.
  • If the source process was deleted or aborted, the output activity fails to execute.
  • If the output returns the result to the parent workflow while it is in executing state, redirect is not executed.
  • If there are two outputs in the function process, the output that is executed second will fail.
  • The user that executes the output activity is the user that is defined in the Update By property for the In-Process Consumer Activity.

We'll walk you through an example to help understand how to set up and execute the In-Process Consumer.

Steps

  1. Create a Web Service Listener in workflow A. (If you select the Blocking feature, you should also use a Web Service Listener input and output)
  2. Create an In-Process Consumer in workflow B.
  3. Connect the In-Process Consumer in workflow B to the Web Service Listener in workflow A.
  4. Define data field bindings.

Example

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.

InProcessConsume345.png

2. Double-click the In-Process Consumer to define its properties. Provide an activity Name, Alias and Description. Click Next

InProcessCons3737.png

3. Click New. The In-Process Consumer Details screen appears.

ProcCons67676a.png

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.

InProcessConsumer29292.png

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.

CreditScore7777.png

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).

CreditScore WebserviceAA.png

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.

ProcConsm888444a.png

7. Click Finish.

V8.3 and earlier

Context

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.

Important Notes

  • If the source process was deleted or aborted, the output activity fails to execute.
  • If the output returns the result to the parent workflow while it is in executing state, redirect is not executed.
  • If there are two outputs in the function process, the output that is executed second will fail.
  • The user that executes the output activity is the user that is defined in the Update By property for the In-Process Consumer Activity.

Steps

  1. Create a Web Service Listener in workflow A.
  2. Create an In-Process Consumer in workflow B.
  3. Connect the In-Process Consumer in workflow B to the Web Service Listener in workflow A.
  4. Define data field bindings.

Example

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.

InProcessConsume345.png

2. Double-click the In-Process Consumer to define its properties. Provide an activity Name, Alias and Description. Click Next

InProcessCons3737.png

3. Click New. The In-Process Consumer Details screen appears.

ProcCons67676a.png

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.

InProcessConsumer29292.png

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.

CreditScore7777.png

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).

CreditScore WebserviceAA.png

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.

ProcConsm888444a.png

7. Click Finish

The In-Process Consumer is defined, and will call the Web Service Listener when it is reached in the flow.