Thursday, August 18, 2011

ADF Integration With SOA 1 - Business Events.

While working with Business Events (BEs), I faced some issues. In this blog, I am documenting whatever I did to successfully raise BEs.
I have divided this blog into 3 sections:

  1. Setup Required for BEs.
  2. Code Development.
  3. Deployment and Running the application to raise BEs.
For this example, I have used two servers:
  1. JDev's Integrated WLS (IWLS) for ADF application that raises the BE.
  2. Standalone SOA Server - Separate server where SOA application ( that will consume the BE raised by ADF app ) will be deployed.
Both the server are using my local Oracle Database for EDN. So, same EDN is shared by both the servers.
Hence, you can deploy each application on separate servers.

Setup Required for BEs.

Download and install SOA extension on JDev so that IWLS will have the libraries required for BE. Specifically, 'oracle.soa.workflow.wc'. To download SOA extension, go to Help->Check For Updates:

Do not uncheck 'Oracle Fusion Middleware Products' & 'Official Oracle Extensions and Updates', and click Next.

Select SOA extension and click Finish. Since I have already done it, so my JDev is not showing that entry now so can't add that snapshot.

The SOA extension will take some time to download. Once that is done, start the server, and in the IWLS console, you will be able to see an entry for 'oracle.soa.workflow.wc' library in the Deployments page.

Without this library, while raising BEs, you will get the following error:

<Utils> <buildFacesMessage> ADF: Adding the following JSF error message: oracle/fabric/blocks/event/BusinessEventConnectionFactory
java.lang.NoClassDefFoundError: oracle/fabric/blocks/event/BusinessEventConnectionFactory
at oracle.jbo.server.EventInvocation.raiseEvent(
at oracle.jbo.server.EntityImpl.raiseEvents(
at oracle.jbo.server.EntityImpl.afterCommit(
at oracle.jbo.server.DBTransactionImpl.doAfterCommit(
at oracle.jbo.server.DBTransactionImpl.commitInternal(
at oracle.jbo.server.DBTransactionImpl.commit(
at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(
. . .
at weblogic.servlet.internal.WebAppServletContext.securedExecute(
at weblogic.servlet.internal.WebAppServletContext.execute(
Caused by: java.lang.ClassNotFoundException: oracle.fabric.blocks.event.BusinessEventConnectionFactory
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(
at weblogic.utils.classloaders.GenericClassLoader.findClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at weblogic.utils.classloaders.GenericClassLoader.loadClass(
... 65 more

By installing SOA extenstion to JDev, we can use JDev's IWLS to raise events successfully.
Apart from this, you need to create the following two Data Sources(DSs) on IWLS:
  • EDNDataSource (XA DS )
  • EDNLocalTxDataSource (Non-XA DS)

If you don't define these DSs, you will get the following messages in JDev log while raising BEs:

INFO: Looking for BusinessEventConnectionFactory
INFO: Looking for EDN-DB JNDI configuration to create SAQRemoteBusinessEventConnectionFactory.
INFO: Unable to create SAQRemoteBusinessEventConnectionFactory: [jdbc/EDNSource or jdbc/EDNDataSource] undefined.
INFO: Looking for EDN-JMS JNDI configuration to gcreate JMSRemoteBusinessEventConnectionFactory.
INFO: Unable to create JMSRemoteBusinessEventConnectionFactory: [java:comp/UserTransaction] undefined.
INFO: Unable to create JMSRemoteBusinessEventConnectionFactory: [jms/fabric/EDNConnectionFactory] undefined.
INFO: Failed to get ConnectionFactory instance.
. . .
<JmsBusinessEventBusMessages> <warnUsingGlobalDatasourecForLocal> Local Tx Datasource not found, using XA datasource. Please update your configuration.

Once you define these DSs successfully, you wont get these messages in JDev log, and are required for successfully raising BEs.

EDNSource is not required if you define EDNDataSource. Looks like ENDSource is an old name of the driver and the new name is EDNDataSource.

In my case, SOA Server is already having these DSs, so I just replicated those DSs on IWLS.
For more details about DSs, please refer to the following forum post:

Code Development.

I have created a small application over SCOTT.EMP table to raise a BE on employee creation.

EmpEO is based on SCOTT.EMP, and added to AppModule through EmpVO. Using the Business Events section of EmpEO, I defined and published the following event:

The following is the event definition:

And here is now the event is published:

After that, I created a simple page for EmpVO, and added two buttons, one for row insertion, and second one for commit:

Then, in the weblogic-application.xml, visible in Descriptors->META-INF folder in Application Resources, I added the following entry:

This is done so that we can get access to 'oracle.fabric.blocks.event.BusinessEventConnectionFactory'.
If we straight away add 'SOA Runtime' or 'SOA Workflow' library to our model project, some how the class is not accessible, so getting this from the server itself.

Then created a small SOA application to subscribe to the event using Mediator, and writing the payload to a text file using a File Adapter:

The Mediator in the above figure points to the EmpEO.edl and EmpEO.xsd files of the previously created ADF application. The mediator passes the payload to BPEL:

And here is the transformation:

The following image shows the structure of BPEL, which transfers to payload to File Adapter:

And File Adapter writes the paylaod to a file in C:\TEMP folder:

Using the EmpEOs schema:

So, now lets run the application to raise BEs.

Deployment and Running the application to raise BEs.

Deploy the SOA application to the standalone SOA Server:

And run the ADF Application using CreateEmployee.jspx. Click 'CreateInsert' to insert a row in the table as shown below:

After entering the data, Click Commit. The BE is raised, and you can confirm by querying 'AQ$EDN_EVENT_QUEUE_TABLE' view:
If there is a consumer, like SOA app in our case, the records get vanished after a min or so, and SOA app writes the following paylaod to a text file as expected:


JDev Release


  1. Thanks Lalit for the documentation.
    Also,I would like to know how do I publish events for master detail link ,so that payload contains multiple line details for each master.

  2. Please refer to my following post for details of business events in case of compositions:

    Business Events Support In Case Of Composition Scenarios

  3. Great blog you people have maintained there, I totally appreciate the work.
    event management software

  4. I really enjoy while I read your blogs and articles.
    payday advance

  5. Your site is for sure worth bookmarking.
    Chad Kowalski

  6. Your articles don’t beat around the bushes exact t to the point.
    pork chop recipes

  7. It feels great to feature much revealing and unequalled articles on your websites. Relationships by Shchilian

  8. I would never like to fail out any chance to read out your listings.
    Learn More About Pool too You

  9. Amiable articles and the blogs really helped me a lot, thanks for the valuable information.
    Cape Seek Homepage

  10. I want more and more articles and blogs please post soon such informative information.
    online payday loans

  11. I’m thrilled I found your website and blogs. Nice guys!!!
    online payday loan lenders

  12. Your articles are more than wow! And also the best way to make understand the things mentioned in it. Cagla Yanas Tips

  13. You have done really a superb job with your web site. Marvelous stuff is here to read.
    Asum Tips And Tricks

  14. I continuously keep on coming to your site again just in case you have posted new contents.

  15. How fine of you!!!! Really awesome efforts you have shown.
    accident claims

  16. I’ve been admirer of your website because I have got the great articles here. bad credit payday loan

  17. It's been good to see your blog when I always look for such type of blogs. It’s great to discover the post here. ppi claims

  18. Great blogs buddy……… this will definitely assist me. Go to Dance Fox 24

  19. Your listing are progressing with days dungeon it up guys.
    Good Relationship With Tico Art

  20. I want to say many more thanks for providing instructive and qualitative stuff here.
    Full Sky Ico Article

  21. I conclude I have selected the smart and inconceivable website along with interesting stuff.
    full coverage auto insurance

  22. The writer understand better the mind of people what they want to learn through their writing therefore this article is outstanding. Thanks!!!
    good infographics

  23. I am confident you've got a great enthusiast following there.
    infographics design

  24. Fine method of telling, and enjoyable article to acquire factual statements. good infographics

  25. Hmm!! This blog is really cool, I’m so lucky that I have reached here and got this awesome information.
    whole life insurance prices

  26. The information in this blog is extremely useful for the people. good infographics

  27. I’m definitely coming again to see these articles and blogs.
    a1c chart

  28. That’s a nice site you people are carrying out there.
    whole life insurance quotes

  29. Your way to enlighten everything on this blog is actually pleasant, everyone manage to efficiently be familiar with it, Thanks a great car insurance

  30. I really love your write-ups guys continue the good work. auto insurance

  31. I will prefer this blog because it has much more informative stuff.
    online tutoring companies

  32. I have looked for so several posts about the blog lovers except this post is of course a nice one, keep on.
    language tutor online

  33. Amiable articles and the blogs really helped me a lot, thanks for the valuable information.
    New York medical malpractice lawyer

  34. Hi guys, when I am actually willing of reading these blog post to be updated regularly. It offers fastidious stuff.
    payday loans online

  35. Hey buddies, such a marvelous blog you have made I’m surprised to read such informative stuff.
    zip password unlocker

  36. Pretty remarkable post. I simply came across your blog and desired to say that I have really enjoyed searching your blog posts.
    online payday advance

  37. Mind-boggling job mates, I take pleasure in longing your articles.
    click here

  38. The gorgeous post learned a great deal Thanks greatly!
    piratage facebook

  39. congratulations guys, quality information you have given!!! schaumburg bars

  40. The Info in the blog is out of this world, I so want to read more. personal trainer

  41. The Info in the blog is out of this world, I so want to read more. personal trainer

  42. I have spent a lot of the time in different blogs but this is really a unique blog for me.
    buy twitter followers UK

  43. Fascinating information I haven’t been experienced such information in quite a long twitter followers UK

  44. Thumbs up guys you are really carrying out a great job.Top Level Domain

  45. Fine method of telling, and enjoyable article to acquire factual statements.
    buy twitter followers UK

  46. This text may be value everyone’s attention. How will I learn more?
    vietnam visa

  47. Your articles support me a lot in all mediums of subjects.
    central booking staten island

  48. Your contents are too straightforward to browse and easy to understand.

    queens central bookingcentral booking ny

  49. I’m so lucky that I have got this site that imparted me the high quality of information easily.

    VLC Media Player

  50. Thanks friends, for providing such enlightening data.

    filezilla client download

  51. Your articles and blogs are inspirational.
    vietnam travel

  52. I constantly emailed this site post page to all my friends, because if prefer to read it then my all friends will too.vietnam holiday

  53. Fine method of telling, and enjoyable article to acquire factual statements.vietnam travel

  54. Hurrah, that’s what I was trying to get for, just what a stuff Presented at this blog!! Thanks admin of the site. vietnam holiday

  55. Nice answers in replace of the question with real point of view and explaining about that.
    sewing kit

  56. Wonderful, just what a blog it is! This blog has provided the helpful data to us continue the good work.
    best credit repair services

  57. It’s a classic great for me to go to this blog site, it offers helpful suggestionsvietnam tour

  58. I'm certainly very happy to read this blog site posts which carries plenty of helpful data, thanks for providing such information.vietnam travel

  59. This blog post is really great; the standard stuff of the post is genuinely amazing. vietnam holiday

  60. I have never been to such type of posts before truly remarkable stuff it has..
    electrical contractors brisbane

  61. Finally I’ve found your blog, awesome way of explaining each and everything really.
    Manhattan central booking

  62. Great webpage brother I am about to notify this to all of my friends and contacts..
    New York Arraignment Lawyer

  63. Your blogs are truly awesome I have no words to praise for your blogs.
    queens central booking

  64. This comment has been removed by the author.

  65. Can you please elaborate on EDNdataSource you created above?
    is it pointing to DEV_SOA_INFRA or HR Schema?