Skip Headers

Oracle Workflow Developer's Guide
Release 2.6.3.5

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

Standard API for an Event Data Generate Function

When you define an event in the Business Event System, you can assign the event a generate function that can produce the complete event data from the event name, event key, and an optional parameter list. The event data gives additional details to describe what occurred and can be structured as an XML document. You should specify a generate function if the application that raises the event will not produce the event data itself.

When an event is raised locally, the Event Manager checks each subscription before executing it to determine whether the subscription requires the event data. If the event data is required but is not already provided, the Event Manager calls the generate function for the event to produce the event data. The generate function returns the event data in character large object (CLOB) format.

Note: If the event data is required but no generate function is defined for the event, Oracle Workflow creates a default set of event data using the event name and event key.

Note: If the generate function is costly, and you want to return control to the calling application more quickly after raising the event, you can defer all the subscriptions that require the complete event data. Then the Event Manager will not run the generate function until those subscriptions are executed at a later time. See: Deferred Subscription Processing.

Standard API for a PL/SQL Generate Function

A PL/SQL generate function must have the following standard API:

function <function_name> (p_event_name in varchar2,
p_event_key in varchar2
p_parameter_list in wf_parameter_list_t
default null)
return clob;

The arguments for the function are as follows:

p_event_name The internal name of the event.
p_event_key A string generated when the event occurs within a program or application. The event key uniquely identifies a specific instance of the event.
p_parameter_list An optional list of additional parameter name and value pairs for the event.

Standard API for a Java Generate Function

In Oracle Applications only, you can assign an event a Java generate function to be executed in the middle tier, instead of a PL/SQL generate function. A Java generate function must be a Java class using the following Java interface:

public interface GenerateInterface
{
public String generate(BusinessEvent event,
WorkflowContext context)
throws BusinessEventException;
}

The arguments for the API are as follows:

event The BusinessEvent object. The payload passed to the BusinessEvent class must be serializable.
context Workflow context information, including the Log object which can be used for logging.

See Also

To Define an Event

To Define an Event Subscription

Parameter List Structure, Oracle Workflow API Reference

Oracle Workflow Javadoc on OracleMetaLink


         Previous  Next          Contents  Index  Glossary



Oracle Logo
Copyright © 2003, 2004, Oracle. All rights reserved.