Big enough to know. Small enough to know better.
The Big Event: Oracle Workflow Business Event System
Janette Lockhart Technical Manager
Agenda • Overview • The Event Manager • • • •
Events Systems Agents Subscriptions
• Seeded Business Events in the E-Business Suite • Example Business Event Scenarios • Conclusion
Oracle Workflow BES Overview • The Business Event System • Is a service component of Oracle Workflow • Provides event driven processing • Is available with both standalone and E-Business Suite Workflow
• Our goals today are • To understand the capabilities and architecture of the BES • From both functional and technical viewpoints
Event Manager • Primary component of the BES • Maintains a registry of BES objects • Event – allows an application to signal that something of importance has happened • Subscription – an application or system registers interest in an event • System – a local or external environment • Communication Agent - a means to transport event information
• HR/External System Example
Working with Event Manager Objects • Oracle Workflow BES provides a set of web pages for creating and maintaining objects • Accessible only by users with the Workflow Administrator privilege
Registering a Business Event
....<event >
Registering a Business Event • Event Name (required) • Must be unique • Format: ..<product>.. .<event> • Example:
oracle.apps.ap.event.invoice.approval • Display Name (required) • Description (optional)
Registering a Business Event • Status – enabled or disabled • Generate Function (optional) • PL/SQL stored function based on Workflow API • Produces complete event data
• Owner name and tag • Indicates which application owns the event • E-Bus Suite uses application name and short name
Registering a Business Event • Customization Level • Used primarily by E-Bus Suite events • “Core” – no changes allowed to event definition • “Limit” – only the event status (enabled or disabled) may be updated • “User” – any property of the event definition may be updated • Custom events automatically get a customization level of “User”
Registering a Business Event • Seeded registration for an E-Business Suite Event
Raising a Business Event • An event is “raised” by an application at runtime • Use standard Workflow API: wf_event.raise • Example
Raising a Business Event-Example CREATE OR REPLACE PROCEDURE ap_approval_raise_event (p_invoice_id IN NUMBER) AS l_event_key NUMBER; BEGIN SELECT ap_approval_event_s.nextval INTO l_event_key FROM dual; wf_event.raise (p_event_name => ‘oracle.apps.ap.event.invoice.approval’ ,p_event_key => p_invoice_id||’-’||l_event_key); END;
System • Logically separate environment: database or host • A “Local System” is auto created when Workflow is installed • You can create additional systems if you want to communicate outside of the Local System • Steps to setup a System differ depending on if external system has Workflow installed • See Workflow Users Guide for further information
Registering a System
Agent • A named point of communication • Communication between Systems is done via outbound and inbound Agents • Outbound Agents communicate by AQ propagation • Inbound Agents have Agent Listeners • Seeded Workflow Agents include: • • • •
WF_Deferred WF_Error WF_In WF_Out
Registering an Agent
Registering an Agent • Agent Name • Internal identifier, unique within System
• Protocol • Specifies how message is transported and encoded • Sending and receiving agents must use same protocol • Can be networking standard like SQLNET or B2B standard like SOAP • Other seeded protocols are HTTP, SMTP or JMS
Registering an Agent • Agent Address • Only required for inbound agents • For SQLNet, format is <schema>.@
• Queue Handler • PL/SQL or Java program that contains enqueue and dequeue logic for the queue • Translates between workflow event data type and data type expected by the Agent’s queue • WF_Event_QH is provided for Agents using SQLNet protocol and WF_Event_T data type
Registering an Agent • Queue Name • Format: <schema>. • Queue Name is how local system interacts with the queue • Address is how external systems interact with the queue
• Direction • Inbound communication • Outbound communication
Registering an Event Subscription • Subscriber • Triggering Event • Execution Condition • Phase • Controls immediate vs. deferred processing • Controls execution order • Status • Only enabled subscriptions are executed • Rule Data • Key – subscription only needs the event key • Message – subscription needs complete event data
Registering an Event Subscription • Action Type • • • •
Execute custom business logic Launch a workflow Send an event message to an Agent E-Business Suite • XML Gateway Trading Partner transaction • Send Notification
Seeded E-Business Suite Events • • • •
11.5.10 has 915 seeded Business Events! Customers can subscribe to these events Customers can create their own events View available events using the Workflow Event Manager responsibility
Seeded E-Business Suite Events
If customization level is “Limit”, event can be enabled
Example Business Event Scenario Subscribing to a Seeded Event
Update existing Event, if disabled
Subscribing to a Seeded Event
Enable the Event
Subscribing to a Seeded Event
Create a Subscription
Subscribing to a Seeded Event
Subscribing to a Seeded Event
Subscribing to a Seeded Event
Test the Event
Subscribing to a Seeded Event
Example Business Event Scenario Creating & Subscribing to a Custom Event • • • •
Register the custom event Raise the event in the application logic Write custom business logic, workflow, etc. Register one or more subscriptions to event • Determine order of execution using Phase • Determine immediate or deferred using Phase • Indicate Subscription’s Action
• Test with Business Event Test facility • Test with application
Conclusion • Many uses for the Workflow BES • • • •
Create your own integration hub Create point-to-point message based integration Create simple or complex event driven workflows Accomplish non-intrusive customization of packaged applications
• Add this powerful tool to your technology stack!
Food For Thought Oracle workflow product is also integrated into new Internal Controls Manager (ICM). Providing a single, integrated compliance repository. (Just in case your CFO or internal auditor asks.)
Big enough to know. Small enough to know better.