Oracle Workflow Guide Release 2.6.2 Part Number A95265-03 |
Contents | Index | Glossary | Master Index | Feedback |
function AddCorrelation
(p_subscription_guid in raw,
p_event in out wf_event_t) return varchar2;
Description
Adds a correlation ID to an event message during subscription processing. AddCorrelation() searches the subscription parameters for a parameter named ITEMKEY that specifies a custom function to generate a correlation ID for the event message. The function must be specified in the Parameters field for the subscription in the following format:
ITEMKEY=<package_name.function_name>
AddCorrelation() uses SubscriptionParameters() to search for and retrieve the value of the ITEMKEY parameter. See: SubscriptionParameters.
If a custom correlation ID function is specified with the ITEMKEY parameter, then AddCorrelation() runs that function and sets the correlation ID to the value returned by the function. Otherwise, AddCorrelation() sets the correlation ID to the system date. If the event message is then sent to a workflow process, the Workflow Engine uses that correlation ID as the item key to identify the process instance.
If AddCorrelation() encounters an exception, the function returns the status code ERROR. Otherwise, AddCorrelation() returns the status code SUCCESS.
AddCorrelation() is defined according the standard API for an event subscription rule function. You can use AddCorrelation() as the rule function for a subscription with a low phase number to add a correlation ID to an event, and then use a subscription with a higher phase number to perform any further processing.
For example, follow these steps:
You can also call AddCorrelation() within a custom rule function to add a correlation ID during your custom processing. See: Standard API for an Event Subscription Rule Function.
Note: You may find it advantageous to define multiple subscriptions to an event with simple rule functions that you can reuse, rather than creating complex specialized rule functions that cannot be reused.
Arguments (input)
p_subscription_ guid | The globally unique identifier of the subscription. |
p_event | The event message. |
Previous | Next | Contents | Index | Glossary |