- Back to Home »
- EDN , SOA »
- Use of Event Delivery Network (EDN) : Tutorial - POProcessing
You add a new mediator component called receivePO, which subscribes to an event called NewPO and sends the received PO to the routePO service.
1. Open the POProcessing application in JDeveloper and open composite.xml, and click on the Event Definition Creation icon:
2. In the Event Definition Creation window, enter POEvents as the name of the event definition. Accept the namespace value generated.
3. Add a new event by clicking on the + icon.
4. Select the PuchaseOrder element from the po.xsd file using the chooser.
5. Enter NewPO as the name of the event and click on OK to close the Add an Event window.
6. Click on OK to complete the event definition.
7. Close the POEvents.edl panel.
8. Save all.
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.
4. Click on the + to add an event. Select the NewPO event from the Event Chooser window.
5. Click on OK to accept and create the mediator.
6. Save all.
7. Connect the receiveNewPO mediator to the routePO mediator:
8. Double-click on the receiveNewPO mediator and define a new transformation map. In the transformation-map, map the all the fields from the source to the target.
9. Close the mediator and save all.
Deploying and testing
1. Deploy the POProcessing composite to the server.
2. Browse to the EM console at http://localhost:7001/em.
3. Right-click on folder soa-infra (soa_server1) under folder SOA:
4. Click on item Business Events.
5. You should see the Business Events management page with the NewPO event listed in the Events tab.
6. Select the event and click on the Test… button to publish the event.
7. In the pop-up window, enter the following XML and click on Publish:
<PurchaseOrder xmlns="http://xmlns.oracle.com/ns/order">8. You should get a "The Event published successfully" message.
<CustID>1111</CustID>
<ID>33412</ID>
<productName>Sony Bluray DVD Player</productName>
<itemType>Electronics</itemType>
<price>350</price>
<quantity>5</quantity>
<status>Initial</status>
<ccType>Mastercard</ccType>
<ccNumber>1234-1234-1234-1234</ccNumber>
</PurchaseOrder>
9. Click on soa-infra in the navigation panel on the left to get the soa-infra dashboard.
10. Click on the POProcessing composite to view new instances. You should see an instance created for processing the event you just published. Click on the instance ID to view the flow trace.