Skip Headers

Oracle Workflow API Reference
Release 2.6.3

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

Event Message Structure

Oracle Workflow uses the object type WF_EVENT_T to store event messages. This datatype contains all the header properties of an event message as well as the event data payload, in a serialized form that is suitable for transmission outside the system.

WF_EVENT_T defines the event message structure that the Business Event System and the Workflow Engine use to represent a business event. Internally, the Business Event System and the Workflow Engine can only communicate events in this format. Many of the standard queues that Oracle Workflow provides for the Business Event System use WF_EVENT_T as their payload type.

Note: If you want to use queues with a custom payload type, including any existing queues you already have defined on your system, you must create a queue handler to translate between the standard Workflow WF_EVENT_T structure and your custom payload type. See: Setting Up Queues, Oracle Workflow Administrator's Guide and Standard APIs for a Queue Handler, Oracle Workflow Developer's Guide.

The following table lists the attributes of the WF_EVENT_T datatype.

Attribute Name Datatype Description
PRIORITY NUMBER The priority with which the message recipient should dequeue the message. A smaller number indicates a higher priority. For example, 1 represents a high priority, 50 represents a normal priority, and 99 represents a low priority.
SEND_DATE DATE The date and time when the message is available for dequeuing. The send date can be set to the system date to indicate that the message is immediately available for dequeuing, or to a future date to indicate future availability.
If the send date is set to a future date when an event is raised, the event message is placed on the WF_DEFERRED queue, and subscription processing does not begin until the specified date. If the send date is set to a future date when an event is sent to an agent, the event message is propagated to that agent's queue, but does not become available for the consumer to dequeue until the specified date.
RECEIVE_DATE DATE The date and time when the message is dequeued by an agent listener.
CORRELATION_ID VARCHAR2(240) A correlation identifier that associates this message with other messages. This attribute is initially blank but can be set by a function. If a value is set for the correlation ID, then that value is used as the item key if the event is sent to a workflow process. Note that the item key for a process instance can only contain single-byte characters. It cannot contain a multibyte value.
PARAMETER_LIST WF_PARAMETER_ LIST_T A list of additional parameter name and value pairs.
EVENT_NAME VARCHAR2(240) The internal name of the event.
EVENT_KEY VARCHAR2(240) The string that uniquely identifies the instance of the event.
EVENT_DATA CLOB A set of additional details describing what occurred in the event. The event data can be structured as an XML document.
FROM_AGENT WF_AGENT_T The agent from which the event is sent. For locally raised events, this attribute is initially null.
TO_AGENT WF_AGENT_T The agent to which the event should be sent (the message recipient).
ERROR_ SUBSCRIPTION RAW(16) If an error occurs while processing this event, this is the subscription that was being executed when the error was encountered.
ERROR_MESSAGE VARCHAR2(4000) An error message that the Event Manager generates if an error occurs while processing this event.
ERROR_STACK VARCHAR2(4000) An error stack of arguments that the Event Manager generates if an error occurs while processing this event. The error stack provides context information to help you locate the source of an error.

The WF_EVENT_T object type also includes the following methods, which you can use to retrieve and set the values of its attributes.

Note: You can set the values of the EVENT_NAME, EVENT_KEY, and EVENT_DATA attributes individually using the setEventName, setEventKey, and setEventData methods, or you can use the Content method to set all three event content attributes at once. See: Content.
Similarly, you can set the values of the FROM_AGENT, TO_AGENT, PRIORITY, and SEND__DATE attributes individually using the setFromAgent, setToAgent, setPriority, and setSendDate methods, or you can use the Address method to set all four address attributes at once. See: Address.

See Also

Example for Using Abstract Datatypes

Mapping Between WF_EVENT_T and OMBAQ_TEXT_MSG

Mapping Between WF_EVENT_T and SYS.AQ$_JMS_TEXT_MESSAGE

Initialize

PL/SQL Syntax

STATIC PROCEDURE initialize

(new_wf_event_t in out wf_event_t)

Description

Initializes a new WF_EVENT_T object by setting the PRIORITY attribute to 0, initializing the EVENT_DATA attribute to EMPTY using the Empty_CLOB() function, and setting all other attributes to NULL.

Attention: You must call the Initialize method before you can perform any further manipulation on a new WF_EVENT_T object.

Arguments (input)

new_wf_event_t The WF_EVENT_T object to initialize.

getPriority

PL/SQL Syntax

MEMBER FUNCTION getPriority

return number

Description

Returns the value of the PRIORITY attribute in a WF_EVENT_T object.

getSendDate

PL/SQL Syntax

MEMBER FUNCTION getSendDate

return date

Description

Returns the value of the SEND_DATE attribute in a WF_EVENT_T object.

getReceiveDate

PL/SQL Syntax

MEMBER FUNCTION getReceiveDate

return date

Description

Returns the value of the RECEIVE_DATE attribute in a WF_EVENT_T object.

getCorrelationID

PL/SQL Syntax

MEMBER FUNCTION getCorrelationID

return varchar2

Description

Returns the value of the CORRELATION_ID attribute in a WF_EVENT_T object.

getParameterList

PL/SQL Syntax

MEMBER FUNCTION getParameterList

return wf_parameter_list_t

Description

Returns the value of the PARAMETER_LIST attribute in a WF_EVENT_T object.

getEventName

PL/SQL Syntax

MEMBER FUNCTION getEventName

return varchar2

Description

Returns the value of the EVENT_NAME attribute in a WF_EVENT_T object.

getEventKey

PL/SQL Syntax

MEMBER FUNCTION getEventKey

return varchar2

Description

Returns the value of the EVENT_KEY attribute in a WF_EVENT_T object.

getEventData

PL/SQL Syntax

MEMBER FUNCTION getEventData

return clob

Description

Returns the value of the EVENT_DATA attribute in a WF_EVENT_T object.

getFromAgent

PL/SQL Syntax

MEMBER FUNCTION getFromAgent

return wf_agent_t

Description

Returns the value of the FROM_AGENT attribute in a WF_EVENT_T object.

getToAgent

PL/SQL Syntax

MEMBER FUNCTION getToAgent

return wf_agent_t

Description

Returns the value of the TO_AGENT attribute in a WF_EVENT_T object.

getErrorSubscription

PL/SQL Syntax

MEMBER FUNCTION getErrorSubscription

return raw

Description

Returns the value of the ERROR_SUBSCRIPTION attribute in a WF_EVENT_T object.

getErrorMessage

PL/SQL Syntax

MEMBER FUNCTION getErrorMessage

return varchar2

Description

Returns the value of the ERROR_MESSAGE attribute in a WF_EVENT_T object.

getErrorStack

PL/SQL Syntax

MEMBER FUNCTION getErrorStack

return varchar2

Description

Returns the value of the ERROR_STACK attribute in a WF_EVENT_T object.

setPriority

PL/SQL Syntax

MEMBER PROCEDURE setPriority

(pPriority in number)

Description

Sets the value of the PRIORITY attribute in a WF_EVENT_T object.

Arguments (input)

pPriority The value for the PRIORITY attribute.

setSendDate

PL/SQL Syntax

MEMBER PROCEDURE setSendDate

(pSendDate in date default sysdate)

Description

Sets the value of the SEND_DATE attribute in a WF_EVENT_T object.

Arguments (input)

pSendDate The value for the SEND_DATE attribute.

setReceiveDate

PL/SQL Syntax

MEMBER PROCEDURE setReceiveDate

(pReceiveDate in date default sysdate)

Description

Sets the value of the RECEIVE_DATE attribute in a WF_EVENT_T object.

Arguments (input)

pReceiveDate The value for the RECEIVE_DATE attribute.

setCorrelationID

PL/SQL Syntax

MEMBER PROCEDURE setCorrelationID

(pCorrelationID in varchar2)

Description

Sets the value of the CORRELATION_ID attribute in a WF_EVENT_T object.

Arguments (input)

pCorrelationID The value for the CORRELATION_ID attribute.

setParameterList

PL/SQL Syntax

MEMBER PROCEDURE setParameterList

(pParameterList in wf_parameter_list_t)

Description

Sets the value of the PARAMETER_LIST attribute in a WF_EVENT_T object.

Arguments (input)

pParameterList The value for the PARAMETER_LIST attribute.

setEventName

PL/SQL Syntax

MEMBER PROCEDURE setEventName

(pEventName in varchar2)

Description

Sets the value of the EVENT_NAME attribute in a WF_EVENT_T object.

Arguments (input)

pEventName The value for the EVENT_NAME attribute.

setEventKey

PL/SQL Syntax

MEMBER PROCEDURE setEventKey

(pEventKey in varchar2)

Description

Sets the value of the EVENT_KEY attribute in a WF_EVENT_T object.

Arguments (input)

pEventKey The value for the EVENT_KEY attribute.

setEventData

PL/SQL Syntax

MEMBER PROCEDURE setEventData

(pEventData in clob)

Description

Sets the value of the EVENT_DATA attribute in a WF_EVENT_T object.

Arguments (input)

pEventData The value for the EVENT_DATA attribute.

setFromAgent

PL/SQL Syntax

MEMBER PROCEDURE setFromAgent

(pFromAgent in wf_agent_t)

Description

Sets the value of the FROM_AGENT attribute in a WF_EVENT_T object.

Arguments (input)

pFromAgent The value for the FROM_AGENT attribute.

setToAgent

PL/SQL Syntax

MEMBER PROCEDURE setToAgent

(pToAgent in wf_agent_t)

Description

Sets the value of the TO_AGENT attribute in a WF_EVENT_T object.

Arguments (input)

pToAgent The value for the TO_AGENT attribute.

setErrorSubscription

PL/SQL Syntax

MEMBER PROCEDURE setErrorSubscription

(pErrorSubscription in raw)

Description

Sets the value of the ERROR_SUBSCRIPTION attribute in a WF_EVENT_T object.

Arguments (input)

pErrorSubscription The value for the ERROR_SUBSCRIPTION attribute.

setErrorMessage

PL/SQL Syntax

MEMBER PROCEDURE setErrorMessage

(pErrorMessage in varchar2)

Description

Sets the value of the ERROR_MESSAGE attribute in a WF_EVENT_T object.

Arguments (input)

pErrorMessage The value for the ERROR_MESSAGE attribute.

setErrorStack

PL/SQL Syntax

MEMBER PROCEDURE setErrorStack

(pErrorStack in varchar2)

Description

Sets the value of the ERROR_STACK attribute in a WF_EVENT_T object.

Arguments (input)

pErrorStack The value for the ERROR_STACK attribute.

Content

PL/SQL Syntax

MEMBER PROCEDURE Content

(pName in varchar2,
pKey in varchar2,
pData in clob)

Description

Sets the values of all the event content attributes in a WF_EVENT_T object, including EVENT_NAME, EVENT_KEY, and EVENT_DATA.

Arguments (input)

pName The value for the EVENT_NAME attribute.
pKey The value for the EVENT_KEY attribute.
pData The value for the EVENT_DATA attribute.

Address

PL/SQL Syntax

MEMBER PROCEDURE Address

(pOutAgent in wf_agent_t,
pToAgent in wf_agent_t,
pPriority in number,
pSendDate in date)

Description

Sets the values of the all address attributes in a WF_EVENT_T object, including FROM_AGENT, TO_AGENT, PRIORITY, and SEND_DATE.

Arguments (input)

pOutAgent The value for the FROM_AGENT attribute.
pToAgent The value for the TO_AGENT attribute.
pPriority The value for the PRIORITY attribute.
pSendDate The value for the SEND_DATE attribute.

AddParameterToList

PL/SQL Syntax

MEMBER PROCEDURE AddParameterToList

(pName in varchar2,
pValue in varchar2)

Description

Adds a new parameter name and value pair to the list stored in the PARAMETER_LIST attribute of a WF_EVENT_T object. If a parameter with the specified name already exists in the parameter list, then the previous value of that parameter is overwritten with the specified value.

Arguments (input)

pName The parameter name.
pValue The parameter value.

GetValueForParameter

PL/SQL Syntax

MEMBER FUNCTION GetValueForParameter

(pName in varchar2) return varchar2

Description

Returns the value of the specified parameter from the list stored in the PARAMETER_LIST attribute of a WF_EVENT_T object. This method begins at the end of the parameter list and searches backwards through the list. If no parameter with the specified name is found in the parameter list, then the GetValueForParameter method returns NULL.

Arguments (input)

pName The parameter name.

         Previous  Next          Contents  Index  Glossary


Oracle Logo
Copyright © 2003 Oracle Corporation.

All rights reserved.