0% found this document useful (0 votes)
61 views5 pages

F. Handling Business Events Using EDN

The document describes how to modify a SOA composite application called POProcessing to consume purchase order events using Oracle's Event-Driven Network (EDN). Specifically, it explains how to define a new purchase order event, subscribe a mediator component to that event, deploy the updated composite, and test by publishing a sample purchase order event which should trigger instance creation in the composite.

Uploaded by

vinchooo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views5 pages

F. Handling Business Events Using EDN

The document describes how to modify a SOA composite application called POProcessing to consume purchase order events using Oracle's Event-Driven Network (EDN). Specifically, it explains how to define a new purchase order event, subscribe a mediator component to that event, deploy the updated composite, and test by publishing a sample purchase order event which should trigger instance creation in the composite.

Uploaded by

vinchooo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

End-2-end-105-PO-Processing

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.

F.2. Modifying the composite to consume events


In this step you will modify the POProcessing composite to use EDN. You will
add a new mediator component called receiveNewPO that will subscribe to an
event called NewPO and send the received PO to the routePO service.

F.2.1. Defining the event


1. Open the POProcessing application in JDeveloper or use the completed solution
from Chapter 9 from ~/SOA11gFoundationTutorial/
SOA11gFoundationTutorial/po/solutions/ch9-JMSAdapter.
2. Open the composite.xml and click on the Event Definition Creation icon

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.

Section F.1 Handling Business Events using EDN F-1


End-2-end-105-PO-Processing

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.

F.2.2.Subscribing to the NewPO Event


1. Drag and drop a Mediator component onto the composite.
2. Name the mediator: receiveNewPO
3. Select Subscribe to Events for the Template

F-2 Handling Business Events using EDN Section F.2.2


End-2-end-105-PO-Processing

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.

Section F.2.2 Handling Business Events using EDN F-3


End-2-end-105-PO-Processing

7. Connect the receiveNewPO mediator to the routePO mediator:

8. Double-click on the recieveNewPO mediator and define a new transformation


map. In the transformation, create a new mapper file and map the all the fields
from the source to the target.
9. Save All and close the mapper file and mediator tabbed panels.

F.2.3. Deploying and testing


1. Deploy the POProcessing composite to the server.
2. Start a terminal window and change the working directory to:
~/SOA11gFoundationTutorial/SOA11gFoundationTutorial/po/bin.
3. Open the publish.sh file in the gedit editor (gedit publish.sh) and ensure that the
following values are correct:
- DB_USER=sh_soainfra
- DB_PASSWORD=welcome1
- DB_CONN=localhost:1521:XE
4. Make sure your Java bin directory is first on the path so you use the right version
of Java. Enter the following in your terminal window:
export PATH=$JAVA_HOME/bin:$PATH
5. Change the permissions for the publish.sh script by entering this command in
the terminal window: chmod a+x publish.sh
6. In your terminal window, set your ORACLE_HOME environment variable:
export ORACLE_HOME=/home/oracle/Middleware/Oracle_SOA1

F-4 Handling Business Events using EDN Section F.2.3


End-2-end-105-PO-Processing

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:

11. Open the EM Console in your browser by navigating to


http://localhost:7001/em. Click on the POProcessing composite to view
new instances. You should see an instance created for processing the event you
just published via the command line. Click on the instance ID to view the flow
trace.

Section F.2.3 Handling Business Events using EDN F-5

You might also like