Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

Contact Us

Oracle Workflows - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new Click here to raise Support Ticket. Get reply within 48 hours.

Search Courses

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
 

Following are the questions can often come to mind when dealing with Business Event Subscriptions
1. What is the difference between raising a business event from PL/SQL or from Java
2. Why you should not raise a Business Event from OA Framework using a JDBC call to "wf_event.raise"
3. The subscription does not fire in real time, even though business subscription phase is less than 99

Let us deal with these questions one by one.



What is the difference between raising a business event from PL/SQL or from Java
When a business event is raised, effectively a message is placed into an Advanced Queue Table in Oracle. For simplicity assume the there are just two tables i.e.WF_DEFERRED and WF_JAVA_DEFERRED. In reality there are other tables as well to manage the lifecycle of processing the messages in WF Queue. The Advanced Queue table WF_DEFERRED is populated when the Business Event is raised via PL/SQL. However table WF_JAVA_DEFERRED is populated when the business event is raised from Java Layer, for example from OA Framework Page. Population of these tables is also called Enqueuing of the message.




Why do we need two different layers for Business Event processing?
I would answer this within the realms of next question- as below




Why you must never raise a Business Event from OA Framework using a JDBC call to "wf_event.raise"
In theory, and also in practice[call it bad practice]- you can raise a business event into PL/SQL layer from OA Framework page. This can be done if OAF code gets a handle to jdbc connection object and executes WF_EVENT.RAISE. We know that when an OA Framework page is submitted with some data being modified, then Entity Object cache gets populated. During the Entity Object cache population Entity Object methods like validateEntity() are executed.
  Let us assume that you have done the following-
    a. In OA Framework page, you have raised a business event from validateEntity() by getting
        handle to Database Connection and invoking PL/SQL procedure WF_EVENT.RAISE
    b. The business event being raised has a PL/SQL subscription with phase less than 99, i.e. to be executed in real-time
    c. The PL/SQL subscription queries the data on the table which is being updated by the OAF screen/UI itself
        In the example above, the PL/SQL code that queries the tables might not get any data returned, because
        the data is still in Entity Object Cache encapsulated by Application Module.
Therefore, even though it is possible to raise business events into PL/SQL layer from OA Framework, yet it is not recommended to follow this approach. For this very reason, you should use "oracle.apps.fnd.wf.bes.BusinessEvent.raise()" when raising business events from Java Layer.




The subscription does not fire in real time, even though business subscription phase is less than 99
Let us take a scenario. Let us assume you wish to invoke a webservice from PL/SQL Procedure. Of course you can raise Business Events directly from PL/SQL, but that has some limitations, for example 10g DB does not support BLOBS being passed into Web Service when Web Service is called from PL/SQL.
Therefore, for simplicity, you can do the following
    a. From your PL/SQL procedure, raise a business event using WF_EVENT.RAISE
    b. Subscribe a web service or a Java Function to the business event
    c. You keep the phase of this subscription less than 99, so that it gets invoked in real time
In this example, you will notice that even though your phase is lower than 99, the WebService is still being invoked in Deferred Mode.
As a thumbrule, you must remember that whenever you switch the context from PL/SQL to Java in Business Event, then subscription never gets processed in real time. In other words, the only way to invoke WebService or Java Code in real-time from Business Event is by raising the Business Event from java layer.


The image below shows that you can simulate raising the business event from either Java Layer or from PL/SQL Layer, by using "Test Business Event feature"

 


Anil Passi

Comments   

0 #1 khan 2010-02-02 03:40
Hi Anill,

Thanks for nice blog, In the screenshot show above the two buttons dont appear when i try to go to the this screen.
Regards
Khan
Quote
0 #2 khan 2010-02-02 03:42
Hi Anil,
Sorry did not mention the two buttons name (Raise in Java, Raise in PL/SQL).
How to make them appear.
THanks & Regards,
khan
Quote
0 #3 coach bags 2012-03-29 02:54
Thanks for nice blog, In the screenshot show above the two buttons dont appear when i try to go to the this screen
Quote
0 #4 Sagar Saiboyani 2012-05-12 13:05
Hi Anil,

Can we raise the Business event from a DB Trigge. I tried but it is not Raising the event. But when i tried it from LSQL stor Procedure it is Raising. Can you please tell me are there any limitations for raising te Business Event Via PLSQL?
Quote
0 #5 jayasri 2012-05-24 13:16
hi ,

i have the same issue as sagar has..

i have writen a anonymous block and raising the event.
it is wrking fine and i could see the same record in my queue table
but when i am raising the same event by keeping this anonymous block associated with trigger,
the trigger is not raising the event.

when i tried from the front end by clicking on raise pl/sql event(button) it is showing some error and not raising the event....

is there any prob with subscribing the events........
Quote
0 #6 asharma 2012-11-06 05:41
Hi,

I create a Business Event and subscribe the web service to it. But after clicking on button "Raise in Java" is showing me exception

exce ption:-

Except ion occured in Java Raise - Exception when Invoking Web Service -> oracle.apps.fnd .wf.bes.Invoker Exception: java.lang.Class CastException: org.apache.wsif .schema.Element Type cannot be cast to org.apache.wsif .schema.Complex Type

What it means ?

Regards,
Aja y
Quote
0 #7 kiranphadtare 2013-03-28 09:27
Hi,

I am searching a solution.
how to read integration repository data using java code ?

Thank u in Advance.

Regar ds,
Kiranp
Quote
0 #8 Anoop 2014-07-16 11:49
Hi,

I create a Business Event and subscribe the web service to it. But after clicking on button "Raise in Java" is showing me exception

exce ption:-

Except ion occured in Java Raise - Exception when Invoking Web Service -> oracle.apps.fnd .wf.bes.Invoker Exception: java.lang.Class CastException: org.apache.wsif .schema.Element Type cannot be cast to org.apache.wsif .schema.Complex Type

Can you guys let me know what needs to be done to fix this issue.
Regards,
Anoop
Quote
0 #9 strippers 2021-06-12 13:10
I love your blog.. very nice colors & theme. Did you create this website
yourself or did you hire someone to do it for you?

Plz reply as I'm looking to design my own blog and would like to know where u got this
from. thank you
Quote
0 #10 strippers Las Vegas 2021-06-12 14:29
Hello, I check your blogs daily. Your humoristic style is
witty, keep doing what you're doing!
Quote

Add comment


Security code
Refresh

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Jun 2021  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
   1  2  3  4  5  6
  7  8  910111213
14151617181920
21222324252627
282930    

Enquire For Training

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner