Warning

PL/SQL Syntax

function Warning  
  (p_subscription_guid in raw, 
   p_event in out wf_event_t) return varchar2;

Description

Returns the status code WARNING. Additionally, when you assign this function as the rule function for a subscription, you must define a subscription parameter with the name ERROR_MESSAGE and a value set to the internal name of an Oracle Workflow error message. When the subscription is executed, Warning() will set that error message into the event message using setErrorMessage(). See: setErrorMessage.

Enter the parameter name ERROR_MESSAGE in the Name field and the parameter value in the Value field in the Subscription Parameters region of the Create Event Subscription page. The parameter value must be a valid name of an Oracle Workflow error message. The names of the error messages provided by Oracle Workflow are stored in the NAME column of the WF_RESOURCES table for messages with a type of WFERR.

You can use Warning() as a subscription rule function if you want to send the system administrator a warning notification with one of the predefined Workflow error messages whenever a particular event is raised.

For example, define a subscription to the relevant event with the rule function WF_RULE.Warning and define a subscription parameter with the name ERROR_MESSAGE and the value WFSQL_ARGS. Then raise the event to trigger the subscription. Because Warning() returns the status code WARNING, the Event Manager places the event message on the WF_ERROR queue, but subscription processing for the event still continues. When the listener runs on the WF_ERROR queue, a warning notification will be sent to the system administrator with the message "Invalid value(s) passed for arguments", which is the display name of the WFSQL_ARGS error message.

Note: Warning() does not raise any exception to the calling application when it completes normally.

Arguments (input)

p_subscription_guid The globally unique identifier of the subscription.
p_event The event message.