In case of 11i and R12, we used to raise the business events using
1. WF_EVENT.RAISE API from PL/SQL Layer
OR
2.oracle.apps.fnd.wf.BusinessEvent.raise from Java/OAF Layer.
In Fusion Apps, we can raise business events from the BC4J layer as well, for example Entity Objects in ADF model layer. To do something similar in R12 you will have to write a piece of java code as shown in appendix of this article. However Fusion Apps provides a configurable solution for raising the event.
These business events can be picked up by the SOA Layer. Of course you will need a SOA project in place, with a SOA component named mediator that can listen to your business events. The mediator needs to be configured to listen to the specific business events of interest. After the event is identified, mediator can route the flow for further downstream processing in SOA, typically using a BPEL process component.
Alongside the name of the Business Event and the conditions, you can raise payload for the business event that will be available as parameter to the SOA Layer.
The image below shows Entity Object, which has a tab for Business Events.
You can publish the event when certain conditions are true.
Now that the event will be published under certain conditions, it needs to be processed in the SOA layer. For this a SOA SCA project will have to be developed and a mediator component will be defined. Within the mediator component, we can specific the name of the event that must be consumed. Effectively this creates a listener within the SOA layer to the business event that is raised in Fusion ADF layer. Once the mediator consumes the event, further downstream actions can take place for example some BPEL flow.
Follow the steps below to create a mediator component, in order to subscribe to a business event:
1. Using the file system, copy the XSD and event definition files for the business event into your SCA project's source path.
2. In the Application Navigator, right-click the project, and choose New.
3. In the New Gallery, expand SOA Tier, select Service Components and then Mediator, and click OK.
4. In the Create Mediator dialog, select the Subscribe to Events template. In the create Mediator dialog, Subscribe to Event of your choice
5. Click the Add icon to add an event.
6. In the Event Chooser dialog, click the Browse icon to navigate to and select the event's definition file, and then click OK.
.
7. Click OK to generate the mediator.
8. The resulting mediator (.mplan file) will be displayed, and then you can click the Add icon in the Routing Rules section to add a rule for how to respond to the event
Appendix code
Back to R12 world, for raising Business Event in R12.1 onwards from OAF is shown as below.
From the BC4J layer, an event can be raised using a code similar to below
String eventName = "xxa2f.oracle.apps.hr.employee.invoke.changeEvent";
String eventKey = "EmployeeKey";
Connection conn = ((OADBTransactionImpl)getOADBTransaction()).getJdbcConnection();
BusinessEvent event = null;
try{
event = new BusinessEvent(eventName, eventKey);
event.setData(employeeEventData);
event.raise(conn);
}
catch (BusinessEventException e) {
throw new OAException("Exception occured when invoking web service - "+e.getMessage());
} finally {
getOADBTransaction().commit();
}
String respData = (String)event.getResponseData();
return respData;
Comments
(1)








Nobody can take away your pain, so don’t let anyone take away your happiness.?