Correlation Set in SOA Suite 12C

In this example, we will go through a simple example to understand the correlation set.

Suppose, an asynchronous BPEL process is initiated to raise an order item and you want to cancel the same order. Then how does BPEL process will know which order should be cancelled. Correlation set and WS-addressing will be used to identify the correct BPEL process instance. Synchronous BPEL process does not require this type of addressing. In asynchronous BPEL process, correlation set enables you to correlate the incoming messages based on property set and property alias.

When we need to interact with asynchronous BPEL service that does not support WS-addressing and when the message travels through different system which is solicited from last service directly, then we require implementing correlation set. Correlation set is used in receive, reply, invoke, on message, on event activity.

  1. Create a new SOA application and SOA project with an asynchronous BPEL process. Edit XSD and WSDL of BPEL processCorrelation_Set_1 Correlation_Set_2
  2. Now the modified WSDL will look like thisCorrelation_Set_3
  3. Select Wait activity from BPEL component and drag and drop it between receiveInput and callbackClient. Set 1 hr time for wait activity.Correlation_Set_4
  4. Add OnEvent in the BPEL processCorrelation_Set_5
  5. Double click on Onevent and editor of OnEvent will open. Select processcancellation operation of Correlation BPEL process and create one variable of CorrelationBPELProcessCancelMessage typeCorrelation_Set_6
  6. Add an Exit activity in the OnEvent block, so that after cancellation process will be aborted.Correlation_Set_7
  7. Create a correlation set in receive activity. Go to Correlations tab and click on green plus sign and browse the correlation set. Again click on green plus sign like below screenshotCorrelation_Set_8
  8. Then create property and property alias. Click on green plus sign in Create Correlation Set window and property type will be integer.Correlation_Set_9
  9. Create property alias also that will be the request message of BPEL process. Click on OK button.Correlation_Set_10
  10. Now select the newly created correlation set and initialize it.Correlation_Set_11 Correlation_Set_12
  11. Correlation set is created for receive activity. We have to select same correlation set with new property alias in event activity also. Set initiate asA�NO.Correlation_Set_13 Correlation_Set_14
  12. Save the project and deploy it in server. Test the application in EM console. Create an order by selecting operation as process and check the flow status. This flow instance will be in running status.Correlation_Set_15 Correlation_Set_16
  13. Again test this application with operation process cancellation and check the flow instance. This time flow instance will be completed, but the previous process will be still in running status.Correlation_Set_17 Correlation_Set_18
  14. Then test the process cancellation operation with the first order id. First flow instance will be aborted as we have selected exit activity in event block which will call process cancellation operation. Third flow instance will be completed.Correlation_Set_19 Correlation_Set_20

This is how the correlation set works.

Leave a Reply

Your email address will not be published. Required fields are marked *

Show my latest post here