Saturday, August 22, 2009

Business Events and ADF Business Components in Oracle Fusion 11g

I continue a series of posts, where I'm describing Oracle SOA Suite 11g and JDeveloper 11g functionality. Before reading this post, you might be interested to read my previous posts - Web Service Interface for ADF BC Application Module in Oracle Fusion 11g and Service-Enabled Entity Objects in Oracle Fusion 11g. My today post sample application is based on mentioned blog posts.

Business Events and Event Delivery Network (EDN), its something that makes Oracle SOA Suite 11g really strong integration platform. While discussing with customers, usually everyone is seriously concerned about loosely coupled integration, no one wants to integrate IT systems with strongly coupled services. Thats logical, because there are different systems and those systems constantly changing. Oracle SOA Suite 11g allows to implement loosely coupled integrations with Business Events. You can understand Business Event as a signal, that was sent by radio transmitter. Transmitter knows nothing about receivers, its receivers business to subscribe to particular event. Oracle SOA Suite 11g brings Event Delivery Network (EDN), space where Business Events can be raised and received across SOA infrastructure. Business Events in SOA Suite 11g can be raised not only from ADF Business Components, but from BPEL process for example as well.

Today I will use both applications from my previous posts mentioned above. I will add Business Event to application described in Service-Enabled Entity Objects in Oracle Fusion 11g post, you can download updated sample - Additionally for today post I have implemented SOA Composite where I'm subscribing to Business Event raised from ADF Business Components - You can find more info about Business Events and EDN in Oracle SOA 11g Developer Guide Section 44 Using Business Events and Event Delivery Network, also check Edwin Biemond post - Events in ADF BC and handled by the SOA Suite Mediator.

Good news - we can declare Business Events on Service-Enabled Entity Objects, it works same as declared on normal Entity Object. Here is declaration:

In Business Event definition I have specified to track Salary attribute value changes. Along with changed Salary attribute value, I want to add to the payload EmployeeId attribute value. Event is published and will be raised during Update action based on Salary attribute change.

Thats all about Business Event definition in ADF Business Components, now I will develop SOA Composite where I will subscribe to Business Event. Implemented SOA Composite:

SOA Composite contains two Components (Mediator and BPEL process) and one External Reference (File Adapter):

Mediator subscribes to Business Event, and forwards it to BPEL process, where Business Event data is written to file system. In this post I'm focusing on Business Events from ADF Business Components, in my next post I will focus on BPEL process implementation. Mediator receives Business Event, BPEL process will manage it, this means Business Event schema transformation should be defined:

Schema transformation can be done automatically in JDeveloper 11g:

Basic BPEL process for today post, received Business Event data is stored in file system using File Adapter:

File adopter is defined with the same WSDL as BPEL process, means it will know Business Event input data format and will store information in C:/tmp folder:

I have deployed both applications (ADF application and SOA Composite) to Oracle SOA Suite 11g WebLogic server and opened ADF Application screen:

Data is retrieved through Service-Enabled Entity Object from Web Service. I will change Salary value and press Save button to update Salary attribute value:

Business Event was raised from ADF Business Components, subscribed Mediator from SOA Composite received it and forwarded to BPEL process where data was written to file system:

You can see that we received Employee Id and changed Salary attribute values.

Let's see process flow in Oracle Enterprise Manage Web console for Oracle SOA Suite 11g. We can see there log for all SOA Composite - SalaryUpdateComposite instances:

If I click on latest instance, I will get its trace log:

You can click on SalaryManagementProcess and open visual process flow:

And finally if you click on InvokeSalaryChangeLog BPEL Invoke activity, as well you will see there data from Business Event:

Spanish Summary:

Este post muestra una carateristica de integraciĆ³n entre Jdeveloper 11g and SOA Suite. En esta oportunidad se muestra el uso de los Business Events, para intercambiar y almacenar informaciĆ³n de los salarios de los empleado usando SOA y los ADF Entity Objects.


Anonymous said...

Andrejus - If you have an ADF-BC based Task flow that publishes a business event deployed on one weblogic domain (WC_Portal or WC_Spaces for example) and if the SOA server with the mediator subscribed to this same business event is on a different weblogic domain, how does the business event created by the ADF-BC component get transmitted across weblogic domains? Does it mean the EDN data source (jdbc/EDNDataSource) must be the same between the two domains?

Thanks - Vikram Bailur

Anonymous said...

Any answers to question?

Andrej Baranovskij said...

This would require investigation, no immediate answer.