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:
- Setup Required for BEs.
- Code Development.
- Deployment and Running the application to raise BEs.
For this example, I have used two servers:
- JDev's Integrated WLS (IWLS) for ADF application that raises the BE.
- 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(EventInvocation.java:513)
at oracle.jbo.server.EntityImpl.raiseEvents(EntityImpl.java:7724)
at oracle.jbo.server.EntityImpl.afterCommit(EntityImpl.java:7329)
at oracle.jbo.server.DBTransactionImpl.doAfterCommit(DBTransactionImpl.java:2285)
at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2176)
at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2369)
at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1608)
. . .
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused by: java.lang.ClassNotFoundException: oracle.fabric.blocks.event.BusinessEventConnectionFactory
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
... 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:
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:
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:
Thanks Lalit for the documentation.
ReplyDeleteAlso,I would like to know how do I publish events for master detail link ,so that payload contains multiple line details for each master.
Please refer to my following post for details of business events in case of compositions:
ReplyDeleteBusiness Events Support In Case Of Composition Scenarios
Great blog you people have maintained there, I totally appreciate the work.
ReplyDeleteevent management software
I really enjoy while I read your blogs and articles.
ReplyDeletepayday advance
Your site is for sure worth bookmarking.
ReplyDeleteChad Kowalski
You guys out there are performing a great job.
ReplyDeletedui penalties by state
Your articles don’t beat around the bushes exact t to the point.
ReplyDeletepork chop recipes
It feels great to feature much revealing and unequalled articles on your websites. Relationships by Shchilian
ReplyDeleteI would never like to fail out any chance to read out your listings.
ReplyDeleteLearn More About Pool too You
Amiable articles and the blogs really helped me a lot, thanks for the valuable information.
ReplyDeleteCape Seek Homepage
I want more and more articles and blogs please post soon such informative information.
ReplyDeleteonline payday loans
I’m thrilled I found your website and blogs. Nice guys!!!
ReplyDeleteonline payday loan lenders
Your articles are more than wow! And also the best way to make understand the things mentioned in it. Cagla Yanas Tips
ReplyDeleteYou have done really a superb job with your web site. Marvelous stuff is here to read.
ReplyDeleteAsum Tips And Tricks
I continuously keep on coming to your site again just in case you have posted new contents.
ReplyDeleteppi
How fine of you!!!! Really awesome efforts you have shown.
ReplyDeleteaccident claims
I’ve been admirer of your website because I have got the great articles here. bad credit payday loan
ReplyDeleteIt'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
ReplyDeleteGreat blogs buddy……… this will definitely assist me. Go to Dance Fox 24
ReplyDeleteYour listing are progressing with days dungeon it up guys.
ReplyDeleteGood Relationship With Tico Art
I want to say many more thanks for providing instructive and qualitative stuff here.
ReplyDeleteFull Sky Ico Article
I conclude I have selected the smart and inconceivable website along with interesting stuff.
ReplyDeletefull coverage auto insurance
The writer understand better the mind of people what they want to learn through their writing therefore this article is outstanding. Thanks!!!
ReplyDeletegood infographics
I am confident you've got a great enthusiast following there.
ReplyDeleteinfographics design
My hat is off to you!! social media infographics
ReplyDeleteFine method of telling, and enjoyable article to acquire factual statements. good infographics
ReplyDeleteThis blog has very distinct features. Thanks
ReplyDeletepayday loans washington
Hmm!! This blog is really cool, I’m so lucky that I have reached here and got this awesome information.
ReplyDeletewhole life insurance prices
The information in this blog is extremely useful for the people. good infographics
ReplyDeleteI’m definitely coming again to see these articles and blogs.
ReplyDeletea1c chart
That’s a nice site you people are carrying out there.
ReplyDeletewhole life insurance quotes
Your way to enlighten everything on this blog is actually pleasant, everyone manage to efficiently be familiar with it, Thanks a great deal.cheap car insurance
ReplyDeleteI really love your write-ups guys continue the good work. auto insurance
ReplyDeleteI will prefer this blog because it has much more informative stuff.
ReplyDeleteonline tutoring companies
I have looked for so several posts about the blog lovers except this post is of course a nice one, keep on.
ReplyDeletelanguage tutor online
Amiable articles and the blogs really helped me a lot, thanks for the valuable information.
ReplyDeleteNew York medical malpractice lawyer
Hi guys, when I am actually willing of reading these blog post to be updated regularly. It offers fastidious stuff.
ReplyDeletepayday loans online
Hey buddies, such a marvelous blog you have made I’m surprised to read such informative stuff.
ReplyDeletezip password unlocker
Never found such informatory contents.
ReplyDeletetalktalk customer services
Pretty remarkable post. I simply came across your blog and desired to say that I have really enjoyed searching your blog posts.
ReplyDeleteonline payday advance
Mind-boggling job mates, I take pleasure in longing your articles.
ReplyDeleteclick here
congratulations guys, quality information you have given!!! schaumburg bars
ReplyDeleteThe Info in the blog is out of this world, I so want to read more. personal trainer
ReplyDeleteThe Info in the blog is out of this world, I so want to read more. personal trainer
ReplyDeleteI have spent a lot of the time in different blogs but this is really a unique blog for me.
ReplyDeletebuy twitter followers UK
Fascinating information I haven’t been experienced such information in quite a long time.buy twitter followers UK
ReplyDeleteThumbs up guys you are really carrying out a great job.Top Level Domain
ReplyDeleteThis text may be value everyone’s attention. How will I learn more?
ReplyDeletevietnam visa
Your articles support me a lot in all mediums of subjects.
ReplyDeletecentral booking staten island
Your contents are too straightforward to browse and easy to understand.
ReplyDeletequeens central bookingcentral booking ny
I’m so lucky that I have got this site that imparted me the high quality of information easily.
ReplyDeleteVLC Media Player
Thanks friends, for providing such enlightening data.
ReplyDeletefilezilla client download
Your articles and blogs are inspirational.
ReplyDeletevietnam travel
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
ReplyDeleteFine method of telling, and enjoyable article to acquire factual statements.vietnam travel
ReplyDeleteHurrah, that’s what I was trying to get for, just what a stuff Presented at this blog!! Thanks admin of the site. vietnam holiday
ReplyDeleteNice answers in replace of the question with real point of view and explaining about that.
ReplyDeletesewing kit
Wonderful, just what a blog it is! This blog has provided the helpful data to us continue the good work.
ReplyDeletebest credit repair services
I like your articles guys keep it up.
ReplyDeleteadt security reviews
It’s a classic great for me to go to this blog site, it offers helpful suggestionsvietnam tour
ReplyDeleteI'm certainly very happy to read this blog site posts which carries plenty of helpful data, thanks for providing such information.vietnam travel
ReplyDeleteThis blog post is really great; the standard stuff of the post is genuinely amazing. vietnam holiday
ReplyDeleteI have never been to such type of posts before truly remarkable stuff it has..
ReplyDeleteelectrical contractors brisbane
Finally I’ve found your blog, awesome way of explaining each and everything really.
ReplyDeleteManhattan central booking
Great webpage brother I am about to notify this to all of my friends and contacts..
ReplyDeleteNew York Arraignment Lawyer
Your blogs are truly awesome I have no words to praise for your blogs.
ReplyDeletequeens central booking
I truly get pleasure from while I read your blogs and its content.i live in tennessee and i did a payday advance and cant pay it back
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteCan you please elaborate on EDNdataSource you created above?
ReplyDeleteis it pointing to DEV_SOA_INFRA or HR Schema?
Thank you for your blog! It is really worth sharing and I'm glad that it helped me find RapidRupee app which provides payday loans & it is great.
ReplyDelete