Skip Headers

Oracle Workflow Developer's Guide
Release 2.6.3

Part Number B10284-02
Previous Next       Contents Index Glossary
         Previous  Next          Contents  Index  Glossary

Error Handling for Event Subscription Processing

The Event Manager uses the status codes returned by event subscription rule functions to monitor the status of subscription processing for an event. If a rule function returns a status code of WARNING or ERROR, indicating that a warning condition or an error occurred during subscription processing, the Event Manager places the event message on the standard WF_ERROR queue associated with the WF_ERROR agent. For a WARNING status, the Event Manager then continues subscription processing for the event. For an ERROR status, the Event Manager halts subscription processing for the event and rolls back any subscriptions already executed for the event.

Note: All subscription processing is rolled back in the case of an error in order to allow the system administrator to handle the error by retrying the event, if appropriate. In this way, Oracle Workflow ensures that no subscription is duplicated when subscription processing is restarted.
Note: If a rule function raises an exception, the Event Manager rolls back all subscription processing for the event and raises the error to the calling application. In this case the event message is not placed on the WF_ERROR queue.

The WF_ERROR agent is a standard agent for error handling that is automatically defined on the local system when you install Oracle Workflow. You must schedule a listener to monitor the WF_ERROR agent. When this listener dequeues an event message from the WF_ERROR queue, the message is assigned a source type of Error. The Event Manager then searches for and executes any subscriptions by the local system to that event or to the Any event with the source type Error. If no subscriptions are found, the Event Manager executes any subscriptions by the local system to the Unexpected event with the source type Error.

Oracle Workflow provides one predefined subscription to the Unexpected event with the source type Error. This subscription performs the default error handling for any errored event for which you have not defined a custom Error subscription. The subscription sends the event message to the Default Event Error process in the System: Error item type.

Attention: You must not change or disable the definition of the Unexpected event or of the predefined Error subscription to that event. If you do, the Event Manager will not be able to perform default error handling for event and subscription processing.

The Default Event Error process sends a notification to the system administrator. For a warning condition, no response is required. For an error, the process allows the system administrator to abort or retry the event subscription processing.

You can set up custom error handling for a particular event by defining a subscription to that event with a source type of Error and specifying the custom processing you want to execute as the subscription action. In this case, the Event Manager will not perform the default error handling, since the errored event will no longer be an unexpected event. Instead, your custom error handling will replace the default error handling.

Unexpected Events

Oracle Workflow also uses the Default Event Error process to handle unexpected events. If an event is received from an external source, but the local system does not have any subscriptions to that event, the Event Manager automatically searches for subscriptions to the Unexpected event with the source type External. Oracle Workflow provides a predefined External subscription to the Unexpected event that sends the event message to the Default Event Error process.

The Default Event Error process notifies the system administrator of the unexpected event and allows the system administrator to abort or retry the event subscription processing. For example, the system administrator can create a subscription to handle the event and then re-enqueue the event message to trigger the new subscription.

Note: Oracle Workflow also provides a predefined Local subscription to the Unexpected event that sends the event message to the Default Event Error process when there are no subscriptions to a locally raised event. However, this subscription is disabled by default, because many local events may be raised to which you do not want to subscribe. If you want to enable this subscription, be careful to consider all the events that can be raised on your local system and trigger the subscription.

See Also

Unexpected Event

Default Event Error Process


         Previous  Next          Contents  Index  Glossary


Oracle Logo
Copyright © 2003 Oracle Corporation.

All rights reserved.