ONe of the important feature that is added in SOA Suite 11g is Event Delivery Network(EDN).
It provide a public subscribe model to publish an event and then let others subscribe it.Publishing an event means sending an alert on some specific action and subscribing to event is like doing needful action for the alert.
We will create a simple process and try to understand how does it work.
Pre requisite
SOA Suite 11g
Jdeveloper 11g
===========================================
Open up a jdeveloper and create a new application.
Now just drag and drop an assign activity in the bpel process and copy the input to the output as shown
so now your bpel process should look like this
Now go to your composite and click on event field as shown in the diagram.
A gui will open up like this select the event option
Add the element for which you wanted to raise an event.
Choose element and choose the input xsd file and choose the process input.We have chosen the input file here which mean as soon as we will provide an input to our bpel process an event will be raised.
Just keep saying ok and you will get a .edl file getting automatically created for you.
Now drag and drop an mediator component in the composite
Click on the plus sign and select the even that you have created just now so it should luk like
NOw we will drag and drop a file adapter to write file to a directory.
Our purpose here is to create an event and the one who subscribe the event should write a file.That is the bpel process will create an event ,Mediator will subscribe to that event and will cause file adapter to write file in to a directory.
Now click on search button in the next tab and choose the xsd for the output
Say Finish and now click on mediator component and drag and drop it to the file adapter to make a connection betwee them so now your composite should look something like this.
Now you need to map .Double click on mediator component and create a new transformation.And map the input field to output as shown below.
Save all and now you are ready to go.Depoly the project
and invoke it in the em console.http://localhost:port/em
Once the instance is create you select the soa-infra component right click on it and select business event as shown below
now choose the event created for the process
NOw say test and provide the xml input
as shown below
Click on publish and it will show the document as published as soon as document is published we have a subsciber which will write the output file created in the output directory.
Verify whether the output file is created or not.For me it is created.This is just a example you can have multiple subscriber and you can have any business logic ,this exercise is just to make you aware of the new concept EDN.
Let me know if any queries on the same.
This is perhaps not a very good sample so i have come up with two other samples which you can use in your scenario.
One is using BPEL publisher and a BPEL subscriber
another is using mediator as a publisher and mediator as a subscriber as shown
YOu can download these two project from these location
mediator
bpel
No comments:
Post a Comment