Step by step webMethods Correlation Concepts in BPM
- Correlation allows correlating an incoming document to an already running process instances.
- Based on matching correlation ID.
- Correlation ID value identified by Receive step using either
- Correlation field: Correlation-ID is already contained in input document. By specifying a field in an incoming document to serve as a correlation field when configuring a receive step.
- Correlation service: Using incoming document and computes Correlation-ID. By creating a correlation service in webMethods Developer and associating it with a receive step.
Correlation are used to allow external documents to join running process Instances. Some important points like
- Each receive step that can start a new process instance has a Correlation property.
- At least one receive step in a process must be choose as a Allow this step to start new process instance (a start step). This is set on the General page in the receive stepâs Properties view.
Receive steps that start a new process instance should initiate a correlation. Receive steps that do not start a new process instance should look up a correlation ID or service. In both cases, you specify the correlation on the Correlation page in the Properties view of a receive step.
To specify a correlation
- In the process editor, select a receive step.
- On the Correlation page in the Properties view, do one of the following:
- Select Not Used to specify no correlation service.
- Select Field to specify a field from the subscription document as the correlation ID. Expand the list to see available fields from which you can select.
- Select Browse... to open the Choose Service window
- Select Browse... to open the Choose Service window and locate a service on an
Integration Server or in metadata.
- Select New... to open the New Flow Service window and create a new service on a configured Integration Server.
- Select View... to open the selected service in the flow service editor.
About Correlation Fields
Process Engine provide facility you to specify a correlation field to apply correlation on a receive step, the specified field exists in the receive document and perform as the correlation identifier.
In this case, Instead of executing a service, the Process Engine retrieves the specified correlation field from the input document and uses it as the correlation identifier.
About Correlation Services
You can create a correlation service in webMethods Developer as a flow service, using the pub.prt.CorrelationService specification. The correlation service identifies specifically named IS documents and routes them to a specific running instance of the process model.
correlation IDs must be unique across all process instances.
In addition, the following related services are available in WMPRT packages:
- pub.prt.correlate:deleteCorrelationâDeletes all mappings between the specified process instance ID and any correlation IDs or conversation IDs.
- pub.prt.correlate:establishCorrelationâSets up a correlation between a correlation ID and a process ID or between a conversation ID (for a Trading Networks document) and a process ID.
- pub.prt.correlate:lookupCorrelationâReturns the process instance ID that is associated with the specified correlation ID or conversation ID. If no association exists, creates a new process instance ID and mapping.
Coorrelation services inputs and output fields which is needs to be give at the time of service creation.
Creating Correlation Services
Correlation services are written in webMethods Developer or in the service development editor in Designer, and establish or match the correlation ID used by a process instance.
You build logic into your custom correlation services to determine correlation IDs based on incoming data, and use WmPRT services to store or match these IDs.
Below are the input and output variables you can use when creating your correlation services.When your correlation service receives control, it is passes the following inputs:
ProcessModelID : String ID of the process model with which this invocation of the correlation service is involved.
ProcessModelVersion : String Version of the process model with which this invocation of the correlation service is involved.
LogicalServer : String the name of the logical server on which this correlation service is running. Because a single correlation service can be used with steps that execute on different servers, you can use Logical Server to identify a specific server at run time.
ProcessStepID :String ID of the step in the process model version with which this invocation of the correlation service is involved.
DocumentName: String Name of this document as used in the process model
DocumentType : String Name of this document type
Document : Document The document.
ProcessCorrelationID : String Conditional. An abstract ID that correlates to the actual
process instance ID of the running process.
CorrelateAsTN: String Conditional. Flag that indicates whether the correlation ID in ProcessCorrelationID is a conversation ID.
Tracking Correlation IDs
The Process Engine tracks correlation IDs based on your configuration and tuning settings:
Tracking Correlation IDs with Volatile Tracking
The Process Engine stores correlation IDs in server RAM. Each correlation ID is associated with the process instance ID for a running process.
When the Process Engine receives an external document for a process that uses a correlation ID, the Process Engine runs the correlation service for the appropriate step and compares the correlation ID to the correlation IDs in server RAM.
- If the ID matches an ID for a running process, the Process Engine loads the external document content into server RAM and the server executes the step as part of the running process.
- If the ID does not match an ID for a running process, the Process Engine creates a process instance ID, stores the process instance ID and the correlation ID in server RAM, and starts a new process.
In case of Volatile Tracking Disabled, this work same as above only difference is Process Engine stores correlation IDs in WMPRTXREF table in the Process Engine database component instead of server RAM.
Correlation Behavior with Intermediate Receive Steps
In some cases, a document arrives at an intermediate receive step and the Process Engine executes a correlation based on a field or service, but the document cannot be correlated. In this situation, the Process Engine retains the document but generates an exception that causes the trigger to determine what to do with the document.
The available options are:
- Suspend the trigger after the specified trigger retries are exhausted.
- Discard the document after the specified trigger retries are exhausted.
These are standard trigger options. It is the trigger properties that control this retry behavior. This applies only to intermediate receive steps.