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.
- Execute PLSQL rule function synchronously or asynchronously. Oracle Workflow provides a bunch of default rule functions in WF_RULE package for your use
- Execute Java rule function synchronously or asynchronously. Oracle Workflow provides a default rule function oracle.apps.fnd.wf.bes.WebServiceInvokerSubscription to invoke web services.
- Launch workflow process
- Send event to an agent (AQ)
Workflow Business Events can be raised using one of two following ways.
- PLSQL API WF_EVENT.Raise
- 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.
| Scenario | Event raised in | Subscription type | Subscription phase | Agent (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)
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.
Posted by Michael Christ | October 13, 2009 6:52 PM
Posted on October 13, 2009 18:52
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.
Posted by vijayakumar.shanmugam
|
October 20, 2009 9:36 PM
Posted on October 20, 2009 21:36