F. Handling Business Events Using EDN
F. Handling Business Events Using EDN
F.1. Introduction
Note: The solution for this chapter can be found in
~/SOA11gFoundationTutorial/
SOA11gFoundationTutorial/po/solutions/apF-EDN
To run this solution, you must have completed labs through chapter 9.
Alternatively, you can run the setup in Chapter 1 and use the solution from
Chapter 9 located at ~/SOA11gFoundationTutorial/
SOA11gFoundationTutorial/po/solutions/ch9-JMSAdapter.
This lab exercise will give you a brief introduction to using Event-Driven
Network (EDN) in a SOA composite for creating event-based activation.
EDN provides functionality for producing and consuming high-level business
events without having to configure and manage any messaging services like JMS
or Oracle AQ.
To illustrate the usage of events, you will modify the existing POProcessing
composite to accept new orders from a second source: an event published by
another application indicating a new order.
3. In the Event Definition Creation window, enter POEvents as the name of the
event definition. Accept the namespace value that is generated.
4. Add a new event by clicking on the + icon.
5. Select the PuchaseOrder element from the po.xsd file using the chooser.
6. Enter NewPO as the name of the event and click on OK to close the Add an
Event window.
7. Click OK to complete the event definition. This closes the Event Definition
Creation window.
8. Save All.
9. Close the POEvents.edl tabbed panel.
4. Click on the + to add an event. Select the NewPO event from the Event Chooser
window.
5. Click OK on the Event Chooser dialog and click OK again to accept and create
the mediator. Notice that the new receiveNewPO mediator appears on the
composite.xml and that it has an event icon (lightning bolt) on its left side.
6. Save All.
7. Use gedit to edit publish.sh and make sure the first line reads: #!/bin/bash and
search for all the occurrences of :: and change them to : (replace double colons
with a single colon).
8. Use vi (so you can see special characters) to edit publish.sh and eliminate all the
^M characters at the end of the lines.
9. From the ~/SOA11gFoundationTutorial/SOA11gFoundationTutorial/po/bin
directory, run the publish.sh script to publish a new purchase order event. The
new event is defined in the file new_po_event.xml and can be found in the
~/SOA11gFoundationTutorial/SOA11gFoundationTutorial/po/input directory.
./publish.sh ../input/new_po_event.xml
10. You should see the following output when you execute the command: