| Previous | Next |  | Contents | Index | Glossary

## Event

PL/SQL Syntax

`procedure Event`

        (itemtype in varchar2,

         itemkey in varchar2,

         process_name in varchar2 default null,

         event_message in wf_event_t);

Description

Receives an event from the Business Event System into a workflow process.

If the specified item key already exists, the event is received into that item. If the item key does not already exist, but the specified process includes an eligible Receive event activity marked as a Start activity, the Workflow Engine creates a new item running that process.

Within the workflow process that receives the event, the procedure searches for eligible Receive event activities. An activity is only eligible to receive an event if its event filter is either blank or set to that particular event. Additionally, the activity must have an appropriate status.

- An activity marked as a Start activity can only receive an event if it has never been executed.

- A normal activity can only receive an event if its activity status is NOTIFIED, meaning the process has transitioned to that activity and is waiting to receive the event.

For each eligible Receive event activity, Event() stores the event name, event key, and event message in the item type attributes specified in the event activity node, if they have been defined. Then the Workflow Engine begins a thread of execution from the event activity.

If no eligible Receive event activity exists for a received event, the procedure returns an exception and an error message.

Arguments (input) | itemtypeA valid item type.
itemkey | A string that uniquely identifies the item within an item type. The item type and key together identify the process.
process_name | An optional argument that allows the selection of a particular subprocess for that item type. Provide the process activity's label name. If the process activity label name does not uniquely identify the subprocess you can precede the label name with the internal name of its parent process. For example, <parent_process_internal_name>:<label_name>. If this argument is null, the top level process for the item is started. This argument defaults to null.
event_message | The event message containing the details of the event.

| Previous | Next |  | Contents | Index | Glossary