SOA Suite 11g – Event Delivery Network – How to correlate one event into multiple instances of the same composite (BPEL or BPM)?

Lucas Jellema 2
0 0
Read Time:2 Minute, 24 Second

The use case is very straightforward: we have a SOA & BPM Composite Application for the Order process. Whenever a customer places an order, a new instance of this process kicks off. At any one time we will potentially have multiple instances for orders from the same customer. These instances are uniquely identified by the order id.

It happens that the F&A department – because of for example financial difficulties with a certain customer or government regulations regarding certain countries – publishes an event: “Terminate Customer”. This event should result in having all running Orders for that Customer being terminated.

The challenge is that although BPEL and starting with 11gR1PS4 Feature Pack also BPM can correlate events into running instances, this correlation has to be based on a unique instance identifier – unique across all instances of the process or composite. We cannot have the ‘Terminate Customer’ event consumed into all instances of the Order process. Well, not out of the box at least.

Inspired by yesterday’s BPM Customary Advisory Board session where we were in close contact with developer and product managers for BPM as well as several other parties implementing BPM using Oracle’s product, I came up with the following approach. I have not yet tested it, but feels as if it will work.

The starting situation:

Image

Customer A has placed several orders. Each order has resulted in a running Composite instance. The instances are identified by their order id (correlation key) and have exposed a composite sensor with the Customer Identifier.

When the Customer gets terminated, the ‘terminate customer’ event is published to EDN with the customer identifier (A) in its payload. This event should end up in all running Order Process instances with sensor value A. However, correlation into running instances only works based on unique correlation key – which is the Order identifier.

Image

My thinking is that we could adopt the following approach:

Create a new composite application that consumes events on behalf of running Order instances. It subscribes to the Terminate Customer event (and potentially to other Order related events as well). The Mediator that consumes the event, passes the payload – the customer identifier – onwards to Spring Bean component. This component uses the SOA Suite APIs to retrieve all instances of the Order Process that expose the event’s customer id payload (A) as their ‘Customer Id’ Composite Sensor. Each of these instances also expose their unique identifier (== correlation key == order id).

All order identifiers thus collected are handed of to a Mediator to publish events for: for every order identifier, a ‘abort order’ event is published with the order id as its payload:

Image

Now the Abort Order events need to be consumed by only single running instance – based on correlation with the order id.

Here once again the overview of the entire inner workings. I would be interested in any feedback you may have to offer:

Image

About Post Author

Lucas Jellema

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

2 thoughts on “SOA Suite 11g – Event Delivery Network – How to correlate one event into multiple instances of the same composite (BPEL or BPM)?

  1. Hi Sridhar, nice article you have written! I have posted a comment, suggesting you use an event handler in the BPEL process to asynchronously process the EDN event. Other than that – your implementation is fine.

    Well done.

    kind regards,

    Lucas

Comments are closed.

Next Post

OGh bijeenkomst 4 oktober

Afgelopen dinsdag 4 oktober waren Andre van Winssen en ik de aangewezen personen om een presentatie bij de OGh te verzorgen. Andre vertelde in ongeveer een uur het een en ander over Application Contexts en het gebruik van DBMS Crypto. Een deel uit de masterclass die hij bij AMIS verzorgt. […]
%d bloggers like this: