Friday, 12 January 2018

Correlation Set Concept to Interrupt the Flow of BPEL

Hi All,

To identify the messages (requests, delayed responses) in asynchronous communication, we can use Correlation Sets.
It correlate the messages when interacting with the Asynchronous systems.

In BPEL for asynchronous communications is implemented with WS-Addressing internally to identify the partner to whom we need to send the callback using the unique id.
We can override the default implementation (WS-Addressing) , using Correlation Sets.

You can use correlation sets in invoke, receive, pick, and reply activities to indicate which correlation sets occur in the messages that are sent and received.

The values of each correlation set uniquely identify the process instance. This is true even if the process instance has already reached an end state, such as the finished state

Use Case:
In typical business systems like “Order Management”, we will place an order request and to deliver the ordered items it may take some time. Once the requested items are delivered then the order request will be closed. In mean while we can cancel the order request as well.
To cancel the order request, we will be providing the unique data provided while placing the order request.

Steps in creating Correlation Set:

1. New SOA Application--> New Project --> New Composite
2. Create an asynchronous BPEL , expose it as soap service
3. Edit the XSD according to the requirement


4. Edit the wsdl


 Composite will look like below:




5. Create Process Logic inside .bpel, add wait activity




6. Edit Recieve add correlation Set for Recieve message


Select Correlations ( Demonstrating by Creating a new Correlation Set )






 Here query Does not get generated and we are not having a declarative method to create , So Click "CTRL+Space" and drill down to OrderID







Make Initiate as YES while creating correlation Set for recieve activity


7. Add OnMessage branch , Add Terminate




8. Edit OnMessage , Edit existing correlation Set to add a property for Cancellation message






generate query ( ctrl+space --> drill down to cancellation OrderID )



Now that we have added OrderID from cancellation message, we are having 2 properties under the same Correlation Set.





9. Now as we have built our composite it will look like below:



10. Deploy, test for OrderRequest Operation






10. Test for OrderCancellation Operation ( here we try to cancel the same order placed )


 The running Process gets Terminated and the on message branch gets executed




Thus our use case is justified! 

Let's Keep exploring SOA!
- Krithika :)

Wednesday, 10 January 2018

EDN - Subscribe events

Hi,

In previous post event we have published, so the same event we are subscribing through a mediator and writing it to file adapter/db adapter.

1. Create a mediator, add published event




2. Add a file adapter, configure it for write operation.

3. Edit the mediator, to route to file Adapter




4. Create new xslt and do mapping: 



 5. edit this tags to step 6


 6. edited tags



7. Composite will look like below:


Deploy the composite, Product event published will be writted to the file.

Keep exploring Soa!
Cheers :) 

Thursday, 4 January 2018

EDN- Publish event using Mediator

Hi readers,

In my previous post we saw how to create and publish event using BPEL.

The same usecase has been used to publish event using Mediator.

Note: Event supports Mediator and BPEL components only.

So lets start,

Steps: 

1. XSD creation , Creation of EDL

2. Drop a mediator ; 1 way ; expose as soap service ; take created Process element as input


3. Composite Looks like below


4. Right click on mediator and 'add published event'


5. Composite will look like this:



Thats how we can publish event using Mediator.

In the next post we can explore on how to consume these published events in our components.

Lets explore SOA!!
Cheers! - Krithika..




EDN - Event Delivery network -Publish Event using BPEL

Hi All,

This post is on how to create edl file and Publish event from BPEL.

Scenario: Have to create a product event, Whenever the details of the products and customer are entered an event should get created.

Steps:

1. Create xsd based on requirement

2. Create Bpel process interaction type 1 way expose it as as soap service

3. Create Event Definition File:



4. Add Element from our created xsd ; Process element

5. Now click on Ok. event def file gets created.

6. We have to edit our 1 way bpel process ( double click on bepl )

7. Add Invoke edit invoke as in step 8; Then add/edit transform activity as in step 9


8. Editing Invoke


9. Add transform, Edit Transform


10. Edit xsl mapper 


11. Composite Now looks like below: Now bpel is publiching our created event: 


12. Save all and deploy composite.

Event gets published in the entire domain, It can be subscribed anywhere, : ie from within the same composite or from different composite.

Keep Exploring EDN!

Cheers.. to the next..
Let's keep exploring SOA! :)

- Krithik G