Print PRINT
PDF

Step by step webMethods Correlation Concepts in BPM

Correlation:

  • 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
  1. 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.
  2. 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.

Specifying Correlations

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

  1. In the process editor, select a receive step.
  2. 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.

 

Comments (2)Add Comment
wMDevloper
...
written by wMDevloper, September 19, 2013
Hi Abhijith,

May i know your using which version of webMethods.

Here I used webMethods 8.0
And lil bit differences to implement correlation concept in this two version.
but the basic concept of the correlation is like... Correlation is used to allow external documents to join running process instances. Each step that receives input can use a correlation.

3) When will correlation come into picture and what is the exact use of this? Can you explain a real time scenario?

For example:

We have requirement like an application sale an Aircraft with some guarantee period n maintenance period.
And if Aircraft is not in maintenance period then only its work in normal flow otherwise go in maintenance flow.
So for this we prepare two document one for Normal flow NF document and second for maintenance flow MF document.
NF and MF document have some different data or field about Aircraft.but in both document have Aircraft ID field for correlation ID declaration.

so now process will start with NF document after some steps a condition we checked “Aircraft is in Aircraft period or not” suppose
NO: then go ahead with same document a execute process and completed.
In case of Yes: then correlation in cum in picture because we want proceed process with the document MF then here step check the correlation id if the Aircraft ID same then allow to second receive step to proceed MF document and then process will complete.
Like this we have lots of scenario when we have to use correlation concept some time on any failure cases. Some its depend on results its depend etc…


1) what does the CorrelationTest document contain which is used in Correlation_Services.

In Correlation Test document you can put any field with the correlation field. Like if u make Transaction ID as a Correlation ID then it should be presence in all your input doc which using in same process apart from correlation ID Field you can put any field in the document as per project requirement.

2) Where is the Correlation_Services flow service is called in the process.

Open your Process in Process Development perspective -> select recive step -> receive step properties -> Correlation ->services ->Browse
Here u can select any service. Like correlation_service or Test_Correlation or any which you written for correlation.

I hope this will clear your some doubts. smilies/smiley.gif
Abhijith
...
written by Abhijith, September 12, 2013
Hi Thanks for the detailed information .. i have few quries like
1) what does the CorrelationTest document contain which is used in Correlation_Services.
2) Where is the Correlation_Services flow service is called in the process.
3) When will correlation come into picture and what is the exact use of this? Can you explain a real time scenario?

Forgive me if the questions are Lame smilies/sad.gif as am a novice to BPM smilies/cheesy.gif

Write comment
You must be logged in to post a comment. Please register if you do not have an account yet.

busy