Oracle Workflow Developer's Guide Release 2.6.3.5 Part Number B12161-02 |
Previous | Next | Contents | Index | Glossary |
An event activity can either receive, raise, or send a business event.
A Receive event activity can be marked as a Start activity for a process, meaning it is always enabled to receive events. Alternatively, a Receive event activity can be placed within the process, so that it is only enabled to receive events after the process transitions to that activity.
You can define a Receive event activity to accept only one specific event, to accept only an event that is a member of a specific event group, or to accept any event.
When an event subscription sends an event to a workflow process, the Workflow Engine performs the following processing:
Note: If the event was sent to one or more existing workflow processes based on a business key, rather than to one particular workflow process, then an activity must have a status of 'NOTIFIED' to be eligible and must have a #BUSINESS_KEY attribute that matches the event key. See: Event Subscriptions for Standalone Oracle Workflow or Event Subscriptions for Oracle Applications.
Example - Using a Business Key
Use a business key to identify which workflow processes should receive an event when the event applies to one or more processes that are already started and are awaiting input to continue. For example, a workflow process initiated for a purchase order with the number PO123 may be awaiting input such as credit card authorization from another workflow or from an external interface, through an event named po.credit.authorization. The authorization event should only continue the workflow process instance associated with the PO123 purchase order; it should not continue any other purchase order processes.
To achieve this purpose, the receive event activity in the purchase order workflow process should be defined to accept only the po.credit.authorization event and should include an activity attribute named #BUSINESS_KEY with a value of PO123. The other workflow process or external system that raises the event must set the event key to PO123. Additionally, the event subscription to the po.credit.authorization event must use the WF_RULE.Instance_Default_Rule rule function or, in Oracle E-Business Suite, the subscription must be defined with the Launch When Business Key Matches option. With this configuration, when the event arrives, it will continue only the workflow process instance associated with the specific purchase order number PO123 through the #BUSINESS_KEY activity attribute.
Additionally, the activity retrieves the names and values of any activity attributes defined for it and sets these attributes as parameters in the parameter list for the event message. If the event message is later received by another process, the Workflow Engine sets the event parameters as item type attributes for that process. See: Event Message Structure, Oracle Workflow API Reference.
The activity also automatically sets the item type and item key for the current workflow process in the parameter list for the event message. If the event message is later received by another process, the Workflow Engine uses that item type and item key to automatically set the process that raised the event as the parent for the process that receives the event. See: SetItemParent, Oracle Workflow API Reference.
If you want to raise the new event using the event data and parameter list from an existing event message, you can define a special activity attribute named #EVENTMESSAGE2 for the raise event activity. Set the existing event message as the value of the #EVENTMESSAGE2 attribute, which must be an attribute of type event. If this attribute is defined, the activity retrieves the event data and parameter list from the specified event and sets them into the new event message before it is raised.
Note: If you also specified event data in the node's event details, however, the activity sets that event data into the event, overriding any event data from the #EVENTMESSAGE2 attribute. If you specified any additional parameters in activity attributes for the raise event activity, the activity also sets those parameters into the parameter list for the event message, overriding the values of any parameters with the same names from the #EVENTMESSAGE2 attribute.
For example, if the process previously received an event and you want to raise a new event with that event data, you can define the #EVENTMESSAGE2 attribute for the raise event activity and set its default value to the item attribute where the received event is stored.
Note: A Send event activity does not raise the event to the Business Event System, so no subscription processing is performed.
Previous | Next | Contents | Index | Glossary |