This blog post contributed by Shivdas Tomar.
Please read earlier post about Workflow Business Event System.We will see the exact execution flow when an event is raised using a PLSQL API and a Java API.
Event raised using PLSQL API
As soon as event is deferred to WF_DEFERRED or WF_JAVA_DEFERRED,
control is returned back to calling program. Workflow Deferred Agent Listener and Workflow Java Deferred Agent Listener continues execution of the subscriptions respectively from these queues. If there is any error
during subscription or generate function execution, event will be
enqueued to WF_ERROR or WF_JAVA_ERROR queue respectively. The Error Agent Listeners then execute error subscriptions associated to
the event. Event raised using Java API
Once event enqueued to WF_JAVA_DEFERRED queue, further execution will
be resumed from the deferred subscription, by Workflow Deferred Java
Agent Listener. If any error occurs during processing of a subscription by the Deferred Java Agent Listener,
event is enqueued to WF_JAVA_ERROR queue.