« Invoking Web Service from Oracle Workflow process | Main | Primer on Integration Repository »

PLSQL vs Java Business Event System

Oracle Workflow provides Business Event System implementation within the database and in the middle tier. The implementation is exactly the same in terms of the event subscription processing in both these layers but the only difference is how the Developer wants to leverage Business Event System's capabilities for event processing requirements. With the availability of Business Event System implementation in PLSQL and Java, following subscription processing can be achieved.

  1. Execute PLSQL rule function synchronously or asynchronously. Oracle Workflow provides a bunch of default rule functions in WF_RULE package for your use
  2. Execute Java rule function synchronously or asynchronously. Oracle Workflow provides a default rule function oracle.apps.fnd.wf.bes.WebServiceInvokerSubscription to invoke web services.
  3. Launch workflow process
  4. Send event to an agent (AQ)

Workflow Business Events can be raised using one of two following ways.

  1. PLSQL API WF_EVENT.Raise
  2. Java method oracle.apps.fnd.wf.BusinessEvent.raise

As long as the call to these APIs does not throw an error, the event is raised successfully. There is a wrong notion among developers and administrators that all the events raised are enqueued to an agent (AQ) such as WF_DEFERRED or WF_JAVA_DEFERRED. No, it is not enqueued to an agent always, but it is driven based on how the subscription is defined. Now how are the event subscriptions dispatched and how to check the status of a subscription execution?

Subscriptions are either synchronous (phase < 100) or asynchronous (phase >= 100) with respect to the layer it is raised such as either PLSQL or Java and that layer's ability to dispatch the subscriptions. Following table gives an idea about how different subscriptions are dispatched.






ScenarioEvent raised inSubscription typeSubscription phaseAgent (AQ) Dispatched by
1 PLSQL PLSQL >=100 WF_DEFERRED Workflow Deferred Agent Listener
2 PLSQL PLSQL <100 None Same session as WF_EVENT.Raise
3 PLSQL Java Any WF_JAVA_DEFERRED Workflow Java Deferred Agent Listener
4 Java Java >=100 WF_JAVA_DEFERRED Workflow Java Deferred Agent Listener
5 Java Java <100 None Same session as BusinessEvent.raise()
6 Java PLSQL >=100 WF_JAVA_DEFERRED Workflow Java Deferred Agent Listener
7 Java PLSQL <100 None Same session as BusinessEvent.raise()

Comments (2)

Michael Christ:

This posting is very helpful to me. Question: If I understand this posting, the business event system will never use a custom queue. Is this correct. If incorrect, how would I use the business event/subscription process with a custom queue and agent? Thanks.

vijayakumar.shanmugam Author Profile Page:

Business Event System can work with custom queues. Here are the steps.

1) Create a Queue
2) Create a Queue Handler for the Custom queue if the payload type is not WF_EVENT_T (WF_EVENT_QH) or JMS text message (WF_EVENT_OJMSTEXT_QH). Oracle Workflow provides seeded queue handlers for these two types if you want use it. If you need more custom processing with these types too, you could still extend these queue handlers.
3) Create an Agent to use this queue and queue handler from the BES event manager pages.
4) Use this agent in BES event subscriptions to enqueue an event.

Let me know if you need more information.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on July 31, 2009 8:20 PM.

The previous post in this blog was Invoking Web Service from Oracle Workflow process.

The next post in this blog is Primer on Integration Repository.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle