Thursday, September 24, 2020

Correlation in BPM

 Correlation: Identifying the Correct Instance of a Process

• In an asynchronous conversation, messages can be automatically correlated by using WS-Addressing:  

è When they share a conversation

è Where the target conversation is easily identified 

è When the target conversation does not initiate yet another conversation during the original conversation

• When WS-Addressing does not apply, use message-based correlation. It:

è Identifies an instance by mapping instance data (the instance state) to a correlation key

è Is similar to using a primary key in a database table

è Can contain one or more properties

What is Correlation?

  è When two BPM process communicate with each other to exchange messages then Business have to Make sure that correct response is received by calling instance Is called Correlation

  è Business process typically can run for days or even months, which require asynchronous communication via a message.

  è Correlations enable business processes to communicate with each other based on the state of an instance. 

  è You can use the correlation sets to identify asynchronous messages to ensure that asynchronous callback locate the appropriate client.

  è The concept of correlation is used with conversation with messages to a Send Task or Receive Task.

  è Correlation can be used in BPM and in BPEL both. 

Use Cases Where Correlation Applies

• Handling message events inside an event subprocess

• Participating processes have conversations after they have both started (in the middle of the process).

• A participant (client) does not support WS-Addressing.

     Correlation Keys

  Ø  The idea is to use a joint conversation which is used outgoing and incoming messages.

  Ø  One or more key used to identify a conversation

  Ø  A Correlation Key represents a composite key.

  Ø  When you define a correlation key you provide a name to identify it.

  Ø  Any message that is sent or received will carry the value of at least one of Correlation key instance within its payload.

     Correlation Properties

     Properties are abstractions for very representative attributes in the process, like the order ID, the customer name or the social security number. Properties contain a name to identify the attribute and a data type. Properties only support basic data types.

     Correlation properties must be unique

     S1.How to Create a Correlation Key

You can create a correlation key at a project level and later use that correlation key to define the correlations of your flow objects.

To create a correlation key:

1.       Select a business process in jdeveloper.

2.       Open the Structure view.

3.       Expand the Correlations node in the Structure view.

4.       Right-click the Correlations Keys node.

5.       Select New.

6.       The Create Correlation Key dialog appears.

S2:How to Configure a Correlation Key

You can configure the properties that compose the correlation keys you define.

To configure a correlation key:

1.       Enter the correlation name.

2.       If the Correlation Properties list is empty or the property that you want to use for your correlation is not defined, you must define a new correlation property. To define a correlation property:

a.       Click the New button.

b.      The Create Correlation Property dialog appears.

c.       Enter a name for the correlation property.

d.      Select a type.

Available types are: String, Int, Real, Decimal, Bool, Time.

e.       Click OK.

3.    Select the correlation properties that define the correlation:

a.    From the Correlation Properties list, select the property you want to include in the correlation.

b.    Click the Select button.

The selected property appear in the selected list.

4.    Click OK.

S3: Go to BPMN Process and initiate the correlation

1.    Go to start message type -> Implementation -> correlation

2.    Correlation Defination

o   Select property

o   Select element from data object on which we define unique Token.

o   Check initiates which means correlation is initiated

S4: On catch Event we will call correlation to match the correlation id

Here unchecked the initiate because we want to use the correlation key 

which was initiated at on message start event.  ->Ok 


Note

The Signal Catch Event is exactly same as Signal Start event. 

The only difference is that a Signal Catch event is used to subscribe to events in between a running process  while a signal Start event is used to initialize a process.


No comments:

Post a Comment

SOA Overview Part-1

  Middleware It provides a mechanism for the process to interact with other processes running on multiple network machines. Advantages...