You are on page 1of 322

11i/2.

6 Workflow Business
Event System
Student Guide

D11101GC10
Edition 1.0
February 2001
D31495

Copyright Oracle Corporation, 2001. All rights reserved.


This documentation contains proprietary information of Oracle Corporation. It is provided under a license
agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse
engineering of the software is prohibited. If this documentation is delivered to a U.S. Government Agency of the
Department of Defense, then it is delivered with Restricted Rights and the following legend is applicable:
Restricted Rights Legend
Use, duplication or disclosure by the Government is subject to restrictions for commercial computer software
and shall be deemed to be Restricted Rights software under Federal law, as set forth in subparagraph (c)(1)(ii)
of DFARS 252.227-7013, Rights in Technical Data and Computer Software (October 1988).
This material or any portion of it may not be copied in any form or by any means without the express prior
written permission of the Education Products group of Oracle Corporation. Any other copying is a violation of
copyright law and may result in civil and/or criminal penalties.
If this documentation is delivered to a U.S. Government Agency not within the Department of Defense, then it is
delivered with Restricted Rights, as defined in FAR 52.227-14, Rights in Data-General, including Alternate III
(June 1987).
The information in this document is subject to change without notice. If you find any problems in the
documentation, please report them in writing to Worldwide Education Services, Oracle Corporation, 500 Oracle
Parkway, Box SB-6, Redwood Shores, CA 94065. Oracle Corporation does not warrant that this document is
error-free.
Oracle and all references to Oracle Products are trademarks or registered trademarks of Oracle Corporation.
All other products or company names are used for identification purposes only, and may be trademarks of their
respective owners.

Author
Clara Jaeckel
Technical Contributors and Reviewers
Mark Craig, Leta Davis, Kevin Hudson

This book was published using:

Oracle Tutor

Table of Contents
Oracle Workflow Release 2.6................................................................................................1-1
Oracle Workflow Release 2.6 ..............................................................................................1-2
Objectives ............................................................................................................................1-3
Oracle Workflow Release 2.6 ..............................................................................................1-4
Inter-Enterprise Business Processes ....................................................................................1-5
Business Process Based Integration.....................................................................................1-6
Oracle Workflow 2.5 Components ......................................................................................1-7
Oracle Workflow 2.6 Components ......................................................................................1-8
New Features in Release 2.6................................................................................................1-9
Traditional Workflow ..........................................................................................................1-10
Event Based Workflow........................................................................................................1-11
Subscription Based Processing ............................................................................................1-12
Local Event Processing........................................................................................................1-13
Event Processing Through AQ ............................................................................................1-14
System Integration with Oracle Workflow ..........................................................................1-15
Event Based Workflow Processes .......................................................................................1-16
Types of Message Based System Integration ......................................................................1-17
Summary..............................................................................................................................1-18
Overview of the Oracle Workflow Business Event System ................................................2-1
Overview of the Oracle Workflow Business Event System ................................................2-2
Objectives ............................................................................................................................2-3
Business Events ...................................................................................................................2-4
Event Subscriptions .............................................................................................................2-5
Business Event System Components ...................................................................................2-6
Event Manager.....................................................................................................................2-7
Business Event System Architecture ...................................................................................2-8
Communicating Events Between Systems...........................................................................2-9
Event Message Propagation.................................................................................................2-10
Oracle Advanced Queuing, an Enabling Technology..........................................................2-11
Oracle Message Broker, an Enabling Technology...............................................................2-12
Example: Order Processing .................................................................................................2-13
Workflow Engine Event Activities......................................................................................2-14
Review Questions ................................................................................................................2-15
Summary..............................................................................................................................2-16
Events......................................................................................................................................3-1
Events ..................................................................................................................................3-2
Objectives ............................................................................................................................3-3
Business Events ...................................................................................................................3-4
Event Properties...................................................................................................................3-5
Generate Functions ..............................................................................................................3-6
Defining an Event ................................................................................................................3-8
Finding an Event..................................................................................................................3-10
Updating or Deleting an Event ............................................................................................3-11
Business Event System Datatypes .......................................................................................3-12
Event Message Structure .....................................................................................................3-13
Agent Structure....................................................................................................................3-17
Parameter List Structure ......................................................................................................3-18
Parameter Structure .............................................................................................................3-19
Event Groups .......................................................................................................................3-20
Defining an Event Group.....................................................................................................3-21
Raising Events .....................................................................................................................3-23
Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


i

Raising an Event Manually..................................................................................................3-26


Predefined Events ................................................................................................................3-27
Practice 1 Overview.............................................................................................................3-32
Practice 1: Defining an Event ..............................................................................................3-33
Practice 2 Overview.............................................................................................................3-36
Practice 2: Raising an Event ................................................................................................3-37
Summary..............................................................................................................................3-40
Systems and Agents ...............................................................................................................4-1
Systems and Agents.............................................................................................................4-2
Objectives ............................................................................................................................4-3
Systems................................................................................................................................4-4
Local System .......................................................................................................................4-5
Defining a System................................................................................................................4-6
Finding a System .................................................................................................................4-7
Updating or Deleting a System ............................................................................................4-8
Agents..................................................................................................................................4-9
Agent Properties ..................................................................................................................4-11
Standard Queue Handlers ....................................................................................................4-15
Custom Queue Handlers ......................................................................................................4-16
Standard Agents...................................................................................................................4-17
Defining an Agent................................................................................................................4-18
Finding an Agent .................................................................................................................4-20
Updating or Deleting an Agent ............................................................................................4-21
Review Questions ................................................................................................................4-22
Summary..............................................................................................................................4-23
Event Subscriptions ...............................................................................................................5-1
Event Subscriptions .............................................................................................................5-2
Objectives ............................................................................................................................5-3
Event Subscriptions .............................................................................................................5-4
Event Manager Subscription Processing .............................................................................5-5
Subscription Properties........................................................................................................5-6
Subscription Actions: Running a Rule Function.................................................................5-10
Predefined Rule Functions...................................................................................................5-12
Custom Rule Functions........................................................................................................5-13
Subscription Actions: Sending an Event to a Workflow Process .......................................5-15
Subscription Actions: Sending an Event to an Agent .........................................................5-17
Defining a Subscription .......................................................................................................5-18
Finding a Subscription .........................................................................................................5-21
Updating or Deleting a Subscription....................................................................................5-22
Predefined Subscriptions .....................................................................................................5-23
Event APIs...........................................................................................................................5-27
Event Function APIs............................................................................................................5-28
Practice 1 Overview.............................................................................................................5-29
Practice 1: Defining a Subscription .....................................................................................5-30
Summary..............................................................................................................................5-34
Configuring Oracle Workflow for Event Communication ................................................6-1
Configuring Oracle Workflow for Event Communication ..................................................6-2
Objectives ............................................................................................................................6-3
Checking Business Event System Setup..............................................................................6-4
Event Message Communication ..........................................................................................6-7
Agent Listeners....................................................................................................................6-8
Running Listeners................................................................................................................6-10
Scheduling Listeners............................................................................................................6-11
Updating or Deleting a Listener...........................................................................................6-14
Propagations ........................................................................................................................6-15
Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


ii

Scheduling Propagations......................................................................................................6-17
Updating or Deleting a Propagation ....................................................................................6-20
Demonstration......................................................................................................................6-21
Signing Up Systems.............................................................................................................6-22
Retrieving System Identifier Information ............................................................................6-24
Signing Up Systems.............................................................................................................6-25
Synchronizing Systems........................................................................................................6-26
Automatic Replication .........................................................................................................6-28
Master/Copy Systems ..........................................................................................................6-29
Reviewing Event Messages on Local Agents ......................................................................6-30
Review Questions ................................................................................................................6-33
Practice 1 Overview.............................................................................................................6-34
Practice 1: Sending an Event to an Agent............................................................................6-35
Summary..............................................................................................................................6-41
Event Activities in Workflow Processes...............................................................................7-1
Event Activities in Workflow Processes..............................................................................7-2
Objectives ............................................................................................................................7-3
Example: Order Processing .................................................................................................7-4
Event Attribute Type ...........................................................................................................7-5
Defining an Attribute of Type Event ...................................................................................7-6
Event Activities ...................................................................................................................7-7
Event Activity Actions.........................................................................................................7-8
Receive Event Activities......................................................................................................7-9
Raise Event Activities..........................................................................................................7-12
Send Event Activities ..........................................................................................................7-13
Defining an Event Activity ..................................................................................................7-14
Event Details........................................................................................................................7-16
Defining Event Details: Receive..........................................................................................7-17
Defining Event Details: Raise..............................................................................................7-18
Defining Event Details: Send ..............................................................................................7-19
Standard Activities...............................................................................................................7-21
External Java Function Activities ........................................................................................7-24
Defining an External Java Function Activity.......................................................................7-29
Practice 1 Overview.............................................................................................................7-31
Practice 1: Defining an Item Type with an Event Activity ..................................................7-32
Practice 2 Overview.............................................................................................................7-36
Practice 2: Defining a Workflow Process with an Event Activity Node .............................7-37
Practice 3 Overview.............................................................................................................7-41
Practice 3: Launching a Workflow Process from the Business Event System.....................7-42
Summary..............................................................................................................................7-47
Sample Business Event Based Workflow Processes............................................................8-1
Sample Business Event Based Workflow Processes ..........................................................8-2
Objectives ............................................................................................................................8-3
Workflow Agent Ping/Acknowledge...................................................................................8-4
Master Ping Process.............................................................................................................8-7
Detail Ping Process ..............................................................................................................8-8
Workflow Send Protocol .....................................................................................................8-9
Workflow Event Protocol Process.......................................................................................8-13
Example: Order Processing .................................................................................................8-15
Practice 1 Overview.............................................................................................................8-18
Practice 1: Pinging Agents...................................................................................................8-19
Review Questions ................................................................................................................8-22
Summary..............................................................................................................................8-23
Error Handling for Subscription Processing.......................................................................9-1
Error Handling for Subscription Processing ........................................................................9-2
Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


iii

Objectives ............................................................................................................................9-3
Rule Function Status Codes.................................................................................................9-4
Errors in Subscription Processing........................................................................................9-5
WF_ERROR Agent .............................................................................................................9-6
Error Handling Subscriptions ..............................................................................................9-7
Unexpected Events ..............................................................................................................9-8
Default Event Error Process ................................................................................................9-9
Event Warnings ...................................................................................................................9-10
External Event Errors ..........................................................................................................9-11
Local Event Errors...............................................................................................................9-12
Default Event Error Process ................................................................................................9-13
Practice 1 Overview.............................................................................................................9-15
Practice 1: Handling an Error in Subscription Processing ...................................................9-16
Summary..............................................................................................................................9-22
Setting Up the Business Event System .................................................................................10-1
Setting Up the Business Event System ................................................................................10-2
Objectives ............................................................................................................................10-3
Business Event System Setup Steps ....................................................................................10-4
Step 1 Setting Global User Preferences ...............................................................................10-5
Step 2 Starting the Java Function Activity Agent................................................................10-7
Step 3 Setting Up Database Links and Queues....................................................................10-9
Step 4 Setting Up the WF_EVENT_OMB_QH Queue Handler .........................................10-11
Review Questions ................................................................................................................10-12
Summary..............................................................................................................................10-13
Business Event System Summary.........................................................................................11-1
Business Event System Summary........................................................................................11-2
Objectives ............................................................................................................................11-3
Business Event System Components ...................................................................................11-4
Subscription Processing.......................................................................................................11-5
Event Communication .........................................................................................................11-6
Business Process Based Integration.....................................................................................11-7
Review Question 1...............................................................................................................11-8
Answer to Review Question 1 .............................................................................................11-9
Review Question 2...............................................................................................................11-10
Answer to Review Question 2 .............................................................................................11-11
Review Question 3...............................................................................................................11-12
Answer to Review Question 3 .............................................................................................11-13
Review Question 4...............................................................................................................11-14
Answer to Review Question 4 .............................................................................................11-15
Review Question 5...............................................................................................................11-16
Answer to Review Question 5 .............................................................................................11-17
Review Question 6...............................................................................................................11-18
Answer to Review Question 6 .............................................................................................11-19
Review Question 7...............................................................................................................11-20
Answer to Review Question 7 .............................................................................................11-21
Review Question 8...............................................................................................................11-22
Answer to Review Question 8 .............................................................................................11-23
Review Question 9...............................................................................................................11-24
Answer to Review Question 9 .............................................................................................11-25
Review Question 10.............................................................................................................11-26
Answer to Review Question 10 ...........................................................................................11-27
Summary..............................................................................................................................11-28

Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


iv

Preface
Profile
Before You Begin This Course
Before you begin this course, you should have the following qualifications:

Some experience working with Oracle Workflow

Thorough knowledge of Oracle8i and Oracle Internet Application Server


technology

If you plan to use Oracle Workflow with Oracle E-Business Suite,


thorough knowledge of Oracle E-Business Suite

Prerequisites

11i/2.5 Workflow, or

11i/2.5 Workflow Overview

How This Course Is Organized


11i/2.6 Workflow Business Event System is an instructor-led course featuring
lecture and hands-on exercises. Online demonstrations and written practice
sessions reinforce the concepts and skills introduced.

Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


v

Related Publications
Oracle Publications
Title

Part Number

Oracle Workflow Guide Release 2.6

A87449

Additional Publications

System release bulletins

Installation and users guides

read.me files

Oracle Magazine

Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


vi

Typographic Conventions
Typographic Conventions in Text
Convention
Bold italic

Element
Glossary term (if
there is a glossary)

Example
The algorithm inserts the new key.

Caps and
lowercase

Buttons,
check boxes,
triggers,
windows

Click the Executable button.


Select the Cant Delete Card check box.
Assign a When-Validate-Item trigger to the
ORD block.
Open the Master Schedule window.

Courier new,
case sensitive
(default is
lowercase)

Code output,
directory names,
filenames,
passwords,
pathnames,
URLs,
user input,
usernames

Code output: debug.set (I, 300);


Directory: bin (DOS), $FMHOME (UNIX)
Filename: Locate the init.ora file.
Password: User tiger as your password.
Pathname: Open c:\my_docs\projects
URL: Go to http://www.oracle.com
User input: Enter 300
Username: Log on as scott

Initial cap

Graphics labels
(unless the term is a
proper noun)

Customer address (but Oracle Payables)

Italic

Emphasized words
and phrases,
titles of books and
courses,
variables
Interface elements
with long names
that have only
initial caps;
lesson and chapter
titles in crossreferences

Do not save changes to the database.


For further information, see Oracle7 Server
SQL Language Reference Manual.
Enter user_id@us.oracle.com,
where user_id is the name of the user.
Select Include a reusable module component
and click Finish.

Uppercase

SQL column
names, commands,
functions, schemas,
table names

Use the SELECT command to view


information stored in the LAST_NAME
column of the EMP table.

Convention
Arrow

Element
Menu paths

Example
Select File> Save.

Quotation
marks

This subject is covered in Unit II, Lesson 3,


Working with Objects.

Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


vii

Brackets

Key names

Press [Enter].

Commas

Key sequences

Plus signs

Key combinations

Press and release keys one at a time:


[Alternate], [F], [D]
Press and hold these keys simultaneously:
[Ctrl]+[Alt]+[Del]

Typographic Conventions in Code


Convention
Caps and
lowercase
Lowercase

Lowercase
italic
Uppercase

Element
Oracle Forms
triggers
Column names,
table names

Example
When-Validate-Item

Passwords
PL/SQL objects

DROP USER scott


IDENTIFIED BY tiger;
OG_ACTIVATE_LAYER
(OG_GET_LAYER
(prod_pie_layer))

Syntax variables

CREATE ROLE role

SELECT last_name
FROM s_emp;

SQL commands and SELECT userid


FROM emp;
functions

Typographic Conventions in Navigation Paths


This course uses simplified navigation paths, such as the following example, to
direct you through Oracle Applications.
(N) Invoice > Entry > Invoice Batches Summary (M) Query > Find (B) Approve
This simplified path translates to the following:

1.

(N) From the Navigator window, select Invoice > Entry > Invoice Batches
Summary.

2.

(M) From the menu, select Query > Find.

3.

(B) Click the Approve button.

Notations :
(N) = Navigator
(M) = Menu
(T) = Tab
Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


viii

(I) = Icon
(H) = Hyperlink
(B) = Button
Typographical Conventions in Help System Paths
This course uses a navigation path convention to represent actions you perform
to find pertinent information in the Oracle Applications Help System.
The following help navigation path, for example
(Help) General Ledger > Journals > Enter Journals
represents the following sequence of actions:
1.

In the navigation frame of the help system window, expand the General
Ledger entry.

2.

Under the General Ledger entry, expand Journals.

3.

Under Journals, select Enter Journals.

4.

Review the Enter Journals topic that appears in the document frame of the
help system window.

Getting Help
Oracle Applications provides you with a complete online help facility.
Whenever you need assistance, simply choose an item from the Help menu to
pinpoint the type of information you want.
To display help for a current window:
1.

Choose Window Help from the Help menu, click the Help button on the
toolbar, or hold down the Control key and type 'h'.
A web browser window appears, containing search and navigation frames on
the left, and a frame that displays help documents on the right.
The document frame provides information on the window containing the
cursor. The navigation frame displays the top-level topics for your
responsibility, arranged in a tree control.

2.

If the document frame contains a list of topics associated with the window,
click on a topic of interest to display more detailed information.

Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


ix

3.

You can navigate to other topics of interest in the help system, or choose
Close from your web browser's File menu to close help.

Searching for Help


You can perform a search to find the Oracle Applications help information you
want. Simply enter your query in the text field located in the top-left frame of the
browser window when viewing help, then click the adjacent Find button.
A list of titles, ranked by relevance and linked to the documents in question, is
returned from your search in the right-hand document frame. Click on whichever
title seems to best answer your needs to display the complete document in this
frame. If the document doesn't fully answer your questions, use your browser's
Back button to return to the list of titles and try another.

Copyright Oracle Corporation, 2000. All rights reserved.

11i/2.6 Workflow Business Event System Table of Contents


x

Oracle Workflow Release 2.6


Chapter 1

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 1

Oracle Workflow Release 2.6

Oracle Workflow Release 2.6

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Discuss the new features in Oracle Workflow


Release 2.6

Describe the concept of subscription based


processing

Describe the concept of business process based


integration

Discuss different types of message based system


integration supported by the Business Event
System

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 3

Oracle Workflow Release 2.6


Oracle Workflow Release 2.6

Oracle Workflow Release 2.6 with the Business


Event System supports:
Traditional applications-based workflows

E-business integration workflows


Oracle Workflow enables integration that is:
Business process based
Message based

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


A traditional applications-based workflow may model business rules that are
used by a local application, and interact with people using e-mails. For example,
the modeling of an approval hierarchy is a common use of Oracle Workflow in
this scenario.
For e-business, however, there is a requirement to integrate with external
systems, such as sending a document to a business-to-business exchange, or
other systems external to the local application. Release 2.6 of Oracle Workflow
supports e-business integration workflows by allowing business analysts and
developers to model business processes across different systems using a
graphical drag-and-drop designer - the Workflow Builder. This support allows
Oracle Workflow customers to deal with business objects and their integration
flows powerfully and flexibly, with minimal intrusion into the core application.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 4

Inter-Enterprise Business Processes


Inter-Enterprise Business Processes
Supplier A

Bank

Integration
Hub

Integration
Hub
Internet

Integration
Hub

Integration
Hub

Supplier B

Logistics

Copyright Oracle Corporation, 2001. All rights reserved.

Inter-Enterprise Business Processes


In e-business, different enterprises need to communicate with each other over
the Internet. Oracle Workflow with the Business Event System can act as an
integration hub that carries out business rules spanning all the enterprises
involved in a business process.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 5

Business Process Based Integration


Business Process Based Integration

Data Warehouse
Order Entry

Warehouse

Shipping

Human
Resources

WORKFLOW

Accounting

Web Store
Credit
Management

Copyright Oracle Corporation, 2001. All rights reserved.

Business Process Based Integration


Business process based integration is model-driven.
Business rules are expressed in a process model.
These rules define the policy for each end-to-end process.
The process model can encompass applications both within and beyond
the enterprise.
Business process based integration provides:
A global, enterprise-level view of business objects
Business process automation
Oracle Workflow supports business process based integration in Release 2.6
through the Business Event System.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 6

Oracle Workflow 2.5 Components


Oracle Workflow 2.5 Components
Directory
Services

Web
Notification
Worklist

Users

Web
Monitor

Workflow
Builder

iAS
Notification Workflow
Services
Engine

Web
Analysis
Tools
Mail
Applications Notification
Mailer
Browser
Client

Roles

Application
Server

Workflow
Loader

Workflow
Definition
Files

Oracle Workflow
Enabled Application
Oracle Server

Workflow
Workflow
Development
Development
Client
Client

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow 2.5


Workflow Development Client
The development client is a PC running Windows 95, Windows 98, Windows
2000, or Windows NT 4.0 or higher. This platform is used to create and modify
Oracle Workflow process definitions.
Oracle Server
The Oracle Server platform is the Oracle RDBMS. This platform hosts the
business application integrated with Oracle Workflow, the Workflow Engine,
notification services, and directory services.
Application Server
The application server is the environment outside of the RDBMS. This
environment includes ancillary services such as the Oracle Internet Application
Server (iAS) as the web server, and the Notification Mailer.
Browser Client
The browser client is the workstation or PC that an end user uses to perform
daily tasks. This client includes support for reviewing and responding to
notifications in the Notification Worklist, the Oracle Workflow Monitor, web
analysis tools, and mail applications for reviewing and responding to
notifications by e-mail.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 7

Oracle Workflow 2.6 Components


Oracle Workflow 2.6 Components
Advanced
Queuing

Web
Notification
Worklist

Users Roles

Web
Monitor

iAS

Business
Event
System

Web
Analysis
Tools

Workflow
Engine

Workflow
Builder

Workflow
Loader

Notification
Services

Mail
Applications Notification
Mailer
Browser
Client

Directory
Services

Application
Server

Workflow
Definition
Files

Oracle Workflow
Enabled Application
Oracle Server

Workflow
Workflow
Development
Development
Client
Client

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow 2.6


The Business Event System is a new application service added to Oracle
Workflow in Release 2.6. Oracle Workflow now supports both traditional
applications-based workflows and event-based integration workflows.
The Workflow Engine and the Business Event System can function
independently of each other. You can continue to use the Workflow Engine to
execute the processes that model the business rules in your applications, just as
in previous releases. However, you can now achieve the most powerful and
flexible processing by using the Workflow Engine and the Business Event
System together to execute cross-system processes for e-business integration.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 8

New Features in Release 2.6


New Features in Release 2.6

Business Event System


Subscription based processing
Cross-system processing

Support for events in Workflow Engine


New activity type: Event
New attribute type: Event

External Java function activities


New standard activities for event
information
Support for custom Java functions

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 9

Traditional Workflow
Traditional Workflow
Notifications

Create Workflow
APIs

Workflow
Process Engine

Function
Activities

Copyright Oracle Corporation, 2001. All rights reserved.

Traditional Workflow
Traditional workflow processes are launched from a business application using
the WF_ENGINE.CreateProcess and WF_ENGINE.StartProcess APIs. These
workflow processes are made up of notifications and function activities
executed in the core applications system.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 10

Event Based Workflow


Event Based Workflow
Matching Event Subscriptions
Notifications

Raise Event

Workflow
Process Engine

Function
Activities

Copyright Oracle Corporation, 2001. All rights reserved.

Event Based Workflow


The Business Event System in Oracle Workflow 2.6 provides increased
flexibility through subscription based processing: you raise a business event
from an application, but specify the processing to perform for that event as a
subscription in Oracle Workflow. For example, you can now launch a workflow
process when an event is raised by specifying that process in a subscription to
the event. You can also define multiple subscriptions to the same event to
perform additional processing for different purposes, without intruding any
further on the core application.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 11

Subscription Based Processing


Subscription Based Processing
In the Oracle Workflow Business Event System:

Business events in applications trigger event


subscriptions in Oracle Workflow.

Multiple subscriptions can be defined to perform


different processing for the same event.

Subscriptions can be enabled, modified, or


disabled as necessary without intruding into
applications.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 12

Local Event Processing


Local Event Processing
Matching Event Subscriptions

Generate
XML

Workflow
Process
<<extends>>

<<extends>>
Raise
Event

Dispatch
Event

Rule
Custom Rule
Function
Function
<<extends>>
<<extends>>
Send
Event

Transform

Copyright Oracle Corporation, 2001. All rights reserved.

Local Event Processing


Oracle Workflow provides powerful capabilities for controlling the processing
performed by your subscriptions when an event is raised.
The Business Event System can handle event information as XML
documents.
Each event subscription has a rule function that specifies the processing it
performs. In addition to launching a workflow process, a subscription can
also run custom code or send a message from one system to another using
Oracle Advanced Queuing (AQ) propagation.
The Business Event System supports performing transformations on event
messages at propagation time.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 13

Event Processing Through AQ


Event Processing Through AQ
Matching Event Subscriptions

Workflow
Process

Transform

<<extends>>
<<External
System>>
through
AQ

Listener

Dispatch
Event

Rule
Custom Rule
Function
Function
<<extends>>
<<extends>>
Send
Event

Transform

Copyright Oracle Corporation, 2001. All rights reserved.

Event Processing Through AQ


Event subscriptions can also be triggered when an event message is received
from an external source through AQ. The Business Event System supports
performing transformations on event messages when they are received.
By supporting the communication of messages between systems, Oracle
Workflow lets you define processing across different systems encompassing
both your own enterprise and your business partners.
The power of this cross-system processing, together with the flexibility
provided by subscription based processing, enables you to use Oracle Workflow
for e-business integration.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 14

System Integration with Oracle Workflow


System Integration with Oracle Workflow

E-business accelerates the demand for system


integration.

Communication is required between systems both


within and beyond the enterprise.

Oracle Workflow supports e-business integration


workflows in addition to traditional applicationsbased workflows.
Event based workflows allow modeling
of cross-system processes,
enabling business process
based integration.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 15

Event Based Workflow Processes


Event Based Workflow Processes
Transform
XML

Route on
XML

Get XML
Tag Value
Set Header
Property

<<Business
Event
System>>

Route on
Header
Workflow Process
Get Header
Property
Receive
Event

Raise
Event

Send
Event

Copyright Oracle Corporation, 2001. All rights reserved.

Event Based Workflow Processes


Event based workflow processes control and route objects between applications
according to business rules. These workflow processes support:
Receiving events to launch or continue processes
Raising new events
Sending event messages for inter-system communication
Accessing and routing on header properties of event messages
Accessing and routing on XML content within event messages
By letting you model processes across different systems, event based workflows
enable business process based integration.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 16

Types of Message Based System Integration


Types of Message Based System
Integration
The Business Event System supports integration in
which applications are loosely coupled through
asynchronous messaging.
Point-to-point system integration"Hardwired"
communication between specified systems

Messaging hub system integrationIntersystem


communication routed through a central hub for
more complex integration scenarios

Distributed applications messagingMaster/copy


replication of data for distributed applications

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 17

Summary
Summary
In this lesson, you should have learned how to:

Discuss the new features in Oracle Workflow


Release 2.6

Describe the concept of subscription based


processing

Describe the concept of business process based


integration

Discuss different types of message based system


integration supported by the Business Event
System

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Workflow Release 2.6


Chapter 1 - Page 18

Overview of the Oracle


Workflow Business Event
System
Chapter 2

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 1

Overview of the Oracle Workflow Business Event


System

Overview of the Oracle Workflow


Business Event System

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Discuss the concepts of a business event and an


event subscription.

Describe how the Business Event System


communicates events between systems.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 3

Business Events
Business Events

A business event is an occurrence in an


application or program that might be significant to
other objects in a system or to external agents.
For instance, the creation of a purchase order is
an example of a business event in a purchasing
application.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 4

Event Subscriptions
Event Subscriptions

An event subscription is a registration indicating


that a particular event is significant to a system
and specifying the processing to perform when
the triggering event occurs.

Subscriptions can include the following types of


processing:
Executing custom code on the event
information
Sending event information to a
workflow process
Sending event information to other
communication agents or systems

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 5

Business Event System Components


Business Event System Components
The Business Event System includes:

The Event ManagerLets you register:


Business events
Systems
Named communication agents
within systems
Subscriptions to events that are
significant to your systems

Workflow Engine event activities


Let you model business events within
workflow processes

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 6

Event Manager
Event Manager
Application

Business
Event

RAISE
Local Events

Matching Event
Subscriptions
Phase 1

Event
Dispatcher
LISTEN
External Events

Phase n
Business
Event

AQ

Copyright Oracle Corporation, 2001. All rights reserved.

Event Manager
When an event is raised by a local application, or when an event is received
from an external source through Oracle Advanced Queuing (AQ), it is
processed by a component of the Event Manager called the Event Dispatcher.
In both cases, the Event Dispatcher searches for and executes any subscriptions
to that event. If there are multiple subscription to the same event, a subscription
property called the phase value determines the order in which the subscriptions
are executed.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 7

Business Event System Architecture


Business Event System Architecture
ORACLE8i

Workflow
Engine

S
Y
S
T
E
M

Business
Event
System
Business
Events

Business
Events

Business
Events

Advanced Queuing

S
Y
S
T
E
M

Business
Events

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Architecture


Oracle Workflow with the Business Event System can act as a system
integration messaging hub that relays business event messages among systems.
The Business Event System leverages Oracle Advanced Queuing (AQ) to send
messages from one system to another.
For the greatest flexibility in routing and processing business events, you can
model your business process logic in workflow processes that are executed by
the Workflow Engine. However, the Business Event System can also function
independently of the Workflow Engine.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 8

Communicating Events Between Systems


Communicating Events Between Systems

Systems contain named points of communication


called agents.

Communication within and between systems is


accomplished by sending an event message from
one agent to another.

The Business Event System interacts with an


agent through Oracle Advanced Queuing.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 9

Event Message Propagation


Event Message Propagation

The Business Event System leverages Oracle


Advanced Queuing (AQ) to propagate event
messages by the SQLNET protocol.
You can also implement an external service, such
as Oracle Message Broker, to propagate messages
by a different protocol.
Integration with Oracle Message Broker provides
support for HTTP and HTTPS protocols and
enables integration with third party messaging
solutions.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 10

Oracle Advanced Queuing, an Enabling Technology


Oracle Advanced Queuing, an Enabling
Technology
Application

ORACLE
Advanced
Queuing

Application

M
A
C Propagate
H
I
N
E
B
O
U
N
D
A Propagate
R
Y

ORACLE
Advanced
Queuing

Application

MACHINE BOUNDARY
ORACLE
Advanced
Queuing

Application

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Advanced Queuing, an Enabling Technology


Oracle Advanced Queuing (AQ) allows queue-to-queue propagation across
machine boundaries.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 11

Oracle Message Broker, an Enabling Technology


Oracle Message Broker, an Enabling
Technology
http/https

Oracle Message
Broker

Oracle8i

Advanced
Queuing

Third party messaging solutions

OMB
Compliant
Message
Formats

Copyright Oracle Corporation, 2001. All rights reserved.

Oracle Message Broker, an Enabling Technology


Integrate with Oracle Message Broker is critical for supporting communication
by HTTP and HTTPS protocols and integration with third party messaging
solutions.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 12

Example: Order Processing


Example: Order Processing

Copyright Oracle Corporation, 2001. All rights reserved.

Example: Order Processing


This example shows a workflow process that includes business events. The
example comes from the Event System Demonstration workflow. This process
includes activities that receive purchase order events to launch the workflow, as
well as activities that send other events in response to the order, such as an order
acknowledgement, advanced shipment notice, and invoice.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 13

Workflow Engine Event Activities


Workflow Engine Event Activities

Event activities represent business events within


workflow processes.

Event activities can:


Receive an event from the Event Manager to
start or continue a workflow process
Raise an event to the Event Manager,
triggering subscriptions to that event
Send an event message to a Business
Event System agent

You can use workflow processes to


model complex processing or routing
logic based on the contents of an event.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 14

Review Questions
Review Questions
1. What is the definition of a business event?
2. What is the definition of an event subscription?
3. How does the Business Event System interact with
a communication agent on a system?
4. What protocols can be used to propagate event
messages?
5. What are the three possible actions for an event
activity within a workflow process?

Copyright Oracle Corporation, 2001. All rights reserved.

Review Questions and Solutions


1. What is the definition of a business event?
A business event is an occurrence in an application or program that
might be significant to other objects in a system or to external agents.
2. What is the definition of an event subscription?
An event subscription is a registration indicating that a particular
event is significant to a system and specifying the processing to
perform when the triggering event occurs.
3. How does the Business Event System interact with a communication agent
on a system?
The Business Event System uses an AQ queue to interact with an
agent.
4. What protocols can be used to propagate event messages?
The Business Event System can use AQ to propagate event messages
by the SQLNET protocol. Oracle Workflow also integrates with
Oracle Message Broker to support propagation by HTTP and HTTPS
communication protocols. Additionally, you can implement an
external service to propagate messages by a custom protocol.
5. What are the three possible actions for an event activity within a workflow
process?
An event activity can receive, raise, or send an event.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 15

Summary
Summary
In this lesson, you should have learned how to:

Discuss the concepts of a business event and an


event subscription.

Describe how the Business Event System


communicates events between systems.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Overview of the Oracle Workflow Business Event System


Chapter 2 - Page 16

Events
Chapter 3

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 1

Events

Events

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Define individual events.

Define event groups.

Describe the abstract datatypes used by the


Business Event System.
Raise events.
Use predefined Oracle Workflow events.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 3

Business Events
Business Events

Define your significant business events in the


Event Manager.

When an event occurs in an application on your


local system:
The application must assign an event key to
uniquely identify that particular instance of the
event.
The event must be raised to the Event
Manager.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 4

Event Properties
Event Properties
A business event definition in the Event Manager
includes the following properties:

Internal NameThe internal name for an event


must be unique and is case-sensitive. The
following format is suggested:
<company>.<family>.<product>.<component>.
<object>.<event>

Display Name
Generate FunctionA function that can
generate the complete event data from
the event key

Copyright Oracle Corporation, 2001. All rights reserved.

Event Properties
Some examples of event names are:
oracle.apps.wf.event.event.create
oracle.apps.wf.event.event.delete
oracle.apps.wf.event.subscription.create
These events are predefined events within the Business Event System. For more
information, refer to the Predefined Workflow Events chapter in the Oracle
Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 5

Generate Functions
Generate Functions

Any detail information needed to describe what


occurred in an event, in addition to the event name
and event key, is called the event data.
Event data is typically structured as an XML
document.

A Generate function for an event is a function that


can produce the complete event data from the
event key.

Generate functions must follow a standard API.

Copyright Oracle Corporation, 2001. All rights reserved.

Generate Functions
The event data is stored as a character large object (CLOB).
The application where an event occurs can include the event data when
raising the event to the Event Manager.
If the application will not provide the event data, you should specify a
Generate function for the event.
If an application raises an event without providing the event data, and any
subscriptions to the event require the event data, the Event Manager calls
the Generate function to produce the event data.
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.
Standard API
A Generate function for an event must have the following standard API:
function <function_name> (p_event_name in varchar2,
p_event_key in varchar2) return clob;
Arguments:
p_event_nameThe internal name of the event.
p_event_keyA string generated when the event occurs within a program
or application. The event key uniquely identifies a specific instance of the
event.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 6

For more information, refer to the Defining Procedures and Functions for
Oracle Workflow chapter in the Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 7

Defining an Event
Defining an Event

Copyright Oracle Corporation, 2001. All rights reserved.

To Define an Event:
1. Use a web browser to connect to the following URL:
<webagent>/wf_event_html.listevents
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Events web page from the Oracle Workflow home
page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. The Events page appears, displaying a list of existing events.
Choose the Add Event button to open the Edit Event page.
3. Enter the internal name of the event in the Name field.
4. Enter a display name for the event.
5. Enter an optional description for the event.
6. In the Status field, select Enabled or Disabled as the event status. If you
disable an event, it still remains in the Events list for reference, but you
cannot use the event in active subscriptions.
7. If you are defining an event that occurs on your local system, enter the
Generate function for the event.
8. If you use a program to create event definitions automatically, the Event
Manager displays owner information set by that program in the Owner
Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 8

Name and Owner Tag fields. You can use the Edit Event page to update
this information manually if necessary.
9. Choose the Submit button to save the event.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 9

Finding an Event
Finding an Event

Use the Find Event/Group page to locate a specific


event or event group definition.

Search for events by entering the following


criteria:
Name
Display Name
Status
Type

Copyright Oracle Corporation, 2001. All rights reserved.

Finding an Event
To access the Find Event/Group web page, use a web browser to connect to the
following URL:
<webagent>/wf_event_html.findevent
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
You can also access the Find Event/Group web page from the Oracle Workflow
home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the Event
Manager web pages.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 10

Updating or Deleting an Event


Updating or Deleting an Event
Locate the event you want in the Events page.

To view the subscriptions to an event, choose the


schedule icon in the Subs column for that event.

To update an event, choose the pencil icon in the


Edit column for that event.

To delete an event, choose the trash icon in the


Delete column for that event, and choose OK in
the confirmation window that appears.

Copyright Oracle Corporation, 2001. All rights reserved.

Updating or Deleting an Event


To access the Events web page, use a web browser to connect to the following
URL:
<webagent>/wf_event_html.listevents
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
You can also access the Events web page from the Oracle Workflow home
page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the Event
Manager web pages.
Subscriptions to an Event
For events that do not have any subscriptions yet, a blank schedule icon appears.
For events that do have subscriptions referencing them, a full schedule icon
appears.
You can begin defining a new subscription on the event by choosing the Add
Subscription button in the Event Subscriptions page. The Edit Subscription page
appears with the event name automatically entered in the Event Filter field.
Deleting an Event
You can only delete events that do not have any subscriptions referencing them
and that are not members of any event group.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 11

Business Event System Datatypes


Business Event System Datatypes
Oracle Workflow uses the following abstract
datatypes to model the structure and behavior
of Business Event System data.
Event message structure: WF_EVENT_T

Agent structure: WF_AGENT_T


Parameter list structure: WF_PARAMETER_LIST_T
Parameter structure: WF_PARAMETER_T

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 12

Event Message Structure


Event Message Structure

Oracle Workflow uses the object type


WF_EVENT_T to store event messages.

WF_EVENT_T contains all the header properties of


an event message as well as the event data
payload.

Internally, the Business Event System and the


Workflow Engine can only communicate events in
this format.

Copyright Oracle Corporation, 2001. All rights reserved.

WF_EVENT_T Attributes
Attribute Name: PRIORITY
Datatype: NUMBER
Description: The priority with which the message recipient should dequeue the
message. A smaller number indicates a higher priority.
Attribute Name: SEND_DATE
Datatype: DATE
Description: The date and time when the message is sent. This attribute is
reserved for future use.
Attribute Name: RECEIVE_DATE
Datatype: DATE
Description: The date and time when the message is dequeued. This attribute is
reserved for future use.
Attribute Name: CORRELATION_ID
Datatype: VARCHAR2(240)
Description: 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

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 13

is set for the correlation ID, then that value is used as the item key if the event is
sent to a workflow process.
Attribute Name: PARAMETER_LIST
Datatype: WF_PARAMETER_ LIST_T
Description: A list of additional parameter name and value pairs.
Attribute Name: EVENT_NAME
Datatype: VARCHAR2(240)
Description: The internal name of the event.
Attribute Name: EVENT_KEY
Datatype: VARCHAR2(240)
Description: The string that uniquely identifies the instance of the event.
Attribute Name: EVENT_DATA
Datatype: CLOB
Description: A set of additional details describing what occurred in the event.
The event data can be structured as an XML document.
Attribute Name: FROM_AGENT
Datatype: WF_AGENT_T
Description: The agent from which the event is sent. For locally raised events,
this attribute is initially null.
Attribute Name: TO_AGENT
Datatype: WF_AGENT_T
Description: The agent to which the event should be sent (the message
recipient).
Attribute Name: ERROR_ SUBSCRIPTION
Datatype: RAW(16)
Description: If an error occurs while processing this event, this is the
subscription that was being executed when the error was encountered.
Attribute Name: ERROR_MESSAGE
Datatype: VARCHAR2(4000)
Description: An error message that the Event Manager generates if an error
occurs while processing this event.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 14

Attribute Name: ERROR_STACK


Datatype: VARCHAR2(4000)
Description: 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 must call the Initialize method before you can perform any further
manipulation on a new WF_EVENT_T object.
Initialize
getPriority
getSendDate
getReceiveDate
getCorrelationID
getParameterList
getEventName
getEventKey
getEventData
getFromAgent
getToAgent
getErrorSubscription
getErrorMessage
getErrorStack
setPriority
setSendDate
setReceiveDate
setCorrelationID
setParameterList
setEventName
setEventKey
setEventData
setFromAgent
setToAgent
setErrorSubscription
setErrorMessage
setErrorStack
Content
Address
AddParameterToList
Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 15

GetValueForParameter
For more information, refer to the Oracle Workflow APIs chapter in the Oracle
Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 16

Agent Structure
Agent Structure

Oracle Workflow uses the object type


WF_AGENT_T to store information about a named
communication agent on a system.
Event messages reference agent information in
the format defined by the WF_AGENT_T datatype.

Copyright Oracle Corporation, 2001. All rights reserved.

WF_AGENT_T Attributes
Attribute Name: NAME
Datatype: VARCHAR2(30)
Description: The name of the agent.
Attribute Name: SYSTEM
Datatype: VARCHAR2(30)
Description: The system where the agent is located.
The WF_AGENT_T object type also includes the following methods, which
you can use to retrieve and set the values of its attributes.
getName
getSystem
setName
setSystem
For more information, refer to the Oracle Workflow APIs chapter in the Oracle
Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 17

Parameter List Structure


Parameter List Structure

Oracle Workflow uses the named varying array


WF_PARAMETER_LIST_T to store a list of
parameters in a form that can be included in an
event message.

WF_PARAMETER_LIST_T allows custom values to


be added to the WF_EVENT_T event message
object.

The WF_PARAMETER_LIST_T datatype can


include up to 100 parameter name and value pairs.

Copyright Oracle Corporation, 2001. All rights reserved.

WF_PARAMETER_LIST_T
Maximum size: 100
Element datatype: WF_PARAMETER_T
When WF_PARAMETER_LIST_T is used within a WF_EVENT_T structure,
you can use the following WF_EVENT_T methods to add and retrieve
parameters in the list.
AddParameterToList
GetValueForParameter
When an event message that includes a parameter list is sent to a workflow
process, the parameters in the list are created as item attributes for the workflow
process.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 18

Parameter Structure
Parameter Structure

Oracle Workflow uses the object type


WF_PARAMETER_T to store a parameter name
and value pair in a form that can be included in an
event message parameter list.

WF_PARAMETER_T allows custom values to be


added to the WF_EVENT_T event message object.

Copyright Oracle Corporation, 2001. All rights reserved.

WF_PARAMETER_T Attributes
Attribute Name: NAME
Datatype: VARCHAR2(30)
Description: The parameter name.
Attribute Name: VALUE
Datatype: VARCHAR2(2000)
Description: The parameter value.
The WF_PARAMETER_T object type also includes the following methods,
which you can use to retrieve and set the values of its attributes.
getName
getValue
setName
setValue
For more information, refer to the Oracle Workflow APIs chapter in the Oracle
Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 19

Event Groups
Event Groups

Event groups let you associate any events you


want with each other and reference them as a
group in event subscriptions.
An event group is a type of event composed of a
set of individual member events.

Once you have defined an event group, you can


register a subscription on the group rather than
having to create separate subscriptions for each
individual event within it.

The subscription will be executed


whenever any one of the group's
member events occurs.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Groups
The internal names of event groups should follow the same format as the
names of individual events.
Event groups cannot be used to raise events. You must raise each event
individually.
An event group can contain only individual events as its members. It
cannot contain another group.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 20

Defining an Event Group


Defining an Event Group

Copyright Oracle Corporation, 2001. All rights reserved.

To Define an Event Group:


1. Use a web browser to connect to the following URL:
<webagent>/wf_event_html.listevents
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Events web page from the Oracle Workflow home
page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. The Events page appears, displaying a list of existing events. Choose the
Add Group button to open the Edit Group page.
3. Enter the internal name of the event group in the Name field.
4. Enter a display name for the event group.
5. Enter an optional description for the event group.
6. In the Status field, select Enabled or Disabled as the event group status. If
you disable an event group, it still remains in the Events list for reference,
but you cannot use the event group in active subscriptions.
7. If you use a program to create event definitions automatically, the Event
Manager displays owner information set by that program in the Owner
Name and Owner Tag fields. You can use the Edit Group page to update
this information manually if necessary.
8. Choose the Submit button to save the event group.
Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 21

After you save the event group definition, the Edit Group page displays
the list of member events for that group.
9. To add a member event to the group, choose the Add Event button.
10. In the Add to Group page that appears, enter search criteria to locate the
event you want to add. The search criteria are:
Nameenter the internal name of the event you want to add.
Display Nameenter the display name of the event you want to add.
Statuschoose Enabled or Disabled as the status of the event you
want to add. Choose Any to search for events of any status.
11. Choose the Go button. The Add to Group page displays a list of events
that match your search criteria.
12. Select the event or events that you want to add to your event group.
13. Choose the Add button to add the selected events to your event group. The
Edit Group page appears, displaying the updated list of event group
members.
14. Choose the Submit button to save the event group definition.
15. If you want to remove a member event from the group, select the event or
events you want to delete in the Edit Group page.
16. Choose the Delete button to remove the selected events from your event
group. The Edit Group page displays the updated list of event group
members.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 22

Raising Events
Raising Events

Events can be raised by the following methods:


From the application where the event occurs,
using the WF_EVENT.Raise() API
From a workflow process, using a Raise event
activity
From the Raise Event web page, by manual
submission, if the event does not require
additional parameters

When an event is raised, the Event Manager


searches for and executes subscriptions
to that event.

Copyright Oracle Corporation, 2001. All rights reserved.

Raising Events
To raise an event, you must provide the event name and an event key to identify
the instance of the event. You can optionally provide a CLOB containing the
event data.
Also, if you use the WF_EVENT.Raise API, you can optionally provide a list of
additional header parameters for the event in the WF_PARAMETER_LIST_T
format.
Example
The following example code shows how to use the WF_EVENT.Raise API to
raise an event from an application.
declare
l_xmldocument varchar2(32000);
l_eventdata clob;
l_parameter_list wf_parameter_list_t;
l_message varchar2(10);
begin
/*
** If the complete event data is easily available,
Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 23

** we can optionally test if any subscriptions to


** this event require it (rule data = Message).
*/
l_message := wf_event.test('<EVENT_NAME>');
/*
**
**
**
**
**
*/

If we do require the complete event data, and we


have the data now, set it; else we can just rely
on the Event Generate Function callback code.
Then Raise the Event with the required
parameters.

if l_message = 'MESSAGE' then


if l_xmldocument is not null then
dbms_lob.createtemporary(l_eventdata, FALSE,
DBMS_LOB.CALL);
dbms_lob.write(l_eventdata,
length(l_xmldocument), 1 ,l_xmldocument);
-- Raise the Event with the message
wf_event.raise(
p_event_name => '<EVENT_NAME>',
p_event_key => '<EVENT_KEY>',
p_event_data => l_eventdata,
p_parameters => l_parameter_list);
else
-- Raise the Event without the message
wf_event.raise(
p_event_name => '<EVENT_NAME>',
p_event_key => '<EVENT_KEY>',
p_parameters => l_parameter_list);
end if;
elsif
l_message = 'KEY' then
-- Raise the Event
wf_event.raise(
p_event_name => <EVENT_NAME>,
p_event_key => <EVENT_KEY>,
Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 24

p_parameters => l_parameter_list);


end if;
/*
** Up to your own custom code to commit the
** transaction
*/
commit;
/*
** Up to your own custom code to handle any major
** exceptions
*/
exception
when others then
null;
end;

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 25

Raising an Event Manually


Raising an Event Manually

Copyright Oracle Corporation, 2001. All rights reserved.

To Raise an Event:
1. Use a web browser to connect to the following URL:
<webagent>/wf_event_html.entereventdetails
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Raise Events web page from the Oracle Workflow
home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. The Raise Event page appears.
3. In the Event Name field, select the event that you want to raise.
4. Enter an event key that uniquely identifies this instance of the event.
5. Optionally enter event data to describe what occurred in the event.
Note: The maximum length of the data you can enter in the Event Data
field is 32 kilobytes. If the event data exceeds 32 Kb, you should assign a
Generate function in the event definition to generate the event data, rather
than entering the data directly in the Event Data field.
6. Choose the Submit button to raise the event to the Event Manager. Oracle
Workflow raises the event and displays a confirmation message with the
event name and event key. Choose the OK button.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 26

Predefined Events
Predefined Events

Oracle Workflow provides several predefined


events for significant occurrences within the
Business Event System.
You can define subscriptions to these events for
replication, validation, or other purposes.
Some predefined events are referenced by default
subscriptions that are created automatically when
you install Oracle Workflow.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 27

Predefined Events
Predefined Events
Predefined Workflow events include:
Agent Created
Event Created
Event Updated
Agent Updated

Event Deleted
Event Group Creation
Event Group Updated
Event Group Deleted

Agent Deleted
Subscription Created
Subscription Updated
Subscription Deleted

System Created
System Updated
System Deleted

Copyright Oracle Corporation, 2001. All rights reserved.

Predefined Events
These predefined events are raised whenever an Event Manager object
definition is created, updated, or deleted. These events are used for replication
of Business Event System data from one system to another.
Individual Event or Event Group Definition Events
Event Created
Event Updated
Event Deleted
Event Group Member Definition Events
Event Group Creation
Event Group Updated
Event Group Deleted
System Definition Events
System Created
System Updated
System Deleted
Agent Definition Events
Agent Created
Agent Updated
Agent Deleted
Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 28

Event Subscription Definition Events


Subscription Created
Subscription Updated
Subscription Deleted
For more information, refer to the Predefined Workflow Events chapter in the
Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 29

Predefined Events
Predefined Events
Predefined Workflow events include:
Ping Agent
Synchronize Event
Systems
Acknowledge Ping
Seed Event Group
Workflow Send

System Signup

Protocol

Any
Unexpected

Workflow Send
Protocol
Acknowledgement

Copyright Oracle Corporation, 2001. All rights reserved.

Predefined Events
Synchronize Event Systems Event
This event is used to synchronize the Event Manager data on the local system
with another system.
Seed Event Group
This event group contains events used for automatic replication of Business
Event System objects from one system to another. The group includes all the
event, event group, system, agent, and subscription definition events, as well as
the Synchronize Event Systems event.
System Signup Event
This event is used to sign up a destination system for receiving event messages
from the source system.
Any Event
This event is raised implicitly when any other event is raised locally or received
from an external source.
Unexpected Event
The Event Manager executes subscriptions to this event when another event is
raised locally or received from an external source, but no subscription to that
other event exists.
Ping Agent Events
Ping AgentThis event is used in the Workflow Agent
Ping/Acknowledge process to ping inbound agents.
Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 30

Acknowledge PingThis event is used in the Workflow Agent


Ping/Acknowledge process to acknowledge receipt of a Ping Agent event
message.
Workflow Send Protocol Events
Workflow Send ProtocolThis event is used with the Workflow Send
Protocol process to send the event message to an agent.
Workflow Send Protocol AcknowledgementThis event is used with the
Workflow Send Protocol process to acknowledge receipt of an event
message.
For more information, refer to the Predefined Workflow Events chapter in the
Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 31

Practice 1 Overview
Practice 1 Overview
This practice covers defining an event in the Event
Manager.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 32

Practice 1: Defining an Event


Practice 1:
Defining an Event
Define an event with the following properties:
Internal name:
XX.oracle.workflow.bes.event.new
Display name: XX New Event
Description: XX New Event
Replace XX with your terminal number.

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
In this practice you will create an event definition in the Event Manager. After
completing the practice, you should be able to see your event listed in the
Events page.
Note: Because many students access the system and create objects during this
course, you need a way to distinguish between the objects created by you and by
your classmates. Therefore, you will be assigned a terminal number by your
instructor. Use this number as a prefix wherever you see XX included in the
name of something you are defining. In this way, you can ensure that the
definitions you create are unique.
1. Use a web browser to connect to the Oracle Workflow home page with the
URL provided by the instructor. Log in as any user with workflow
administrator privileges.
2. Choose the Events link.
3. In the Events page, choose the Add Event button to open the Edit Event
page.
4. In the Name field, enter XX.oracle.workflow.bes.event.new as the internal
name of the event.
5. In the Display Name field, enter XX New Event.
6. In the Description field, enter XX New Event.
7. In the Status field, select Enabled.
8. Leave the Generate Function, Owner Name, and Owner Tag fields blank.
Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 33

9. Choose the Submit button to save the event.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 34

Practice 1: Defining an Event


Practice 1:
Defining an Event

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you complete this practice, the event definition should look similar to
this.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 35

Practice 2 Overview
Practice 2 Overview
This practice covers raising an event from the Raise
Event web page.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 36

Practice 2: Raising an Event


Practice 2:
Raising an Event
Raise an event with the following properties:
Event name: oracle.apps.wf.event.wf.send
Event key: XX32
Replace XX with your terminal number.

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 2 Solution
In this practice, you will raise an event manually from the Raise Event page.
The event you raise should trigger a predefined subscription that launches a
workflow process. The focus of this practice is on using the Raise Event page;
however, you can review the workflow process in the Workflow Monitor to
confirm that the event was raised successfully.
1. Use a web browser to connect to the Oracle Workflow home page with the
URL provided by the instructor. Log in as any user with workflow
administrator privileges.
2. Choose the Raise Event link.
3. In the Event Name field, select oracle.apps.wf.event.wf.send. This is the
predefined Workflow Send Protocol event used in the Workflow Send
Protocol process.
4. In the Event Key field, enter a unique event key such as XX32.
5. For the purposes of this practice, since you will not perform further
processing on this event, you do not need to enter any event data. Leave
the Event Data field blank.
6. Choose the Submit button to raise the event.
7. Choose OK in the confirmation window.
When the oracle.apps.wf.event.wf.send event is raised on the local system,
it triggers a predefined subscription that sends the event to the Workflow
Send Protocol process. However, since you did not specify a recipient for
Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 37

the event message in the subscription, the process will simply complete
without performing any further processing.
You can review the status of the process in the Workflow Monitor by
choosing the Find Processes link from the Workflow home page and
searching for the process with the Workflow Send Protocol item type and
with your event key as the item key.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 38

Practice 2: Raising an Event


Practice 2:
Raising an Event

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 2 Solution
When you raise your event for this practice, the raise event details should look
similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 39

Summary
Summary
In this lesson, you should have learned how to:

Define individual events.


Describe the abstract datatypes used by the
Business Event System.
Define event groups.
Raise events.
Use predefined Oracle Workflow events.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Events
Chapter 3 - Page 40

Systems and Agents


Chapter 4

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 1

Systems and Agents

Systems and Agents

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Define systems.
Define communication agents on systems.
Associate queues and queue handlers with
agents.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 3

Systems
Systems

A system is a logically isolated software


environment such as a host machine or database
instance.
Define each system to or from which you will
communicate events in the Event Manager.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 4

Local System
Local System

When you install Oracle Workflow in a database,


that database is automatically defined as a system
in the Event Manager.
The system name is set to the database global
name.
This system is automatically set as the local
system in the Global Workflow Preferences page.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 5

Defining a System
Defining a System

Copyright Oracle Corporation, 2001. All rights reserved.

To Define a System:
1. Use a web browser to connect to the following URL:
<webagent>/wf_event_ html.listsystems
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Systems web page from the Oracle Workflow
home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. The Systems page appears, displaying a list of existing systems. An
asterisk marks the local system.
Choose the Add System button to open the Edit System page.
3. Enter the internal name of the system in the Name field.
Note: The internal name must be all-uppercase and should not include any
single or double quotation marks (' or ") or spaces.
4. Enter a display name for the system.
5. Enter an optional description for the system.
6. Optionally select a master system from which you want this system to
receive Event Manager object definition updates. Click on the Master
field's up arrow icon to display a list of systems from which to choose.
7. Choose the Submit button to save the system.
Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 6

Finding a System
Finding a System

Use the Find System page to locate a specific


system definition.

Search for systems by entering the following


criteria:
Name
Display Name
Master

Copyright Oracle Corporation, 2001. All rights reserved.

Finding a System
To access the Find System web page, use a web browser to connect to the
following URL:
<webagent>/wf_event_html.findsystem
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
You can also access the Find System web page from the Oracle Workflow home
page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the Event
Manager web pages.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 7

Updating or Deleting a System


Updating or Deleting a System
Locate the system you want in the Systems page.

To view the subscriptions for a system, choose


the schedule icon in the Subs column for that
system.

To update a system, choose the pencil icon in the


Edit column for that system.

To delete a system, choose the trash icon in the


Delete column for that system, and
choose OK in the confirmation
window that appears.

Copyright Oracle Corporation, 2001. All rights reserved.

Updating or Deleting a System


To access the Systems web page, use a web browser to connect to the following
URL:
<webagent>/wf_event_html.listsystems
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
You can also access the Systems web page from the Oracle Workflow home
page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the Event
Manager web pages.
Subscriptions to a System
For systems that do not have any subscriptions yet, a blank schedule icon
appears. For systems that do have subscriptions referencing them, a full
schedule icon appears.
You can begin defining a new subscription for the system by choosing the Add
Subscription button in the Event Subscriptions page. The Edit Subscription page
appears with the system name automatically entered in the System field.
Deleting a System
You can only delete systems that do not have any agents defined on them or any
subscriptions referencing them.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 8

Agents
Agents

An agent is a named point of communication


within a system.

A single system can have several different agents


representing different communication alternatives,
such as different protocols or propagation
frequencies.

Define each agent that you will use to


communicate events in the Event
Manager.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 9

Agents
Agents

Communication within and between systems is


accomplished by sending a message from one
agent to another.
Each agent on a Workflow-enabled system is
associated with an AQ queue.
The Business Event System interacts with the
agent by enqueuing or dequeuing event messages
on its queue.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 10

Agent Properties
Agent Properties
An agent definition in the Event Manager includes the
following properties:

Internal NameMust be unique within the agents


system

Display Name
System

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 11

Agent Properties
Agent Properties
An agent definition in the Event Manager includes the
following properties:

DirectionEither inbound or outbound


communication on the agents system

ProtocolCommunication protocol that specifies


how messages are encoded and transmitted

AddressAddress at which systems can


communicate with an inbound agent

Copyright Oracle Corporation, 2001. All rights reserved.

Agent Properties
Direction
An agent can support only one direction of communication on its system:
InThe agent receives messages in a specific protocol and presents them
to the system in a standard format.
OutThe agent accepts messages from the system in a standard format
and sends them using the specified protocol.
Protocol
For a message to be successfully communicated, the sending and receiving
agents must use the same protocol.
You can either use AQ to perform the propagation of messages by the SQLNET
protocol which it supports, or you can implement an external service, such as
Oracle Message Broker, to propagate messages by a different protocol.
Integration with Oracle Message Broker provides support for HTTP and HTTPS
protocols and enables integration with third party messaging solutions.
Address
The address format for an inbound agent depends on the agent's protocol. For
agents that use the SQLNET protocol, the address must be in the following
format:
<schema>.<queue>@<database link>
In this format, <schema> represents the schema that owns the queue, <queue>
represents the name of the queue associated with the agent, and <database link>
Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 12

represents the name of the database link to the instance where the queue is
located.
Note: You must enter the database link name exactly as the name was specified
when the database link was created. The names of the database links that you
want to use for the Business Event System should be fully qualified with the
domain names.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 13

Agent Properties
Agent Properties
An agent definition in the Event Manager includes the
following properties:

QueueAQ queue used by the Business Event


System to interact with the agent

Queue HandlerPL/SQL package that translates


between the standard Workflow event message
format and the format required by the agent's
queue

Copyright Oracle Corporation, 2001. All rights reserved.

Agent Properties
Queue
Each agent on a Workflow-enabled system should be associated with an AQ
queue.
Outbound agentTo send messages, the system enqueues the messages
on the queue and sets the recipient addresses.
Inbound agent To receive messages, the system runs a queue listener on
the queue.
Specify the queue using the following format:
<schema>.<queue>
<schema> represents the schema that owns the queue and <queue> represents
the queue name.
Queue Handler
Event messages within the Business Event System are encoded in a standard
format defined by the datatype WF_EVENT_T. You must assign each agent a
queue handler to enqueue and dequeue messages on the agents queue,
translating between the standard Workflow format and the format required by
the queue.
You can either use a queue handler provided by Oracle Workflow or create your
own custom queue handler.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 14

Standard Queue Handlers


Standard Queue Handlers

WF_EVENT_QH
Use for normal Business Event System processing
with queues using SQLNET propagation and the
payload type WF_EVENT_T

WF_ERROR_QH
Use for error queues with SQLNET propagation
and the payload type WF_EVENT_T

WF_EVENT_OMB_QH
Use if you implement Oracle Message Broker to
propagate messages by another protocol such as
HTTP

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 15

Custom Queue Handlers


Custom Queue Handlers

Enqueue Logic

Dequeue Logic
WF_EVENT_T
Event Message

Custom Abstract
Data Type

Copyright Oracle Corporation, 2001. All rights reserved.

Custom Queue Handlers


A custom queue handler must translate between the standard WF_EVENT_T
event message structure and your custom Abstract Data Type (ADT).
Queue handler packages must include the following standard APIs:
Enqueue
procedure enqueue (p_event in WF_EVENT_T,
p_out_agent_override in WF_AGENT_T);
Arguments:
p_eventThe event message.
p_out_agent_ overrideThe outbound agent on whose queue the
event message should be enqueued, overriding the outbound agent
specified within the event message.
Dequeue
procedure dequeue (p_agent_guid in raw,
p_event out WF_EVENT_T)
Arguments :
p_agent_guidThe globally unique identifier of the inbound agent
from whose queue the event message should be dequeued.
p_eventThe event message.
For more information, refer to the Defining Procedures and Functions for
Oracle Workflow chapter in the Oracle Workflow Guide.
Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 16

Standard Agents
Standard Agents

When you install Oracle Workflow, three standard


agents are automatically defined on the local
system.
WF_INStandard inbound agent
WF_OUTStandard outbound agent
WF_ERRORStandard agent for error
handling

The standard agents use automatically defined


queues with the SQLNET protocol, the
WF_EVENT_T payload type, and the
WF_EVENT_QH queue handler.

Copyright Oracle Corporation, 2001. All rights reserved.

Standard Agents
Oracle Workflow provides WF_IN and WF_OUT as default agents that you can
use to receive and send events without needing to define any custom agents.
You can optionally define additional inbound and outbound agents to expand
your event processing. For example, you can define custom agents for:
Propagation of event messages by different protocols or with different
frequencies
Increased scalability
Additional levels of servicefor instance, if you have five outbound
agents, and one agent stops functioning, you can still send messages from
the other four agents

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 17

Defining an Agent
Defining an Agent

Copyright Oracle Corporation, 2001. All rights reserved.

To Define an Agent:
1. Use a web browser to connect to the following URL:
<webagent>/wf_event_ html.listagents
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Systems web page from the Oracle Workflow
home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. The Agents page appears, displaying a list of existing agents grouped by
the system where they are located.
Choose the Add Agent button to open the Edit Agent page.
3. Enter the internal name of the agent in the Name field. The agent's internal
name must be unique within the agent's system.
Note: The internal name must be all-uppercase and should not include any
single or double quotation marks (' or ") or spaces.
4. Enter a display name for the agent.
5. Enter an optional description for the agent.
6. Select the message communication protocol that the agent supports.
7. If the agent supports inbound communication to its system, enter the
address for the agent. The format of the address depends on the protocol
you select.
Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 18

For agents that use the SQLNET protocol, the address must be in the
following format to enable AQ propagation:
<schema>.<queue>@<database link>
<schema> represents the schema that owns the queue, <queue> represents
the queue name, and <database link> represents the database link to the
instance where the queue is located.
8. Enter the system in which the agent is defined. Click on the System field's
up arrow icon to display a list of systems from which to choose.
9. Enter the queue handler for the agent.
Note: You must enter the queue handler name in all uppercase.
10. Enter the name of the queue that the local system uses to interact with the
agent. Since only the local system refers to this queue name, the queue
name should be within the scope of this system, without requiring a
database link. Use the following format to specify the queue name:
<schema>.<queue>
<schema> represents the schema that owns the queue, and <queue>
represents the queue name.
Note: You must enter the queue name in all uppercase.
11. In the Direction field, select In for an agent that supports inbound
communication to its system, or select Out for an agent that supports
outbound communication from its system.
12. In the Status field, select Enabled or Disabled as the agent status. If you
disable an agent, it still remains in the Agents list for reference, but you
cannot use the agent in active subscriptions.
13. Choose the Submit button to save the agent.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 19

Finding an Agent
Finding an Agent

Use the Find Agent page to locate a specific agent


definition.

Search for agents by entering the following


criteria:
Name
Protocol
Address
System
Direction
Status

Copyright Oracle Corporation, 2001. All rights reserved.

Finding an Agent
To access the Find Agent web page, use a web browser to connect to the
following URL:
<webagent>/wf_event_html.findagent
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
You can also access the Find Agent web page from the Oracle Workflow home
page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the Event
Manager web pages.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 20

Updating or Deleting an Agent


Updating or Deleting an Agent
Locate the agent you want in the Agents page.

To update an agent, choose the pencil icon in the


Edit column for that agent.

To delete an agent, choose the trash icon in the


Delete column for that agent, and choose OK in
the confirmation window that appears.

Copyright Oracle Corporation, 2001. All rights reserved.

Updating or Deleting an Agent


To access the Agents web page, use a web browser to connect to the following
URL:
<webagent>/wf_event_html.listagents
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
You can also access the Agents web page from the Oracle Workflow home
page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the Event
Manager web pages.
Deleting an Agent
You can only delete agents that do not have any subscriptions referencing them.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 21

Review Questions
Review Questions
1. What is the definition of a system?
2. What is the definition of an agent?
3. What does a queue handler do?
4. What are the three standard agents in an Oracle
Workflow installation?

Copyright Oracle Corporation, 2001. All rights reserved.

Review Questions and Solutions


1. What is the definition of a system?
A system is a logically isolated software environment such as a host
machine or database instance.
2. What is the definition of an agent?
An agent is a named point of communication within a system.
3. What does a queue handler do?
A queue handler enqueues and dequeues messages on an agents
queue, translating between the standard Workflow format and the
format required by the queue.
4. What are the three standard agents in an Oracle Workflow installation?
The three standard agents automatically defined on the local system
when you install Oracle Workflow are:
WF_INStandard inbound agent
WF_OUTStandard outbound agent
WF_ERRORStandard agent for error handling

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 22

Summary
Summary
In this lesson, you should have learned how to:

Define systems.
Define communication agents on systems.
Associate queues and queue handlers with
agents.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 23

Copyright Oracle Corporation, 2001. All rights reserved.

Systems and Agents


Chapter 4 - Page 24

Event Subscriptions
Chapter 5

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 1

Event Subscriptions

Event Subscriptions

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Describe the types of processing a subscription


can include.

Define subscriptions.
Define subscription rule functions.
Use predefined Oracle Workflow subscriptions.
Apply Business Event System APIs.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 3

Event Subscriptions
Event Subscriptions

Define subscriptions in the Event Manager to


specify the processing that you want to perform
when events occur.
Whenever an event is raised locally or received
from an external source, the Event Manager
searches for and executes any active
subscriptions by the local system to that event or
to the Any event.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
If no active subscriptions exist for the event that occurred, then you can
optionally handle the event by having Oracle Workflow execute any active
subscriptions to the Unexpected event.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 4

Event Manager Subscription Processing


Event Manager Subscription Processing
Application

Matching Event Subscription


Workflow
Process

RAISE
Local Events
Event
Dispatcher

Rule
Function

LISTEN
External Events
Send to
Agent
AQ

Copyright Oracle Corporation, 2001. All rights reserved.

Event Manager Subscription Processing


Subscriptions can include the following types of processing:
Running a function on the event message
Sending the event message to a workflow process
Sending the event message to a local or external agent

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 5

Subscription Properties
Subscription Properties
A subscription definition in the Event Manager
includes the following properties:

SubscriberThe system where you want the


subscription to execute

Source TypeLocal, External, or Error


Event FilterThe triggering event

Copyright Oracle Corporation, 2001. All rights reserved.

Subscription Properties
Subscriber
Each subscription defines an action on exactly one system, so you should define
a separate subscription for each system involved in the processing you want to
perform. For example, if you want to propagate data from one system to
another, you should define one subscription for the sending system, and another
subscription for the receiving system.
Note: You can define and store subscriptions for multiple systems in the Event
Manager on your local system, and use predefined events and subscriptions to
replicate those subscriptions to other systems. However, only subscriptions with
the local system as the subscriber are triggered when events are raised or
received on the local system.
Source Type
Subscriptions can have the following source types:
LocalThe subscription applies only to events raised on the subscribing
system.
ExternalThe subscription applies only to events received by an inbound
agent on the subscribing system.
Note: All event messages received by an inbound agent on the subscribing
system are considered to have an External source, whether the sending
agent is located on a remote system or on the local system.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 6

ErrorThe subscription applies to only to errored events dequeued from


the WF_ERROR agents queue.
Event Filter
You can choose either an individual event or an event group. If you choose an
event group, the subscription will be triggered whenever any one of the group's
member events occurs.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 7

Subscription Properties
Subscription Properties
A subscription definition in the Event Manager
includes the following properties:

PhaseThe order in which subscriptions to the


same event are executed

Rule DataKey or Message

Copyright Oracle Corporation, 2001. All rights reserved.

Subscription Properties
Phase
If you define multiple subscriptions to the same event, you can control the order
in which the Event Manager executes those subscriptions by specifying a phase
number for each subscription.
Subscriptions are executed in ascending phase order. For example, you can
enter 10 for the subscription that you want to execute first when an event
occurs, 20 for the subscription that you want to execute second, and so on.
You can use phases to ensure that different types of actions are performed in the
appropriate order, such as executing subscriptions that perform validation
before subscriptions that perform other types of processing.
Rule Data
Depending on the processing to be performed, a subscription may have the
following rule data requirements:
KeyRequires only the event key that identifies the instance of the event
MessageRequires the complete set of event information contained in the
event data
You can improve performance by specifying Key as the rule data for
subscriptions that do not require the complete event data. If an event is raised
locally and any subscriptions to that event require the complete event data, then
the Event Manager will run the Generate function for the event to produce the
event data. However, if no subscriptions to the event require the event data, then
Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 8

the Event Manager will not run the Generate function, minimizing the resources
required to execute the subscriptions.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 9

Subscription Actions: Running a Rule Function


Subscription Actions:
Running a Rule Function

A subscription can include a rule function that is


executed on the event message.

Oracle Workflow provides a standard default rule


function, WF_RULE.Default_Rule, that can:
Send the event message to a workflow
process
Send the event message to an agent

Oracle Workflow provides some standard


rule functions for testing and debugging.

You can extend your subscription


processing by creating custom rule
functions.

Copyright Oracle Corporation, 2001. All rights reserved.

Subscription Actions: Running a Rule Function


If you specify a rule function for a subscription, you can also specify in
the subscription any additional parameters that you want to pass to the
function.
If you use the default rule function, you should specify in the subscription
the workflow process or the agent (or both) where you want to send the
event message.
If you enter a rule function other than the default function, you can still
enter workflow and agent information for your function to reference, but
Oracle Workflow does not automatically send the event message to the
specified workflow and agent. Instead, you must either explicitly include
the send processing in your rule function, or define a separate subscription
that does use the default rule function to perform the send processing.
Custom rule functions must be defined according to a standard API.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 10

Subscription Actions: Running a Rule Function


Subscription Actions:
Running a Rule Function
Some possible uses for a rule function are:

Performing validation
Processing inbound messages as a Receive
message handler for an application
Making modifications to an outbound message,
such as adding a correlation ID that associates
this message with other messages

Copyright Oracle Corporation, 2001. All rights reserved.

Subscription Actions: Running a Rule Function


The rule function controls the behavior of the processing performed for
the subscription.
If a rule function modifies the event message, any subsequent
subscriptions executed on the event will access the changed message.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 11

Predefined Rule Functions


Predefined Rule Functions

Oracle Workflow provides some standard rule


functions that you can use for basic subscription
processing, testing and debugging, or other
purposes.

The following rule function APIs are defined in a


PL/SQL package called WF_RULE:
Default_Rule

Log

Error
Warning

Workflow_Protocol
Error_Rule

Success

Copyright Oracle Corporation, 2001. All rights reserved.

Predefined Rule Functions


Default_RulePerforms default subscription processing on the event
message when no rule function is specified for an event subscription,
including:
Sending the event message to a workflow process, if specified in the
subscription definition
Sending the event message to an agent, if specified in the
subscription definition
ErrorReturns the status code ERROR and sets a specified error message
into the event message.
WarningReturns the status code WARNING and sets a specified error
message into the event message.
SuccessReturns the status code SUCCESS.
LogOutputs the contents of the event message to a SQL*Plus session
using DBMS_OUTPUT.put_line.
Workflow_ProtocolSends the event message to the workflow process
specified in the subscription, which should in turn send the event message
to the inbound agent specified in the subscription.
Error_RulePerforms the same subscription processing as Default_Rule,
but reraises any exception that is encountered.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 12

Custom Rule Functions


Custom Rule Functions

Rule functions must follow a standard API.

However, you should never commit within a rule


function. The Event Manager never issues a
commit as it is the responsibility of the calling
application to commit.
A rule function must not change the connection
context in any way, including security and NLS
settings.

A rule function may read or write to the event


message or perform any other database action.

Copyright Oracle Corporation, 2001. All rights reserved.

Custom Rule Functions


A rule function for an event subscription must have the following standard API:
function <function_name>
(p_subscription_guid in raw,
p_event in out WF_EVENT_T) return varchar2 is
<local declarations>
begin
<your executable statements>
<optional code for WARNING>
WF_CORE.CONTEXT('<package name>',
'<function name>', p_event.getEventName( ),
p_subscription_guid);
WF_EVENT.setErrorInfo(p_event, 'WARNING');
return 'WARNING';

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 13

return 'SUCCESS';
exception
when others then
WF_CORE.CONTEXT('<package name>',
'<function name>', p_event.getEventName( ),
p_subscription_guid);
WF_EVENT.setErrorInfo(p_event, 'ERROR');
return 'ERROR';
end;
Arguments:
p_subscription_ guidThe globally unique identifier for the subscription.
p_eventThe event message.
The function must return one of the following status codes:
SUCCESSThe rule function completed successfully.
WARNINGA warning condition occurred. The rule function reports a
warning message using the Workflow Core error APIs and sets the
warning information into the event message. The Event Manager places a
copy of the event message on the WF_ERROR queue, but subscription
processing continues.
ERRORAn error occurred. The rule function reports an error message
using the Workflow Core error APIs and sets the error information into the
event message. The Event Manager halts subscription processing for this
event, rolls back any subscriptions already executed for the event, and
places the event message on the WF_ERROR queue.
For more information, refer to the Defining Procedures and Functions for
Oracle Workflow chapter in the Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 14

Subscription Actions: Sending an Event to a Workflow


Process
Subscription Actions:
Sending an Event to a Workflow Process

To send an event to a workflow process, you


must:
Specify in the subscription the item type and
process name of the process.
Either use the default rule function or include
send processing in your custom rule function.

The item key for the process is determined either


by the correlation ID specified in the
event message, or by the event key if
no correlation ID is specified.

Copyright Oracle Corporation, 2001. All rights reserved.

Subscription Actions: Sending an Event to a Workflow Process


By sending an event to a workflow process, you can model complex
processing or routing logic beyond the options of directly running a
predefined function or sending the event to a predefined recipient.
For example, you can branch to different functions, initiate subprocesses,
send notifications, or select recipient agents, based on the contents of the
event message, or modify the event message itself.
If you specify a workflow process, you can also specify in the subscription
any additional parameters that you want to set as item attributes for the
workflow process. If the corresponding item attributes do not already exist
in the item type, Oracle Workflow automatically defines the item
attributes when the event is sent to the process.
The subscription's globally unique identifier (GUID) is set as a dynamic
item attribute so that the workflow process can reference other information
in the subscription definition.
If you want to send an event to a workflow process from within a custom
rule function, call:
WF_ENGINE.Event( ) to send the event message to a workflow
process only

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 15

WF_RULE.Default_Rule( ) to include the default subscription


processing that can send the event message both to a workflow
process and to an agent

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 16

Subscription Actions: Sending an Event to an Agent


Subscription Actions:
Sending an Event to an Agent

To send an event to an agent, you must:


Specify in the subscription the To Agent that
you want to receive the inbound message.
Either use the default rule function or include
send processing in your custom rule function.

You can also optionally:


Specify the Out Agent that you want
to send the outbound message.
Specify the priority with which the
recipient should dequeue the
message.

Copyright Oracle Corporation, 2001. All rights reserved.

Subscription Actions: Sending an Event to a Workflow Process


If you do not specify an Out Agent, Oracle Workflow selects an outbound
agent on the subscribing system whose queue type matches the queue type
of the To Agent.
If you want to send an event to an agent from within a custom rule
function, call:
WF_EVENT.Send( ) to send the event message to an agent only
WF_RULE.Default_Rule( ) to include the default subscription
processing that can send the event message both to a workflow
process and to an agent

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 17

Defining a Subscription
Defining a Subscription

Copyright Oracle Corporation, 2001. All rights reserved.

To Define a Subscription:
1. Use a web browser to connect to the following URL:
<webagent>/wf_event_ html.listsubscriptions
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Event Subscriptions web page from the Oracle
Workflow home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. The Event Subscriptions page appears, displaying a list of existing
subscriptions grouped by the subscribing system and triggering event.
Choose the Add Subscription button to open the Edit Subscription page.
3. In the Subscriber region, enter the system where the subscription executes.
Click on the System field's up arrow icon to display a list of systems from
which to choose.
4. In the Triggering Condition region, specify the type of source system to
which the subscription applies in the Source Type field.
LocalThe subscription applies only to events raised on the
subscribing system.
ExternalThe subscription applies only to events received by an
inbound agent on the subscribing system.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 18

Note: All event messages received by an inbound agent on the


subscribing system are considered to have an External source,
whether the sending agent is located on a remote system or on the
local system.
ErrorThe subscription applies to only to errored events dequeued
from the WF_ERROR agents queue.
5. Enter the event to which the subscription applies in the Event Filter field.
Click on the Event Filter field's up arrow icon to display a list of events
from which to choose.
6. Enter an optional source agent to which the subscription applies. If you
specify a source agent, then the subscription is executed only when the
triggering event is received from that agent. Click on the Source Agent
field's up arrow icon to display a list of agents from which to choose.
Note: In most cases, the Source Agent field is left blank.
7. In the Execution Control region, enter an optional phase number for the
subscription to specify the order in which subscriptions that apply to the
same event are executed.
8. Select Enabled or Disabled as the subscription status. If you disable a
subscription, it still remains in the Event Subscriptions list for reference,
but it can no longer be actively used to respond to events.
9. In the Rule Data field, specify the event information required by the
subscription.
KeyThe subscription requires only the event key.
MessageThe subscription requires the complete event data.
10. In the Action region, define the subscription processing you want to
perform when the triggering event occurs.
11. If you want to run a function on the event message, enter the Rule
Function to run.
If you do not specify a rule function, Oracle Workflow runs a default rule
function to send the event message to the workflow process and the agent
that you specify.
12. If you want to send the event message to a workflow process, enter the
item type that the process belongs to in the Workflow Item Type field and
the name of the process in the Workflow Process Name field. Click on
each field's up arrow icon to display a list of values from which to choose.
Note: The list of values for the Workflow Process Name field includes
only the runnable processes within the item type you specify.
13. If you want to send the event to an agent, optionally enter the Out Agent
that you want to send the outbound message. Click on the Out Agent
field's up arrow icon to display a list of values from which to choose.
Note: The Out Agent must be located on the subscribing system. The list
of values for the Out Agent field includes only agents with a direction of
Out.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 19

14. If you want to send the event to an agent, enter the To Agent that you want
to receive the inbound message. Click on the To Agent field's up arrow
icon to display a list of values from which to choose.
Note: The list of values for the To Agent field includes only agents with a
direction of In.
15. If you want to send the event message to an agent, select Normal, High, or
Low as the priority with which the recipient should dequeue the message.
16. Optionally enter any additional parameters for the rule function or
workflow process in the Parameters field. Use spaces to separate the
parameters, and specify the name and value for each parameter in the
following format:
<name1>=<value1> <name2>=<value2> ... <nameN>=<valueN>
17. If you use a program to create subscription definitions automatically, the
Event Manager displays owner information set by that program in the
Owner Name and Owner Tag fields in the Documentation region. You can
use the Edit Subscription page to update this information manually if
necessary.
18. Enter an optional description for the subscription.
19. Choose the Submit button to save the subscription.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 20

Finding a Subscription
Finding a Subscription

Use the Find Subscription page to locate a specific


subscription definition.

Search for subscriptions by entering the following


criteria:
System
Source Type
Event
Status

Copyright Oracle Corporation, 2001. All rights reserved.

Finding a Subscription
To access the Find Subscription web page, use a web browser to connect to the
following URL:
<webagent>/wf_event_html.findsubscription
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
You can also access the Find Subscription web page from the Oracle Workflow
home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the Event
Manager web pages.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 21

Updating or Deleting a Subscription


Updating or Deleting a Subscription
Locate the subscription you want in the Event
Subscriptions page.

To update a subscription, choose the pencil icon


in the Edit column for that subscription.

To delete a subscription, choose the trash icon in


the Delete column for that subscription, and
choose OK in the confirmation window that
appears.

Copyright Oracle Corporation, 2001. All rights reserved.

Updating or Deleting a Subscription


To access the Event Subscriptions web page, use a web browser to connect to
the following URL:
<webagent>/wf_event_html.listsubscriptions
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
You can also access the Event Subscriptions web page from the Oracle
Workflow home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the Event
Manager web pages.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 22

Predefined Subscriptions
Predefined Subscriptions

Oracle Workflow provides default subscriptions to


some of the predefined Workflow events.

The subscriber for all the predefined subscriptions


is the local system.

You can update, enable, or disable some of these


subscriptions to perform the event processing that
you want.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 23

Predefined Subscriptions
Predefined Subscriptions
Oracle Workflow provides predefined subscriptions
for the following events:
Workflow Send
Seed Event Group
Protocol
System Signup
Workflow Send
Any
Protocol
Unexpected
Acknowledgement
Ping Agent

Acknowledge Ping

Copyright Oracle Corporation, 2001. All rights reserved.

Predefined Subscriptions
Seed Event Group
Oracle Workflow provides two predefined subscriptions to the Seed Event
Group. These subscriptions can be triggered by any of the groups member
events. The Seed Event Group includes all the event, event group, system,
agent, and subscription definition events, as well as the Synchronize Event
Systems event.
The first subscription can send the Event Manager data to an agent and to
a workflow process when one of the group member events is raised
locally. To use this subscription, you must add the agent or workflow to
which you want to send the data, and enable the subscription.
The second subscription can load the Event Manager data into the local
system when one of the group member events is received from an external
source. To use this subscription, you must enable it.
System Signup Event
Oracle Workflow provides one predefined subscription to the System Signup
event that loads the Event Manager data into the local system when the System
Signup event is raised locally.
Any Event
Oracle Workflow provides three predefined subscriptions to the Any event.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 24

The first subscription can be triggered when an event is raised locally. To


use this subscription, you must define the action for the subscription and
enable it.
The second subscription can be triggered when an event is received from
an external source. To use this subscription, you must define the action for
the subscription and enable it.
The third subscription sends the event message to the Default Event Error
process in the System: Error item type and raises an exception when an
event is received from an Error source (that is, when it is dequeued from
the WF_ERROR queue).
Attention: You must not change or disable the definition of the
predefined Error subscription to the Any event. If you do, the Event
Manager will not be able to perform error handling for event and
subscription processing.
Unexpected Event
Oracle Workflow provides two predefined subscriptions to the Unexpected
event.
The first subscription can send the event message to the Default Event
Error process in the System: Error item type when the Unexpected event is
raised locally. To use this subscription, you must enable it.
Attention: If you want to enable this subscription, be careful to consider
all the events that can be raised on your local system and trigger the
subscription. Many local events may be raised to which you do not want to
subscribe. Additionally, if a large number of events are raised on the local
system, enabling this subscription may flood the Business Event System.
The second subscription sends the event message to the Default Event
Error process in the System: Error item type when the Unexpected event is
received from an external source. This subscription allows your local
system to handle any event messages received from external systems that
you were not expecting.
Ping Agent Events
Ping AgentOracle Workflow provides one predefined subscription to
the Ping Agent event that sends the Acknowledge Ping event back to the
originating system when the Ping Agent event is received from an external
source.
Acknowledge PingOracle Workflow provides one predefined
subscription to the Acknowledge Ping event that sends the Acknowledge
Ping event to the Detail Ping process in the Workflow Agent
Ping/Acknowledge item type when the event is received from an external
source.
Workflow Send Protocol Events
Workflow Send ProtocolOracle Workflow provides two predefined
subscriptions to the Workflow Send Protocol event.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 25

The first subscription sends the event message to the Workflow


Event Protocol process in the Workflow Send Protocol item type
when the Workflow Send Protocol event is raised locally. A
subscription parameter specifies that the message requires an
acknowledgement. You can add an outbound agent and inbound
agent to the subscription to specify where you want the Workflow
Event Protocol process to send the event message.
The second subscription sends the event message to the Workflow
Event Protocol process in the Workflow Send Protocol item type
when the Workflow Send Protocol event is received from an external
source. You can optionally add an outbound agent and inbound agent
to the subscription to specify that you want the Workflow Event
Protocol process to send the event message on to another agent.
Workflow Send Protocol AcknowledgementOracle Workflow provides
one predefined subscription to the Workflow Send Protocol
Acknowledgement Event that sends the event message to the Workflow
Event Protocol process in the Workflow Send Protocol item type when the
Workflow Send Protocol Acknowledgement event is received from an
external source.
For more information, refer to the Predefined Workflow Events chapter in the
Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 26

Event APIs
Event APIs

The Event APIs can be called by an application


program or a workflow process in the runtime
phase to communicate with the Business Event
System and manage events.

The following APIs are defined in a PL/SQL


package called WF_EVENT:
Raise

Enqueue

Send
NewAgent

Listen
SetErrorInfo

Test

Copyright Oracle Corporation, 2001. All rights reserved.

Event APIs
RaiseRaises a local event to the Event Manager.
SendSends an event message from one agent to another.
NewAgentCreates a WF_AGENT_T structure for the specified agent
and sets the agent's system and name into the structure.
TestTests for the most costly data requirement among subscriptions to
an event.
EnqueueEnqueues an event message onto a queue associated with an
outbound agent.
ListenMonitors an agent for inbound event messages and dequeues
messages using the agent's queue handler.
Note: If you are using the version of Oracle Workflow embedded in
Oracle Applications, you can also use the "Workflow Listen Process"
concurrent program to listen for inbound event messages.
SetErrorInfoRetrieves error information from the error stack and sets it
into the event message.
For more information, refer to the Oracle Workflow APIs chapter in the Oracle
Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 27

Event Function APIs


Event Function APIs

The Event Function APIs provide utility functions


that can be called by an application program, the
Event Manager, or a workflow process in the
runtime phase to communicate with the Business
Event System and manage events.

The following APIs are defined in a PL/SQL


package called WF_EVENT_FUNCTIONS_PKG:
Parameters
SubscriptionParameters
AddCorrelation
Generate
Receive

Copyright Oracle Corporation, 2001. All rights reserved.

Event Function APIs


ParametersParses a string of text containing parameters and returns the
parsed parameters in a varray.
SubscriptionParametersReturns the value for a parameter from a text
string containing the parameters defined for an event subscription.
AddCorrelationAdds a correlation ID to an event message when used as
a rule function for subscription processing.
GenerateGenerates the event data for events in the Seed Event Group.
ReceiveReceives Business Event System object definitions when used
as a rule function for subscription processing and loads the definitions into
the appropriate Business Event System tables.
For more information, refer to the Oracle Workflow APIs chapter in the Oracle
Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 28

Practice 1 Overview
Practice 1 Overview
This practice covers the following topics:

Defining a subscription in the Event Manager


Raising an event to trigger the subscription

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 29

Practice 1: Defining a Subscription


Practice 1:
Defining a Subscription
1. Define a subscription with the following properties:
System: <local system>
Source Type: Local
Event Filter: XX.oracle.workflow.bes.event.new
Rule Data: Key
Rule Function: WF_RULE.Success
Replace XX with your terminal number.
2. Raise the XX.oracle.workflow.bes.event.new event
to trigger your subscription.

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
In this practice, you will define a subscription that runs the predefined rule
function WF_RULE.Success. Then you will raise an event to trigger your
subscription. Because the WF_RULE.Success function does not perform any
processing other than returning the status code SUCCESS, there will be no
result visible in the Workflow web pages after the subscription is executed. For
an indication that the subscription was executed successfully, you can optionally
check the Worklist to ensure that no error notification was generated.
Note: Because many students access the system and create objects during this
course, you need a way to distinguish between the objects created by you and by
your classmates. Therefore, you will be assigned a terminal number by your
instructor. Use this number as a prefix wherever you see XX included in the
name of something you are defining. In this way, you can ensure that the
definitions you create are unique.
Step 1
1. Use a web browser to connect to the Oracle Workflow home page with the
URL provided by the instructor. Log in as any user with workflow
administrator privileges.
2. Choose the Event Subscriptions link.
3. In the Event Subscriptions page, choose the Add Subscription button to
open the Edit Subscription page.
4. In the System field, select the local system as the subscriber.
5. In the Source Type field, select Local.
Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 30

6. In the Event Filter field, select the XX.oracle.workflow.bes.event.new


event that you defined in the Defining an Event practice. If you have not
performed this practice, select an event provided by your instructor.
7. Leave the Source Agent field blank.
8. Enter 10 in the Phase field.
9. In the Status field, select Enabled.
10. In the Rule Data field, select Key.
11. Enter WF_RULE.Success in the Rule Function field.
12. Leave the Workflow Item Type, Workflow Process Name, Out Agent, To
Agent, Parameters, Owner Name, and Owner Tag fields blank. Leave the
Priority field set to the default value, which is Normal.
13. In the Description field, enter XX New Event Subscription.
14. Choose the Submit button to save the subscription.
Step 2
1. Navigate back to the Oracle Workflow home page.
2. Choose the Raise Event link.
3. In the Event Name field, select XX.oracle.workflow.bes.event.new, or
whichever event you defined as the event filter for your subscription.
4. In the Event Key field, enter a unique event key such as XX51.
5. For the purposes of this practice, since you will not perform further
processing on this event, you do not need to enter any event data. Leave
the Event Data field blank.
6. Choose the Submit button to raise the event.
7. Choose OK in the confirmation window.
The WF_RULE.Success function does not produce any visible results in the
Workflow web pages. However, for an indication that the subscription was
executed successfully, you can optionally choose the Worklist link from the
Oracle Workflow home page to ensure that no error notification was generated.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 31

Practice 1: Defining a Subscription


Practice 1:
Defining a Subscription

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you complete this practice, the subscription definition should look similar
to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 32

Practice 1: Defining a Subscription


Practice 1:
Defining a Subscription

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you raise your event for this practice, the raise event details should look
similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 33

Summary
Summary
In this lesson, you should have learned how to:

Describe the types of processing a subscription


can include.

Define subscriptions.
Define subscription rule functions.
Use predefined Oracle Workflow subscriptions.
Apply Business Event System APIs.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Subscriptions
Chapter 5 - Page 34

Configuring Oracle Workflow


for Event Communication
Chapter 6

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 1

Configuring Oracle Workflow for Event Communication

Configuring Oracle Workflow for Event


Communication

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Check the Business Event System setup.

Synchronize Business Event System data on


different systems.

Review event messages on local agents.

Schedule listeners for inbound agents.


Schedule propagation for outbound agents.
Sign up systems with each other for event
message propagation.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 3

Checking Business Event System Setup


Checking Business Event System Setup
Use the Check Setup web page to verify these
required parameters and components:

Database init.ora parameters


AQ_TM_PROCESSES
JOB_QUEUE_INTERVAL
JOB_QUEUE_PROCESSES

Database links
Local agents and their queues

Copyright Oracle Corporation, 2001. All rights reserved.

Checking Business Event System Setup


Database Init.ora Parameters
AQ_TM_PROCESSESThis parameter enables the time manager
process in Oracle8i Advanced Queuing (AQ). The time manager process
is required by Oracle Workflow to monitor delay events in queues. The
minimum recommended number of time manager processes for Oracle
Workflow is one.
JOB_QUEUE_INTERVALSpecify the job queue interval to determine
how frequently each SNP job queue process in your instance wakes up.
Oracle Workflow requires the job queue interval to be less than or equal to
the latency parameter defined for your AQ propagation schedules, to allow
queues to be rechecked for messages with the specified latency. The
recommended job queue interval for Oracle Workflow is five seconds.
JOB_QUEUE_PROCESSESThis parameter defines the number of SNP
job queue processes for your instance. Oracle Workflow requires job
queue processes to handle propagation of Business Event System event
messages by AQ queues. You must start at least one job queue process to
enable message propagation. The minimum recommended number of
processes for Oracle Workflow is two.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 4

Checking Business Event System Setup


Checking Business Event System Setup

Copyright Oracle Corporation, 2001. All rights reserved.

To Check the Business Event System Setup:


1. Use a web browser to connect to the following URL:
<webagent>/wf_setup.check_all
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Check Setup web page from the Oracle Workflow
home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. In the Check Setup page, use the Database Init.ora Parameters region to
verify your settings for the database initialization parameters related to
AQ. The Check Setup page displays the actual value defined for each
parameter as well as the minimum recommended value for Oracle
Workflow.
Note: Setting the init.ora parameters is completed as part of the Oracle
Workflow installation steps. After any change to the init.ora parameters,
you must restart your database to make the change effective.
3. Use the Database Links region to verify your database links. You should
create any required database links that do not yet exist. The database link
name as defined in the database must exactly match the database link
name entered as part of the address for an agent.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 5

4. Use the Local Agents region to verify the queues that are set up for the
agents defined on your local system. You should create any required
queues that do not yet exist.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 6

Event Message Communication


Event Message Communication
Send

Outbound Queue

Propagate

Inbound Queue

Listen

Event
Dispatcher

Copyright Oracle Corporation, 2001. All rights reserved.

Event Message Communication


To send an event message, Oracle Workflow places the event message on a
local outbound agents queue. You must schedule a propagation to deliver the
message from there to the designated inbound agents queue.
To receive an event message in Oracle Workflow, you must schedule an agent
listener to dequeue the message from the inbound agents queue for Oracle
Workflow to process. A component of the Event Manager called the Event
Dispatcher then searches for and executes subscriptions to the event.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 7

Agent Listeners
Agent Listeners

An agent listener monitors an agent for inbound


event messages and dequeues messages for the
Event Manager to process.
You should schedule a listener for each inbound
agent on your local system.
When an event message is received, the Event
Manager searches for and executes any active
subscriptions by the local system to that event or
to the Any event with a source type of External.

Copyright Oracle Corporation, 2001. All rights reserved.

Agent Listeners
You must schedule a listener for the standard WF_ERROR agent to enable error
handling for the Business Event System. Also, if you want to use the standard
WF_IN agent for event message propagation, schedule a listener for that agent
as well.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 8

Agent Listeners
Agent Listeners

A listener starts monitoring the agent's queue on


the scheduled run day, dequeuing any inbound
event messages.
The listener exits after all event messages on the
agent's queue have been dequeued.
Oracle Workflow reruns the listener indefinitely at
the scheduled interval.
You can modify a listeners schedule by updating
its settings or stop it altogether by deleting it.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 9

Running Listeners
Running Listeners
You can run listeners by any of the following
methods:

Check Setup web page


WF_EVENT.Listen( ) API
Wfagtlst.sql script
Workflow Listen Process concurrent program
(only for Oracle Workflow embedded in Oracle
E-Business Suite)

Copyright Oracle Corporation, 2001. All rights reserved.

Running Listeners
The wfagtlst.sql script is intended primarily for debugging purposes.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 10

Scheduling Listeners
Scheduling Listeners

Copyright Oracle Corporation, 2001. All rights reserved.

To Schedule a Listener for an Inbound Agent:


1. Use a web browser to connect to the following URL:
<webagent>/wf_setup.check_all
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Check Setup web page from the Oracle Workflow
home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. In the Check Setup page, locate the agent you want in the Listeners for
Local Inbound Agents region.
3. If no listeners are scheduled for the agent yet, the Scheduled status for the
agent is No. Choose the Create link in the Action column for that agent to
create the first listener for the agent. The Edit Listener page appears,
displaying the name of the selected agent.
If at least one listener is already scheduled for the agent, the Scheduled
status for the agent is Yes. Choose the Edit link in the Action column for
that agent to create an additional listener. The Listeners page appears,
displaying a list of existing listeners for the agent. Choose the Add button.
The Edit Listener page appears, displaying the name of the selected agent.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 11

4. In Edit Listener page, enter the date on which you want to start running
the listener in the Run Day field. To start the listener on the current system
date, leave this field blank.
5. In the Run Every fields, enter an interval to specify how often you want
the listener to be run. You can specify the interval in days, hours, minutes,
and seconds.
6. Choose the Submit button to save the listener schedule.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 12

Scheduling Listeners
Scheduling Listeners

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 13

Updating or Deleting a Listener


Updating or Deleting a Listener

Locate the agent you want in the Listeners for


Local Inbound Agents region of the Check Setup
page.
Choose the Edit link in the Action column for that
agent to open the Listeners page.
To update a listener, choose the pencil icon in
the Edit column for that listener.
To delete a listener, choose the trash icon in
the Delete column for that listener, and choose
OK in the confirmation window that
appears.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 14

Propagations
Propagations

When you send an event message to an agent, the


Event Manager places the message on the queue
associated with the outbound agent.
The message is then asynchronously delivered to
the recipient by propagation.
You should schedule a propagation for each
outbound agent on your local system.

Copyright Oracle Corporation, 2001. All rights reserved.

Propagations
If you want to use the standard WF_OUT agent for event message propagation,
ensure that you schedule a listener for that agent.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 15

Propagations
Propagations

To schedule AQ propagations for agents that use


the SQLNET protocol, you can use the following
methods:
Check Setup web page
Advanced Queue Propagation concurrent
program (only for Oracle Workflow embedded
in Oracle E-Business Suite)
For agents that use other protocols, you must
provide external propagation logic.

Copyright Oracle Corporation, 2001. All rights reserved.

Propagations
If you are using Oracle Message Broker (OMB), you should set up propagation
through OMB rather than through Oracle Workflow.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 16

Scheduling Propagations
Scheduling Propagations

Copyright Oracle Corporation, 2001. All rights reserved.

To Schedule a Propagation for an Outbound Agent:


1. Use a web browser to connect to the following URL:
<webagent>/wf_setup.check_all
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Check Setup web page from the Oracle Workflow
home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. In the Check Setup page, the Propagations for Local Outbound Agents
region displays a list of the combinations of local outbound agents and
database links that may require propagations. This list matches each of
your local outbound agents with each database link to a remote system that
appears in the addresses of the inbound agents you have defined. Each
local outbound agent is also listed with a Local destination in the Database
Link column for propagation to inbound agents on the local system.
Locate the outbound agent and database link combination for which you
want to schedule a propagation.
3. If no propagation is scheduled yet for the agent and database link you
want, choose the Create link in the Schedule column to schedule the
propagation. The Edit Propagation page appears.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 17

4. In the Duration field, enter the duration of the propagation window, in


seconds.
5. In the Run Every field, enter an interval in seconds to specify how often
you want a propagation window to occur.
Note: The run interval must be longer than the duration of the propagation
window.
6. In the Latency field, enter a latency time in seconds to specify how long
you want to wait, after all messages have been propagated, before
rechecking the queue for new messages to the destination.
The latency represents the maximum wait time during the propagation
window for a message to be propagated after it is enqueued. To propagate
messages as soon as possible after they are enqueued, enter a latency of
zero. The default latency is 60 seconds.
Note: To enable AQ to enforce the latency time, the job queue interval
setting in your database initialization parameters must be less than or
equal to the latency value.
7. Choose the Submit button to save the propagation schedule.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 18

Scheduling Propagations
Scheduling Propagations

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 19

Updating or Deleting a Propagation


Updating or Deleting a Propagation

Locate the outbound agent and database link


combination that you want in the Propagations for
Local Outbound Agents region of the Check Setup
page.

Choose the Edit link in the Schedule column for


that agent to open the Edit Propagation page.
To update the propagation, make your
changes to the settings in the Edit Propagation
page.
To delete the propagation, choose
the Delete button.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 20

Demonstration
Demonstration
This demonstration shows you how to:

Check the Business Event System setup


Schedule listeners for inbound agents
Schedule propagations for outbound agents

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 21

Signing Up Systems
Signing Up Systems

Before sending events from one system to


another, you must sign up the destination system
with the source system as a recipient of event
messages.

Signing up a system means defining the


destination system and its inbound agents in the
Event Manager of the source system.

When the destination system is signed


up, you can address event messages
from the source system to the
destination agents.

Copyright Oracle Corporation, 2001. All rights reserved.

Signing Up Systems
Usually when you integrate two systems, both systems should be signed up with
each other, so that each system can both send messages to and receive messages
from the other system.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 22

Signing Up Systems
Signing Up Systems
To sign up a destination system for receiving event
messages from a source system:
1. Retrieve the local system and inbound agent
definitions, which together make up the system
identifier information, from the destination system.
2. Add the destination system identifier information
to the Event Manager in the source system.

Copyright Oracle Corporation, 2001. All rights reserved.

Signing Up Systems
You can use the System Identifier web page on the destination system to
generate an XML document containing the system identifier information.
You can use the System Signup web page on the source system to add the
information by raising the System Signup event with the XML document
from the destination system as the event data. When the System Signup
event is raised on the source system, Oracle Workflow executes a
predefined subscription that adds the system identifier information to the
Event Manger in that system.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 23

Retrieving System Identifier Information


Retrieving System Identifier Information

Connect to the System Identifier URL.

Save this document as a text file.

Oracle Workflow produces the system identifier


XML document, which contains the definitions of
the local system and its inbound agents.

Copyright Oracle Corporation, 2001. All rights reserved.

Retrieving System Identifier Information


Use a web browser to connect to the following URL:
<webagent>/wf_event_html.getsystemidentifier
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
You can also access the System Identifier web page from the Oracle Workflow
home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the Event
Manager web pages.
System Identifier XML Document
After you save the system identifier XML document as a text file, you can copy
the document and enter it as the event data for the System Signup event when
you sign this system up with a source system.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 24

Signing Up Systems
Signing Up Systems

Copyright Oracle Corporation, 2001. All rights reserved.

To Sign Up a System:
1. Use a web browser to connect to the following URL:
<webagent>/wf_event_html.entereventdetails?p_event_name=
oracle.apps.wf.event.system.signup
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the System Signup web page from the Oracle
Workflow home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. In the System Signup page, enter an event key that uniquely identifies this
instance of the event.
3. Copy the XML document containing the destination system identifier
information into the Event Data field.
4. Choose the Submit button to raise the System Signup event to the Event
Manager. A confirmation message is displayed.
When the System Signup event is raised, Oracle Workflow executes a
predefined subscription that adds the system identifier information from
the event data to the Event Manager.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 25

Synchronizing Systems
Synchronizing Systems

Synchronizing systems means replicating all the


Event Manager objects that are defined on the
source system to the target system.
You can use the Synchronize Event Systems event
to synchronize systems with each other.

Copyright Oracle Corporation, 2001. All rights reserved.

To Synchronize Systems:
1. Sign up the source and target systems with each other.
2. On the source system, modify the predefined subscription to the Seed
Event Group with the Local source type.
Specify the inbound agent on the target system that you want to
receive the event message, or specify a workflow process that sends
the event message to the target system.
Enable the subscription.
3. On the target system, enable the predefined subscription to the Seed Event
Group with the External source type.
4. On the source system, raise the Synchronize Event Systems event
(oracle.apps.wf.event.all.sync) using the Raise Event web page. Enter a
unique event key, but leave the Event Data field blank.
When the Synchronize Event Systems event is raised on the source
system, it triggers the subscription to the Seed Event Group with the Local
source type. The Event Manager generates the event message, which
contains the definitions of all the Event Manager objects on the local
system, including events, event groups, systems, agents, and subscriptions.
Then the event message is sent to the specified inbound agent on the target
system, or to the specified workflow process that sends the event message
to the target system.
When the Synchronize Event Systems event is received on the target
system, it triggers the subscription to the Seed Event Group with the
Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 26

External source type. Oracle Workflow loads the object definitions from
the event message into the Event Manager on the target system, creating
new definitions or updating existing definitions as necessary.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 27

Automatic Replication
Automatic Replication

When the predefined subscriptions to the Seed


Event Group are enabled, these subscriptions will
replicate any changes you make to Event Manager
object definitions on the source system.

If you do not want to continue automatically


replicating changes after synchronizing systems,
you can:
Disable the subscriptions
Disable the predefined events
for those changes

Copyright Oracle Corporation, 2001. All rights reserved.

Automatic Replication
When the relevant events and subscriptions are enabled, Oracle Workflow
performs automatic replication as follows:
Whenever you create, update, or delete events, event group members,
systems, agents, or subscriptions, Oracle Workflow raises the
corresponding predefined events.
These events trigger the Local subscription to the Seed Event Group on
the source system, which sends the object definition data to the target
system.
The External subscription to the Seed Event Group on the target system
receives the data and adds, updates, or deletes the object definition in the
Event Manager there.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 28

Master/Copy Systems
Master/Copy Systems

You can choose to treat one system as a master


system that has one or more copy systems
associated with it.
A master system replicates its own Event Manager
object definitions to its copy systems, but does
not accept any object definition changes from
those systems.

Copyright Oracle Corporation, 2001. All rights reserved.

To Set Up Master/Copy Replication:


1. Synchronize the target copy systems with the source master system.
2. Ensure that the Local subscription to the Seed Event Group on the copy
systems is disabled.
3. Ensure that the External subscription to the Seed Event Group on the
master system is disabled.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 29

Reviewing Event Messages on Local Agents


Reviewing Event Messages on Local
Agents

Use the Event System Local Queues page to


review the local agents and how many messages
are on their queues.
For queues that use the standard WF_EVENT_T
datatype as their payload type, you can also
review the message details.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 30

Reviewing Event Messages on Local Agents


Reviewing Event Messages on Local
Agents

Copyright Oracle Corporation, 2001. All rights reserved.

To Review Event Messages on Local Agents:


1. Use a web browser to connect to the following URL:
<webagent>/wf_event_html.eventqueuedisplay
Replace <webagent> with the base URL of the web agent configured for
Oracle Workflow in your Web server.
You can also access the Event System Local Queues web page from the
Oracle Workflow home page, <webagent>/wfa_html.home.
Note: You must have workflow administrator privileges to access the
Event Manager web pages.
2. The Event System Local Queues page appears, displaying a list of the
local agents used by the Business Event System.
3. You can review message details for queues that use the standard
WF_EVENT_T datatype as their payload type. To review message details,
choose the flashlight icon in the View Detail column for a queue.
4. The Find Standard Event Queue Messages page appears. Enter search
criteria to locate specific event messages. The search criteria are:
Event Name
Event Key
Status
5. Choose the Go button. The Local Queue Messages page appears,
displaying a list of event messages on the queue you selected that match
your search criteria.
Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 31

6. To review the XML document that contains the event data for a message,
choose the flashlight icon in the XML Document column for that message.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 32

Review Questions
Review Questions
1. What database init.ora parameters are required by
the Business Event System?
2. Which agents require listeners, and which agents
require propagations?
3. What is the definition of signing up a system?
4. What is the definition of synchronizing systems
with each other?

Copyright Oracle Corporation, 2001. All rights reserved.

Review Questions and Solutions


1. Which database init.ora parameters are required by the Business Event
System?
AQ_TM_PROCESSES
JOB_QUEUE_INTERVAL
JOB_QUEUE_PROCESSES
2. Which agents require listeners, and which agents require propagations?
Local inbound agents require listeners. Local outbound agents
require propagations.
3. What is the definition of signing up a system?
Signing up a system means defining the destination system and its
inbound agents in the Event Manager of the source system.
4. What is the definition of synchronizing systems with each other?
Synchronizing systems means replicating all the Event Manager
objects that are defined on the source system to the target system.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 33

Practice 1 Overview
Practice 1 Overview
This practice covers the following topics:

Defining a subscription that sends an event to an


agent

Defining a subscription to handle the event when it


is received

Raising an event to trigger the subscription


Reviewing event messages on local queues

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 34

Practice 1: Sending an Event to an Agent


Practice 1:
Sending an Event to an Agent
1. Define a subscription to send the
XX.oracle.workflow.bes.event.new event from the
WF_OUT agent to the WF_IN agent on the local
system.
Replace XX with your terminal number.
2. Define a subscription to handle the event by
running WF_RULE.Success when the event is
received by the inbound agent.
3. Raise the event to trigger your subscription.
4. Review the event messages on the local queues.

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
In this practice, you will define one subscription that sends an event to a local
inbound agent and another subscription that handles the event by returning the
status code SUCCESS when the event is received by that agent. Next, you will
raise the event to trigger your first subscription. The second subscription will be
triggered in turn when the first subscription sends the event to the agent. Finally,
you will review the messages on the local inbound and outbound queues to
confirm that the sending subscription was executed successfully.
Note: Because many students access the system and create objects during this
course, you need a way to distinguish between the objects created by you and by
your classmates. Therefore, you will be assigned a terminal number by your
instructor. Use this number as a prefix wherever you see XX included in the
name of something you are defining. In this way, you can ensure that the
definitions you create are unique.
Step 1
1. Use a web browser to connect to the Oracle Workflow home page with the
URL provided by the instructor. Log in as any user with workflow
administrator privileges.
2. Choose the Event Subscriptions link.
3. In the Event Subscriptions page, choose the Add Subscription button to
open the Edit Subscription page.
4. In the System field, select the local system as the subscriber.
5. In the Source Type field, select Local.
Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 35

6. In the Event Filter field, select the XX.oracle.workflow.bes.event.new


event that you defined in the Defining an Event practice. If you have not
performed this practice, select an event provided by your instructor.
7. Leave the Source Agent field blank.
8. Enter 20 in the Phase field.
9. In the Status field, select Enabled.
10. In the Rule Data field, select Key.
11. Leave the Rule Function field blank to use the default rule function to
send the event to an agent.
12. Leave the Workflow Item Type, Workflow Process Name, Parameters,
Owner Name, and Owner Tag fields blank. Leave the Priority field set to
the default value, which is Normal.
13. In the Out Agent field, select the agent WF_OUT@<local system>.
14. In the To Agent field, select the agent WF_IN@<local system>.
15. In the Description field, enter XX Send to Agent Subscription.
16. Choose the Submit button to save the subscription.
Step 2
1. Navigate back to the Event Subscriptions page.
2. Choose the Add Subscription button to open the Edit Subscription page.
3. In the System field, select the local system as the subscriber.
4. In the Source Type field, select External.
5. In the Event Filter field, select the XX.oracle.workflow.bes.event.new
event that you defined in the Defining an Event practice. If you have not
performed this practice, select the event you defined as the event filter for
the first subscription.
6. Leave the Source Agent field blank.
7. Enter 20 in the Phase field.
8. In the Status field, select Enabled.
9. In the Rule Data field, select Key.
10. Enter WF_RULE.Success in the Rule Function field.
11. Leave the Workflow Item Type, Workflow Process Name, Out Agent, To
Agent, Parameters, Owner Name, and Owner Tag fields blank. Leave the
Priority field set to the default value, which is Normal.
12. In the Description field, enter XX Receive from Agent Subscription.
13. Choose the Submit button to save the subscription.
Step 3
1. Navigate back to the Oracle Workflow home page.
2. Choose the Raise Event link.
3. In the Event Name field, select XX.oracle.workflow.bes.event.new, or
whichever event you defined as the event filter for your subscription.
4. In the Event Key field, enter a unique event key such as XX61.
Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 36

5. In the Event Data field, enter the following sample XML document:
<DATA>Test Data</DATA>
6. Choose the Submit button to raise the event.
7. Choose OK in the confirmation window.
Step 4
1. Navigate back to the Oracle Workflow home page.
2. Choose the Event Queue Summary link.
3. In the Event System Local Queues page, review the number of messages
on the local WF_IN and WF_OUT agents queues.
4. Choose the flashlight icon for the WF_OUT agent.
5. In the Find Standard Event Queue Messages page, select Any in the Status
field and choose Go.
6. In the Local Queue Messages page, locate the message with your event
key. Choose the flashlight icon for that message to review the XML
document contained in the message.
7. Navigate back to the Event System Local Queues page.
8. Choose the flashlight icon for the WF_IN agent.
9. In the Find Standard Event Queue Messages page, select Any in the Status
field and choose Go.
10. In the Local Queue Messages page, locate the message with your event
key. Choose the flashlight icon for that message to review the XML
document contained in the message.
Note: The amount of time it takes for the inbound message to appear on
the WF_IN queue depends on the propagation scheduled for WF_OUT
and the listener scheduled for WF_IN.
When the event message is received by the WF_IN agent, the Event
Manager executes the External subscription you defined to that event.
Because that subscription simply runs the WF_RULE.Success function to
return the status code SUCCESS, it does not produce any visible results in
the Workflow web pages. However, it is important to define the External
subscription to handle the event when it is received in order to avoid
having the Event Manager generate an unexpected event error notification.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 37

Practice 1: Sending an Event to an Agent


Practice 1:
Sending an Event to an Agent

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you complete this practice, the first subscription definition should look
similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 38

Practice 1: Sending an Event to an Agent


Practice 1:
Sending an Event to an Agent

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you complete this practice, the second subscription definition should look
similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 39

Practice 1: Sending an Event to an Agent


Practice 1:
Sending an Event to an Agent

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you raise your event for this practice, the raise event details should look
similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 40

Summary
Summary
In this lesson, you should have learned how to:

Check the Business Event System setup.

Synchronize Business Event System data on


different systems.

Review event messages on local agents.

Schedule listeners for inbound agents.


Schedule propagation for outbound agents.
Sign up systems with each other for event
message propagation.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 41

Copyright Oracle Corporation, 2001. All rights reserved.

Configuring Oracle Workflow for Event Communication


Chapter 6 - Page 42

Event Activities in Workflow


Processes
Chapter 7

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 1

Event Activities in Workflow Processes

Event Activities in Workflow Processes

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Define attributes of type Event.

Define event activities.

Define external Java function activities.

Describe the possible actions for an event activity.


Send an event to a workflow process to start or
continue the process.
Define event details for event activity nodes.
Use standard activities to manage information
from event messages.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 3

Example: Order Processing


Example: Order Processing

Copyright Oracle Corporation, 2001. All rights reserved.

Example: Order Processing


This example shows a workflow process that includes business events. The
example comes from the Event System Demonstration workflow. This process
includes activities that receive a purchase order event to launch the workflow,
send the purchase order event to a supplier, and wait to receive other events
from the supplier in response to the order, such as an order acknowledgement,
advanced shipment notice, and invoice.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 4

Event Attribute Type


Event Attribute Type

When you define workflow process components,


you can assign the attribute type Event to item and
activity attributes.
An attribute of type Event is a representation of an
event message in the standard WF_EVENT_T
structure.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 5

Defining an Attribute of Type Event


Defining an Attribute of Type Event

Copyright Oracle Corporation, 2001. All rights reserved.

To Define an Attribute of Type Event:


1. In the Oracle Workflow Builder, select the item type or activity that you
want in the navigator tree. Then choose New Attribute from the Edit
menu.
2. In the Attribute property page, enter an internal name for the attribute. The
internal name must be all uppercase without any leading or trailing spaces.
3. Enter a display name for the attribute.
4. Enter a description of the attribute.
5. In the Type field, select the data type Event.
6. If you are defining an activity attribute, optionally specify an item attribute
of type Event as the default value.
7. Choose Apply to save your changes.
8. If you are defining an item type attribute, optionally select the Access tab
to set the access levels allowed to modify this attribute.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 6

Event Activities
Event Activities

An event activity represents a business event


within a workflow process.

You can include event activities in workflow


processes to model complex processing or
routing logic based on the content of an event.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 7

Event Activity Actions


Event Activity Actions
An event activity can:

Receive an event from the Event Manager


Raise an event to the Event Manager
Send an event message to an agent

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 8

Receive Event Activities


Receive Event Activities

If you send an event to a workflow process from a


subscription, the process must include a Receive
event activity to accept the event.
An event sent to a process can:
Launch a new processThe Receive event
activity must be marked as a Start activity.
Continue an existing processThe correlation
ID in the event message matches
the event with the running
process.

Copyright Oracle Corporation, 2001. All rights reserved.

Receive Event Activities


If a Receive event activity is marked as a Start activity, it is always enabled to
receive events. Otherwise, the Receive event activity can only receive events
after the process transitions to that activity.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 9

Receive Event Activities


Receive Event Activities

The event filter for a Receive event activity


determines which event the activity can receive.

If the event filter is set to an individual events


internal name, the activity can receive only the
specified event.

If the event filter is blank, the activity can receive


any event.

Copyright Oracle Corporation, 2001. All rights reserved.

Receive Event Activities


You can only specify an individual event as the event filter for a Receive event
activity. The event filter cannot be an event group.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 10

Receive Event Activities


Receive Event Activities
When a Receive event activity receives an event, the
Workflow Engine:

Stores the event name, event key, and event


message in the item type attributes specified for
the activity node

Creates item type attributes to store any additional


parameters listed in the event message
Continues the thread of execution from the event
activity

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 11

Raise Event Activities


Raise Event Activities

A Raise event activity:


Retrieves the event name, event key, and event
data specified for the activity node

Raises the event to the Event Manager


When the event is raised, it triggers any eligible
subscriptions to that event by the local system.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 12

Send Event Activities


Send Event Activities

A Send event activity:


Retrieves the event name, event key, event
message, Out Agent, and To Agent specified
for the activity node
Sends the event message by placing it on the
Out Agents queue, addressed to the To Agent

When the event is received by the To Agent, it


triggers any eligible subscriptions to
that event by that agents system.

Copyright Oracle Corporation, 2001. All rights reserved.

Send Event Activities


A Send event activity sends the event directly from the Out Agent to the To
Agent without raising the event to the Event Manager. No subscription
processing is performed for the event on the sending system.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 13

Defining an Event Activity


Defining an Event Activity

Copyright Oracle Corporation, 2001. All rights reserved.

To Define an Event Activity:


1. In the Oracle Workflow Builder, select the item type that you want in the
navigator tree. Then choose New Event from the Edit menu.
2. In the Activity property page, enter an internal name for the activity. The
internal name must be all uppercase without any colons or leading or
trailing spaces.
3. Enter a display name for the activity.
4. Enter a description of the activity.
5. Choose an icon that identifies the activity.
6. Select the Event Action for the activity.
Receive
Raise
Send
7. If you are defining a Receive event activity, you can optionally enter an
event filter to specify the event that the activity can receive.
To allow only a specified event for the activity, enter the full internal
event name.
To allow any event for the activity, leave the Event Filter field blank.
8. Enter an optional cost for the activity. For Raise or Send event activities,
you can use the cost to defer long running activities to a background
engine.
Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 14

9. Choose Apply to save your changes.


10. Optionally select the Details tab to display and modify additional activity
details.
11. Optionally select the Access tab to set the access levels allowed to modify
this event.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 15

Event Details
Event Details

When you add an event activity node to a workflow


process, define event details for the node.

The event details that are required depend on the


event activitys action.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 16

Defining Event Details: Receive


Defining Event Details: Receive

Copyright Oracle Corporation, 2001. All rights reserved.

To Define Event Details for a Receive Event Activity Node:


1. In the Oracle Workflow Builder, display the property pages of a Receive
event activity node. Select the Event Details tab.
2. Enter the following event details:
Event NameOptionally select an item type attribute of type text
where you want to store the event name that the node receives.
Event KeyOptionally select an item type attribute of type text
where you want to store the event key that the node receives.
Event MessageOptionally select an item type attribute of type
event where you want to store the event message that the node
receives.
3. Choose Apply to save your changes.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 17

Defining Event Details: Raise


Defining Event Details: Raise

Copyright Oracle Corporation, 2001. All rights reserved.

To Define Event Details for a Raise Event Activity Node:


1. In the Oracle Workflow Builder, display the property pages of a Raise
event activity node. Select the Event Details tab.
2. Enter the following event details:
Event NameEnter the name of the event that the node raises. You
can either specify a constant event name or select an item type
attribute of type text that dynamically determines the event name at
runtime.
Event KeySelect the item type attribute of type text that contains
the event key for the event that the node raises.
Event DataOptionally select an item type attribute of type text that
contains the event data for the event that the node raises.
Note: The event name and event key are required for a Raise event
activity.
Note: The maximum length of the data you can enter in a text attribute is
4000 bytes. If the event data exceeds 4000 bytes, you should assign a
Generate function in the event definition to generate the event data, rather
than providing the event data through a text attribute.
3. Choose Apply to save your changes.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 18

Defining Event Details: Send


Defining Event Details: Send

Copyright Oracle Corporation, 2001. All rights reserved.

To Define Event Details for a Send Event Activity Node:


1. In the Oracle Workflow Builder, display the property pages of a Send
event activity node. Select the Event Details tab.
2. Enter the following event details:
Event MessageSelect the item type attribute of type event that
contains the event message that the node sends.
Event NameOptionally enter the name of the event that the node
sends. You can either specify a constant event name or select an item
type attribute of type text that dynamically determines the event
name at runtime. The event name that you enter here overrides the
previous event name value in the event message.
Event KeyOptionally select an item type attribute of type text that
contains the event key of the event that the node sends. The event
key that you enter here overrides the previous event key value in the
event message.
Out AgentOptionally enter the outbound agent from which the
node sends the event. Specify both the agent name and the system
name for the agent using the following format:
<agent_name>@<system_name>
You can either specify a constant Out Agent name or select an item
type attribute of type text that dynamically determines the Out Agent
name at runtime. The Out Agent that you enter here overrides the
previous outbound agent value in the event message.
Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 19

To AgentOptionally enter the inbound agent to which the node


sends the event. Specify both the agent name and the system name
for the agent using the following format:
<agent_name>@<system_name>
You can either specify a constant To Agent name or select an item
type attribute of type text that dynamically determines the To Agent
name at runtime. The To Agent that you enter here overrides the
previous inbound agent value in the event message.
Note: The Event Message is required for a Send event activity.
Additionally, you must either include the To Agent within the event
message or specify the To Agent in the event details for this node. If you
do not specify a To Agent, the event cannot be sent.
3. Choose Apply to save your changes.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 20

Standard Activities
Standard Activities

Oracle Workflow provides standard activities that


let you access information within event messages.
Event message header properties
XML tag sets within an event data XML
document

You can model routing or processing logic in your


workflow process based on the contents of event
messages.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 21

Standard Activities
Standard Activities
Use the following standard activities to manage the
contents of event messages:
XML Get Tag Value
Get Event Property
Set Event Property
XML Compare Tag
Value (Date, Number,
Compare Event
Text)
Property

XML Transform

Copyright Oracle Corporation, 2001. All rights reserved.

Standard Activities
Get Event PropertyRetrieves a property of an event message and stores
the property value in an item attribute.
Set Event PropertySets the value of a property in an event message.
Compare Event PropertyCompares a property of an event message with
a test value.
XML Get Tag ValueRetrieves the data contained within a particular
XML tag set in an event message and stores the data in an item attribute.
XML Compare Tag Value (Date)Compares the data contained within a
particular XML tag set in an event message with a test date value.
XML Compare Tag Value (Number)Compares the data contained
within a particular XML tag set in an event message with a test number
value.
XML Compare Tag Value (Text)Compares the data contained within a
particular XML tag set in an event message with a test text value.
XML TransformApplies an XML style sheet to the payload of an event
message and stores the resulting document in an item attribute.
Note: The XML Get Tag Value, XML Compare Tag Value, and XML
Transform activities are external Java function activities and require the Java
Function Activity Agent as well as a background engine to complete their
processing.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 22

For more information, refer to the Standard Activities chapter in the Oracle
Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 23

External Java Function Activities


External Java Function Activities

An external Java function activity is a function


activity that runs a Java program on the middle
tier.
The standard activities for accessing XML
documents are defined as external Java function
activities.
You can also define your own external Java
function activities.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 24

External Java Function Activities


External Java Function Activities

An external Java function activity enqueues an


entry on the 'Outbound' queue.

The Oracle Workflow Java Function Activity Agent


dequeues messages of this type, executes the
Java program, and enqueues the results on the
'Inbound' queue.

A background engine dequeues messages from


the Inbound queue and completes the function
activity to continue the workflow
process.

Copyright Oracle Corporation, 2001. All rights reserved.

External Java Function Activities


Before you can execute external Java function activities, you must perform the
setup steps to run the Java Function Activity Agent and a background engine, to
process messages on the Outbound and Inbound queues, respectively.
Note: The Outbound and Inbound queues used for external function
activities are separate from the queues used for the Business Event System.
For more information, refer to the Setting Up Oracle Workflow chapter in the
Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 25

External Java Function Activities


External Java Function Activities

Java procedures called by external Java functions


must follow a standard API.

These Java procedures are implemented as


classes that extend the WFFunctionAPI class.

You must include the JAR files containing your


custom Java classes in your CLASSPATH.

Copyright Oracle Corporation, 2001. All rights reserved.

External Java Function Activities


A Java procedure for an external Java function activity must have the following
standard API:
package oracle.apps.fnd.wf;
import
import
import
import
import

java.io.*;
java.sql.*;
java.math.BigDecimal;
oracle.sql.*;
oracle.jdbc.driver.*;

import oracle.apps.fnd.common.*;
import oracle.apps.fnd.wf.engine.*;
import oracle.apps.fnd.wf.*;
public class className extends WFFunctionAPI {
public boolean execute(WFContext pWCtx){
ErrorStack es = pWCtx.getWFErrorStack();
try

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 26

{
WFAttribute lAAttr = new WFAttribute();
WFAttribute lIAttr = new WFAttribute();
loadActivityAttributes(pWCtx);
loadItemAttributes(pWCtx);
lAAttr = getActivityAttr("AATTR");
lIAttr = getItemAttr("IATTR");
<your executable statements>
lIAttr.value((Object)"NEWVALUE");
setItemAttrValue(pWCtx, lIAttr);
}
catch (Exception e)
{
es.addMessage("WF","WF_FN_ERROR");
es.addToken("MODULE",this.getClass().
getName());
es.addToken("ITEMTYPE",itemType);
es.addToken("ITEMKEY",itemKey);
es.addToken("ACTID",actID.toString());
es.addToken("FUNCMODE",funcMode);
es.addToken("ERRMESSAGE",e.getMessage());
return false;
}
return true;
}
}
The parameters available as class variables are:
itemTypeThe internal name for the item type.
itemKeyA string that represents a primary key generated by the
workflow-enabled application for the item type. The string uniquely
identifies the item within an item type.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 27

ActIDThe ID number of the activity from which this procedure is


called.
funcModeThe execution mode of the activity. Currently the only
supported mode for external Java function activities is the 'RUN' mode.
resultOutIf a result type is specified in the Activities properties page for
the activity in the Oracle Workflow Builder, this parameter represents the
expected result that is returned when the procedure completes.
Note: Unlike the resultout for a PL/SQL procedure called by a function
activity, the resultOut for a Java procedure does not include a status code.
In the Java API, only the result type value is required. The status of the
activity will be set automatically by the Workflow Engine depending on
whether there is a value in the errorStack variable.
For more information, refer to the Defining Procedures and Functions for
Oracle Workflow chapter in the Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 28

Defining an External Java Function Activity


Defining an External Java Function
Activity

Copyright Oracle Corporation, 2001. All rights reserved.

To Define an External Java Function Activity:


1. In the Oracle Workflow Builder, select the item type that you want in the
navigator tree. Then choose New Function from the Edit menu.
2. In the Activity property page, enter an internal name for the activity. The
internal name must be all uppercase without any colons or leading or
trailing spaces.
3. Enter a display name for the activity.
4. Enter a description of the activity.
5. Choose an icon that identifies the activity.
6. Enter the the class name of your custom Java class as the name of the
function you want this activity to execute.
If the custom class is within a package, prefix the class name with the
package name in the following format:
<customPackage>.<customClass>
The Java class must be defined according to a standard API.
7. Select External Java as the function type.
8. Indicate the result type (a predefined lookup type) for this activity. Result
types list the possible results that the activity can return.
9. Enter an optional cost for the activity. For Raise or Send event activities,
you can use the cost to defer long running activities to a background
engine.
10. Choose Apply to save your changes.
Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 29

11. Optionally select the Details tab to display and modify additional activity
details.
12. Optionally select the Access tab to set the access levels allowed to modify
this event.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 30

Practice 1 Overview
Practice 1 Overview
This practice covers defining an item type that
includes an event activity.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 31

Practice 1: Defining an Item Type with an Event Activity


Practice 1:
Defining an Item Type with an Event
Activity
1. Define a new item type and process using the
Quick Start Wizard.
2. Define item attributes of type Text for the event
name and event key, and an item attribute of type
Event for the event message.
3. Define an event activity with the following
properties:
Event action: Receive
Event filter: XX.oracle.workflow.bes.event.new
Replace XX with your terminal number.

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
In this practice, you will define an item type that includes a Receive event
activity as well as some item attributes related to the event. You will continue
defining this item type in the next practice, Defining a Workflow Process with
an Event Activity Node.
Note: Because many students access the system and create objects during this
course, you need a way to distinguish between the objects created by you and by
your classmates. Therefore, you will be assigned a terminal number by your
instructor. Use this number as a prefix wherever you see XX included in the
name of something you are defining. In this way, you can ensure that the
definitions you create are unique.
1. Start the Oracle Workflow Builder.
2. From the File menu, choose Quick Start Wizard.
3. Define the following properties for the new item type:
Internal Name: XXRECEVT
Display Name: XX Receive Event Type
Persistence Type: Temporary
Number of Days: 0
4. Define the following properties for the process:
Internal Name: XXEVENTPROCESS
Display Name: XX Receive Event Process
Choose OK.
Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 32

5. Close the XX Receive Event Process diagram window. You will define
the diagram for this process in the next practice.
6. In the Navigator window, select the XX Receive Event item type.
7. From the Edit menu, choose New > Attribute.
8. Define the following properties for the item attribute:
Internal Name: EVENTNAME
Display Name: Event Name
Description: Event Name
Type: Text
Choose OK.
9. From the Edit menu, choose New > Attribute.
10. Define the following properties for the item attribute:
Internal Name: EVENTKEY
Display Name: Event Key
Description: Event Key
Type: Text
Choose OK.
11. From the Edit menu, choose New > Attribute.
12. Define the following properties for the attribute:
Internal Name: EVENTMESSAGE
Display Name: Event Message
Description: Event Message
Type: Event
Choose OK.
13. From the Edit menu, choose New > Event.
14. Define the following properties for the event:
Internal Name: XXEVENT
Display Name: XX Receive Event
Description: XX Receive Event
15. Leave the icon and cost set to the default values.
16. Select Receive as the event action.
17. In the Event Filter field, enter XX.oracle.workflow.bes.event.new, the
event that you defined in the Defining an Event practice. If you have not
performed this practice, enter an event provided by your instructor.
18. Choose OK.
19. From the File menu, choose Save As and save your new data store and
item type to a workflow definition file named XXbes.wft.
Note: Refer to the Workflow definition file XXbes.wft for a sample solution.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 33

Practice 1: Defining an Item Type with an Event Activity


Practice 1:
Defining an Item Type with an Event
Activity

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you complete this practice, your Receive event activity definition should
look similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 34

Practice 1: Defining an Item Type with an Event Activity


Practice 1:
Defining an Item Type with an Event
Activity

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you complete this practice, the navigator tree for your XXbes data store
should look similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 35

Practice 2 Overview
Practice 2 Overview
This practice covers the following topics:

Defining a workflow process that includes an


event activity node.

Defining event details for an event activity node.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 36

Practice 2: Defining a Workflow Process with an Event


Activity Node
Practice 2:
Defining a Workflow Process with an
Event Activity Node
For the workflow process created during the previous
practice, define a process diagram that includes the
following activities:
The Receive event activity defined during the
previous practice, marked as a Start activity

A standard Noop activity


A standard End activity

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 2 Solution
In this practice, you will define the process diagram for the process activity that
you created in the Defining an Item Type with an Event Activity practice.
Ensure that you complete that practice before beginning this one. You will
launch your workflow process in the next practice, Launching a Workflow
Process from the Business Event System.
1. Start the Oracle Workflow Builder.
2. From the File menu, choose Open to open the XXbes.wft data store you
defined in the previous practice.
3. Expand the navigator tree and select the XX Receive Event Process in
your XX Receive Event Type item type.
4. Double-click the XX Receive Event Process to display the process diagram
window.
5. Delete the default Start activity from the process diagram.
6. Drag the XX Receive Event activity into the process diagram.
7. Double-click the XX Receive Event activity node and choose the Node tab.
8. In the Start/End field, select Start.
9. Choose the Event Details tab.
10. In the Event Name field, select the Event Name item attribute.
11. In the Event Key field, select the Event Key item attribute.
Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 37

12. In the Event Message field, select the Event Message item attribute.
13. Choose OK.
14. Drag the standard Noop function activity from the Standard item type into
the process diagram. This Noop activity represents a point in the process
where you could add additional processing for the event.
15. Draw a transition from the XX Receive Event activity to the Noop activity.
16. Draw a transition from the Noop activity to the default End activity in the
process diagram.
17. Double-click the End activity node and choose the Node tab.
18. Ensure that the Start/End field is set to End.
19. Choose OK.
20. From the File menu, choose Save to save your work to your workflow
definition file.
21. From the File menu, choose Save As and save your item type to the class
database, using the database username, password, and connect string
provided by the instructor.
Note: Refer to the Workflow definition file XXbes.wft for a sample solution.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 38

Practice 2: Defining a Workflow Process with an Event


Activity Node
Practice 2:
Defining a Workflow Process with an
Event Activity Node

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 2 Solution
When you complete this practice, the event details for your Receive event
activity node should look similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 39

Practice 2: Defining a Workflow Process with an Event


Activity Node
Practice 2:
Defining a Workflow Process with an
Event Activity Node

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 2 Solution
When you complete this practice, the process diagram for your XX Receive
Event Process should look similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 40

Practice 3 Overview
Practice 3 Overview
This practice covers sending an event to a workflow
process to launch a new process instance.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 41

Practice 3: Launching a Workflow Process from the


Business Event System
Practice 3:
Launching a Workflow Process from the
Business Event System
1. Define a subscription to the
XX.oracle.workflow.bes.event.new event that
sends the event to the workflow process defined
during the previous practice.
2. Raise the event to trigger the subscription.
Replace XX with your terminal number.

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 3 Solution
In this practice, you will define a subscription to send an event to the workflow
process that you defined in the Defining a Workflow Process with an Event
Activity Node practice. Ensure that you complete that practice before beginning
this one. After completing this practice, you can review the process in the
Workflow Monitor to confirm that the subscription was executed and the
process completed successfully.
Step 1
1. Use a web browser to connect to the Oracle Workflow home page with the
URL provided by the instructor. Log in as any user with workflow
administrator privileges.
2. Choose the Event Subscriptions link.
3. In the Event Subscriptions page, choose the Add Subscription button to
open the Edit Subscription page.
4. In the System field, select the local system as the subscriber.
5. In the Source Type field, select Local.
6. In the Event Filter field, select the XX.oracle.workflow.bes.event.new
event that you defined in the Defining an Event practice. If you have not
performed this practice, select the event that you defined as the event filter
for your Receive event activity in the Defining an Item Type with an
Event Activity practice.
Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 42

7. Leave the Source Agent field blank.


8. Enter 30 in the Phase field.
9. In the Status field, select Enabled.
10. In the Rule Data field, select Key.
11. Leave the Rule Function field blank to use the default rule function to
send the event to a workflow process.
12. In the Workflow Item Type and Workflow Process Name fields, select the
item type and process name that you defined in the Defining an Item Type
with an Event Activity and Defining a Workflow Process with an Event
Activity Node practices.
13. Leave the Out Agent, To Agent, Parameters, Owner Name, and Owner
Tag fields blank. Leave the Priority field set to the default value, which is
Normal.
14. In the Description field, enter XX Workflow Receive Event Subscription.
15. Choose the Submit button to save the subscription.
Step 2
1. Navigate back to the Oracle Workflow home page.
2. Choose the Raise Event link.
3. In the Event Name field, select XX.oracle.workflow.bes.event.new, or
whichever event you defined as the event filter for your subscription.
4. In the Event Key field, enter a unique event key such as XX73.
5. For the purposes of this practice, since your workflow will not perform
any further processing for the event, you do not need to enter any event
data. Leave the Event Data field blank.
6. Choose the Submit button to raise the event.
7. Choose OK in the confirmation window.
When you raise your event on the local system, it should trigger your new
subscription that sends the event to your workflow process. You can
review the status of the process in the Workflow Monitor by choosing the
Find Processes link from the Workflow home page and searching for the
process with your item type and with your event key as the item key.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 43

Practice 3: Launching a Workflow Process from the


Business Event System
Practice 3:
Launching a Workflow Process from the
Business Event System

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 3 Solution
When you complete this practice, your subscription definition should look
similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 44

Practice 3: Launching a Workflow Process from the


Business Event System
Practice 3:
Launching a Workflow Process from the
Business Event System

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 3 Solution
When you raise your event for this practice, the raise event details should look
similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 45

Practice 3: Launching a Workflow Process from the


Business Event System
Practice 3:
Launching a Workflow Process from the
Business Event System

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 3 Solution
When you complete this practice, the diagram for your process in the Workflow
Monitor should look similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 46

Summary
Summary
In this lesson, you should have learned how to:

Define an item attribute of type Event.

Define event activities.

Describe the possible actions for an event activity.


Send an event to a workflow process to start or
continue the process.
Define event details for event activity nodes.
Use standard activities to manage information
from event messages.
Define external Java function activities.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 47

Copyright Oracle Corporation, 2001. All rights reserved.

Event Activities in Workflow Processes


Chapter 7 - Page 48

Sample Business Event


Based Workflow Processes
Chapter 8

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 1

Sample Business Event Based Workflow Processes

Sample Business Event Based


Workflow Processes

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Ping agents using Workflow Agent


Ping/Acknowledge.

Send events through a workflow process using the


Workflow Send Protocol.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 3

Workflow Agent Ping/Acknowledge


Workflow Agent Ping/Acknowledge
Business Event System
WF_OUT

WF_IN

AQ
Propagation

Workflow
Engine

Event
Manager

Listen

Listen

Event
Manager

AQ
Propagation

WF_IN

WF_OUT

Copyright Oracle Corporation, 2001. All rights reserved.

Workflow Agent Ping/Acknowledge


The Workflow Agent Ping/Acknowledge workflow process sends a ping event
to each inbound agent on the local system or external systems. When the
inbound agent receives the ping event, the Event Manager on that system sends
an acknowledgement event back to the workflow process.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 4

Workflow Agent Ping/Acknowledge


Workflow Agent Ping/Acknowledge

The Workflow Agent Ping/Acknowledge workflow


tests the Business Event System setup.
Sends a ping event message to each inbound
agent on the local system or external systems
Waits to receive an acknowledgement event
message from each of the agents

If the workflow completes successfully, then the


basic setup for communication
with these agents is complete.

Copyright Oracle Corporation, 2001. All rights reserved.

Workflow Agent Ping/Acknowledge


The Workflow Agent Ping/Acknowledge workflow uses the predefined Ping
Agent and Acknowledge Ping events, together with the predefined subscriptions
to these events, to perform the ping processing. For more information, refer to
the Managing Business Events chapter and the Predefined Workflow Events
chapter in the Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 5

Workflow Agent Ping/Acknowledge


Workflow Agent Ping/Acknowledge

The Workflow Agent Ping/Acknowledge item type


contains two processes:
Master Ping Process

Detail Ping Process


Use the Launch Processes web page to launch the
Workflow Agent Ping/Acknowledge workflow.
Select the Master Ping process
Enter a unique item key

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 6

Master Ping Process


Master Ping Process

Copyright Oracle Corporation, 2001. All rights reserved.

Master Ping Process


The Workflow Agent Ping/Acknowledge workflow begins when you
launch the Master Ping Process using the Launch Processes web page.
The workflow begins with the Start activity.
The master process spawns a detail process for each inbound agent that
you have defined on the local system or on external systems.
Each detail process pings an agent by sending it a Ping Agent event and
waits to receive an acknowledgement in the form of an Acknowledge Ping
event.
In the master process, a Wait for Flow activity waits for all the detail
processes to complete.
When all the detail processes have completed, the master process ends.
For more information, refer to the Managing Business Events chapter in
the Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 7

Detail Ping Process


Detail Ping Process

Copyright Oracle Corporation, 2001. All rights reserved.

Detail Ping Process


The Detail Ping process begins when it is launched by the Master Ping
process.
The process begins with the Start activity.
Next, the process sends a Ping Agent event to the selected inbound agent.
The process waits to receive an Acknowledge Ping event back from the
agent. When the acknowledgement is received, the master process can
continue.
The detail process ends at this point.
For more information, refer to the Managing Business Events chapter in
the Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 8

Workflow Send Protocol


Workflow Send Protocol

The Workflow Send Protocol process is an


example of request/reply messaging.

This sample process demonstrates using a


workflow process to receive, send, and
acknowledge event messages.

You can copy or customize this process to


accommodate your organization's specific needs.

Copyright Oracle Corporation, 2001. All rights reserved.

Workflow Send Protocol


The Workflow Send Protocol workflow uses the predefined Workflow Send
Protocol and Workflow Send Protocol Acknowledgement events, together with
the predefined subscriptions to these events, to perform the send processing. To
use the Workflow Send Protocol to send an event to an agent, you must update
the appropriate Workflow Send Protocol event subscription with the To Agent
that you want to receive the message. You can also optionally specify the Out
Agent that you want to send the message.
For more information, refer to the Predefined Workflow Events chapter in the
Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 9

Workflow Send Protocol


Workflow Send Protocol
The Workflow Send Protocol process:

Receives an event message from a subscription


Sends the event message to the inbound agent
specified in the subscription
Waits to receive an acknowledgement if required
Sends an acknowledgement if required

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 10

Workflow Send Protocol


Workflow Send Protocol

The Workflow Send Protocol item type contains


one process, the Workflow Event Protocol
process.
You can use this process on one system to send a
message to another system.
You can also use the same process on the second
system to receive the message and send an
acknowledgement back to the first system.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 11

Workflow Send Protocol


Workflow Send Protocol

The Workflow Send Protocol workflow is launched


when it receives an event from a subscription.

You can start the Workflow Send Protocol


workflow by any of the following methods:
Raising the Workflow Send Protocol event
locally
Receiving the Workflow Send Protocol event
from an external source
Sending any event to the Workflow Send
Protocol process from a
custom subscription

Copyright Oracle Corporation, 2001. All rights reserved.

Workflow Send Protocol


You can raise the Workflow Send Protocol event from the Raise event
page. Enter a unique event key, and enter any valid XML document as the
event data. A predefined subscription sends the event message to the
Workflow Event Protocol process.
The process can also be started when an agent receives the Workflow
Send Protocol event from an external source. A predefined subscription
sends the event message to the Workflow Event Protocol process.
Additionally, you can define your own subscription to send any event you
choose to the Workflow Event Protocol process. In the subscription,
specify the workflow item type as WFSNDPRT and the workflow process
name as WFEVPRTC. Ensure that you either use the default rule function
or include send processing in your custom rule function to send the event
to the workflow. The Workflow Event Protocol process starts when the
subscription is executed and the process receives the event message.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 12

Workflow Event Protocol Process


Workflow Event Protocol Process

Copyright Oracle Corporation, 2001. All rights reserved.

Workflow Event Protocol Process


The Workflow Send Protocol workflow begins when the Event Manager
sends an event message to the Workflow Event Protocol process.
The workflow begins with the Receive Message activity.
Next, the process attempts to retrieve the agent details for the intended
outbound and inbound agents from the subscription.
If no inbound agent is specified, the process continues immediately to the
second Compare Text node to determine whether to send an
acknowledgement message.
If the subscription does specify a To Agent, the process sends the event
message to that agent.
Then the process continues to the first Compare Text node to determine
whether the event message requires an acknowledgement from the
recipient, based on a subscription parameter.
If an acknowledgement is required, the Workflow Engine waits to receive
the acknowledgement message.
Otherwise, the process continues immediately to the second Compare Text
node to determine whether to send an acknowledgement message.
At the second Compare Text node, the process determines whether it
should send an acknowledgement of the original message that it received.
If no acknowledgement needs to be sent, the process ends at this point.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 13

Otherwise, the process retrieves the agent details for the inbound agent
where the acknowledgement must be sent and sends the acknowledgement
message to that agent. Then the process ends.
For more information, refer to the Predefined Workflow Events chapter in
the Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 14

Example: Order Processing


Example: Order Processing
Buyer
Workbench
WF_OUT@
BUYER

Raise

SUPPLIER
Event
Manager

Propagation

BUYER
Workflow Engine

BUYER
Event
Manager

WF_IN@
SUPPLIER

Propagation
SUPPLIER
Workflow Engine
WF_IN@
BUYER

WF_OUT@
SUPPLIER

Copyright Oracle Corporation, 2001. All rights reserved.

Example: Order Processing


This example shows how you can use events to build workflow processes that
transmit business documents between two systems. The example comes from
the Event System Demonstration workflow process. The business flow for a
purchase order is controlled by workflow processes on two different systems, a
Buyer system and a Supplier system, which use events to communicate with
each other.
The order processing is initiated when a purchase order is entered from a Buyer
Workbench on a Buyer system. Oracle Workflow generates a purchase order
XML document and sends this document to a Supplier system in an event
message. The Supplier system processes the purchase order and sends back to
the Buyer system three event messages with XML documents representing a
purchase order acknowledgement, an advanced shipment notice, and an invoice.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 15

Example: Order Processing


Example: Order Processing

Copyright Oracle Corporation, 2001. All rights reserved.

Example: Order Processing


This example shows the Buyer: Top Level PO Process from the Event System
Demonstration workflow.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 16

Example: Order Processing


Example: Order Processing

Copyright Oracle Corporation, 2001. All rights reserved.

Example: Order Processing


This example shows the Supplier: Top Level Order Process from the Event
System Demonstration workflow.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 17

Practice 1 Overview
Practice 1 Overview
This practice covers pinging Business Event System
agents using Workflow Agent Ping/Acknowledge.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 18

Practice 1: Pinging Agents


Practice 1:
Pinging Agents
Launch the Workflow Agent Ping/Acknowledge
workflow with the following properties:
Item Key: XX81
Process Name: Master Ping Process
Replace XX with your terminal number.

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
In this practice, you will launch the Workflow Agent Ping/Acknowledge
process to ping all inbound agents defined in the Event Manager. After
completing the practice, you can review the process in the Workflow Monitor to
confirm that the appropriate acknowledgements were received and the process
completed successfully.
Note: Because many students access the system and create objects during this
course, you need a way to distinguish between the objects created by you and by
your classmates. Therefore, you will be assigned a terminal number by your
instructor. Use this number as a prefix wherever you see XX included in the
name of something you are defining. In this way, you can ensure that the
definitions you create are unique.
1. Use a web browser to connect to the Oracle Workflow home page with the
URL provided by the instructor. Log in as any user with workflow
administrator privileges.
2. Choose the Launch Processes link.
3. In the Launch Processes page, choose the Workflow Agent
Ping/Acknowledge item type.
4. In the Initiate Workflow page, enter XX81 in the Item Key field.
5. Select Master Ping Process in the Process Name field.
6. Choose OK.
7. Review the process activities in the Activities List page that appears.
Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 19

8. Choose View Diagram to review the status of the process in the Workflow
Monitor. If the process completes successfully, then the basic setup for
communication with the inbound agents defined in the Event Manager is
complete.
You can also review the Ping Agent and Acknowledge Ping event
messages on the local queues by choosing Event Queue Summary from
the Workflow home page.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 20

Practice 1: Pinging Agents


Practice 1:
Pinging Agents

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you launch the workflow process for this practice, the process details
should look similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 21

Review Questions
Review Questions
1. How can you set up the Workflow Send Protocol to
send a local event to a remote agent?
2. How can the Workflow Send Protocol workflow be
started?

Copyright Oracle Corporation, 2001. All rights reserved.

Review Questions and Solutions


1. How can you set up the Workflow Send Protocol to send a local event to a
remote agent?
Enter the agent as the To Agent in the predefined Local subscription
to the Workflow Send Protocol event. You can also optionally specify
the Out Agent from which you want to send the event.
2. How can the Workflow Send Protocol process be started?
You can start the Workflow Send Protocol process by any of the
following methods:
Raising the Workflow Send Protocol event locally
Receiving the Workflow Send Protocol event from an external
source
Sending any event to the Workflow Send Protocol process from
a custom subscription

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 22

Summary
Summary
In this lesson, you should have learned how to:

Ping agents using Workflow Agent


Ping/Acknowledge.

Send events through a workflow process using the


Workflow Send Protocol.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 23

Copyright Oracle Corporation, 2001. All rights reserved.

Sample Business Event Based Workflow Processes


Chapter 8 - Page 24

Error Handling for


Subscription Processing
Chapter 9

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 1

Error Handling for Subscription Processing

Error Handling for Subscription


Processing

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Describe the status codes returned by


subscription rule functions.

Describe the WF_ERROR agent.


Explain the Default Event Error process.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 3

Rule Function Status Codes


Rule Function Status Codes

A subscription rule function can return the


following status codes:
SUCCESS
WARNING
ERROR

The Event Manager uses these status codes to


monitor the status of the subscription
processing for an event.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 4

Errors in Subscription Processing


Errors in Subscription Processing

If a rule function returns a status code of


WARNING or ERROR, the Event Manager places
the event message on the standard WF_ERROR
agents queue.

For a WARNING status, the Event Manager then


continues subscription processing for the event.

For an ERROR status, the Event Manager halts


subscription processing for the event and
rolls back any subscriptions already
executed for the event.

Copyright Oracle Corporation, 2001. All rights reserved.

Errors in Subscription Processing


Note: If a rule function raises an exception, the Event Manager rolls back all
subscription processing for the event and raises the error to the calling
application. In this case the event message is not placed on the WF_ERROR
queue.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 5

WF_ERROR Agent
WF_ERROR Agent

WF_ERROR is a standard agent for error handling


that is automatically defined on the local system
when you install Oracle Workflow.
You must schedule a listener to monitor the
WF_ERROR agent and dequeue messages from its
queue.
All event messages that are dequeued from the
WF_ERROR queue are assigned a source type of
Error.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 6

Error Handling Subscriptions


Error Handling Subscriptions

When an event is dequeued from the WF_ERROR


queue, it triggers any subscriptions by the local
system to that event or to the Any event with the
source type Error.

A predefined Error subscription to the Any event


sends the event message to the Default Event
Error process in the System: Error item type.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling Subscriptions


You must not change or disable the definition of the Any event or of the
predefined Error subscription to that event. If you do, the Event Manager will
not be able to perform error handling for event and subscription processing.
You can set up custom error handling for a particular event by defining a
subscription to that event with a source type of Error and specifying the custom
processing you want to execute as the subscription action.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 7

Unexpected Events
Unexpected Events

If an event is received from an external source, but


the local system does not have any subscriptions
to that event, Oracle Workflow automatically
searches for exceptions to the predefined
Unexpected event.

A predefined External subscription to the


Unexpected event sends the event message to the
Default Event Error process in the System: Error
item type.

Copyright Oracle Corporation, 2001. All rights reserved.

Unexpected Events
Oracle Workflow also provides a predefined Local subscription to the
Unexpected event that sends the event message to the Default Event Error
process when there are no subscriptions to a locally raised event. This
subscription is disabled by default. To use this subscription, you must enable it.
Attention: If you want to enable this subscription, be careful to consider all the
events that can be raised on your local system and trigger the subscription.
Many local events may be raised to which you do not want to subscribe.
Additionally, if a large number of events are raised on the local system,
enabling this subscription may flood the Business Event System.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 8

Default Event Error Process


Default Event Error Process
The Default Event Error Process:

Sends an administrator a notification when an


error or warning condition occurs during event
subscription processing

Provides information to the administrator about


the error

Allows the administrator to abort or retry the event


subscription processing,
depending on the error type

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 9

Event Warnings
Event Warnings

For a warning condition, the Default Event Error


Process sends the administrator a warning
message.
The warning message is an FYI notification and
does not require a response.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 10

External Event Errors


External Event Errors

For an error in subscription processing for an


external event, the Default Event Error Process
sends the administrator an error message that
requests a response.

The administrator can:


Abort subscription processing for the event
Enqueue the event message back onto the
queue where it was originally
received

Copyright Oracle Corporation, 2001. All rights reserved.

External Event Errors


Abort
For example, if the event data contained in an event message is corrupted, the
system administrator can abort subscription processing on that event message.
Enqueue Event
The event message is enqueued on its original queue with a priority of -1 so that
it will be the first message to be dequeued the next time the listener runs.
The system administrator can attempt to correct the error before
re-enqueuing the event. For example, the system administrator can create a
subscription to handle an unexpected event and then re-enqueue the event
message to trigger the new subscription.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 11

Local Event Errors


Local Event Errors

For an error in subscription processing for a local


event, the Default Event Error Process sends the
administrator an error message that requests a
response.

The administrator can:


Abort subscription processing for the event
Reraise the event with the event name and key
Reraise the event with the
event name, key, and data
Reraise the event with the
event name, key, data, and
parameters

Copyright Oracle Corporation, 2001. All rights reserved.

Local Event Errors


The system administrator can choose the level of information to provide to the
Event Manager when reraising the event. For example, if an error exists in the
event data that was originally provided, the event can be reraised with only the
event name and the event key, forcing the Event Manager to regenerate the
event data using the event's Generate function.
The system administrator can also attempt to correct the error before reraising
the event.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 12

Default Event Error Process


Default Event Error Process

Copyright Oracle Corporation, 2001. All rights reserved.

Default Event Error Process


The Default Event Error Process begins when the Event Manager sends an
errored event message to the process.
The workflow begins with the Receive Errored Queue Message activity.
Next, the process determines the error type:
Event Warning
External Event Error
Local Event Error
The process notifies the administrator of the error, sending different
messages depending on the error type.
For an Event Warning condition, the process ends after the notification is
sent.
For an External Event Error, the next activity depends on the
administrators response.
AbortThe process ends.
Enqueue EventThe process retries subscription processing for the
event by re-enqueuing the event on its original queue. Then the
process ends.
For a Local Event Error, the next activity also depends on the
administrators response.
AbortThe process ends.
Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 13

Raise Event with Event Key, Raise Event with Event Key and Event
Data, or Raise with Event Key, Event Data, and ParametersThe
process retries subscription processing for the event by reraising the
event with the specified level of information. Then the process ends.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 14

Practice 1 Overview
Practice 1 Overview
This practice covers handling an error in subscription
processing.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 15

Practice 1: Handling an Error in Subscription


Processing
Practice 1:
Handling an Error in Subscription
Processing
1. Define a subscription with the following properties:
System: <local system>
Source Type: Local
Event Filter: XX.oracle.workflow.bes.event.new
Rule Function: WF_RULE.Error
Parameters: WFSQL_ARGS
2. Raise the XX.oracle.workflow.bes.event.new event
to trigger your subscription.
3. Review the error notification and abort
subscription processing for the event.
Replace XX with your terminal number.

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
In this practice, you will define a subscription that uses the standard
WF_RULE.Error rule function to deliberately return an ERROR status code.
Oracle Workflow will send the errored event to the Default Event Error Process,
which will send a notification of the error. You can review the notification to
confirm that the subscription was executed and to respond to the error.
Note: Because many students access the system and create objects during this
course, you need a way to distinguish between the objects created by you and by
your classmates. Therefore, you will be assigned a terminal number by your
instructor. Use this number as a prefix wherever you see XX included in the
name of something you are defining. In this way, you can ensure that the
definitions you create are unique.
Step 1
1. Use a web browser to connect to the Oracle Workflow home page with the
URL provided by the instructor. Log in as any user with workflow
administrator privileges.
2. Choose the Event Subscriptions link.
3. In the Event Subscriptions page, choose the Add Subscription button to
open the Edit Subscription page.
4. In the System field, select the local system as the subscriber.
5. In the Source Type field, select Local.
Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 16

6. In the Event Filter field, select the XX.oracle.workflow.bes.event.new


event that you defined in the Defining an Event practice. If you have not
performed this practice, select an event provided by your instructor.
7. Leave the Source Agent field blank.
8. Enter 40 in the Phase field.
9. In the Status field, select Enabled.
10. In the Rule Data field, select Key.
11. Enter WF_RULE.Error in the Rule Function field. This rule function
returns the status code ERROR.
12. Leave the Workflow Item Type, Workflow Process Name, Out Agent, To
Agent, Owner Name, and Owner Tag fields blank. Leave the Priority field
set to the default value, which is Normal.
13. In the Parameters field, enter WFSQL_ARGS. This is the internal name of
the Workflow error message Invalid value(s) passed for arguments.
WF_RULE.Error will set this error message into the event message.
14. In the Description field, enter XX New Event Error Subscription.
15. Choose the Submit button to save the subscription.
Step 2
1. Navigate back to the Oracle Workflow home page.
2. Choose the Raise Event link.
3. In the Event Name field, select XX.oracle.workflow.bes.event.new, or
whichever event you defined as the event filter for your subscription.
4. In the Event Key field, enter a unique event key such as XX91.
5. For the purposes of this practice, since you will not perform further
processing on this event, you do not need to enter any event data. Leave
the Event Data field blank.
6. Choose the Submit button to raise the event.
7. Choose OK in the confirmation window.
Step 3
1. Navigate back to the Oracle Workflow home page.
2. Choose the Worklist link.
3. Choose the Local Event Error notification with your event name and event
key in the subject.
Note: The amount of time it takes for the notification to appear on the
Worklist depends in part on the listener scheduled for the WF_ERROR
agent.
4. Review the information in the notification. The notification should include
the error message specified in the subscription parameters.
5. In the response region, select Abort and choose Submit.
Optional Step
1. Repeat Step 2 to generate a new error. Use a unique event key.
Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 17

2. Review the new error notification.


3. Update your subscription definition by changing the rule function to
WF_RULE.Success.
4. Return to the error notification and select Raise Event with Event Key as
your response. This time, the subscription should complete successfully
without generating an error.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 18

Practice 1: Handling an Error in Subscription


Processing
Practice 1:
Handling an Error in Subscription
Processing

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you complete this practice, the subscription definition should look similar
to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 19

Practice 1: Handling an Error in Subscription


Processing
Practice 1:
Handling an Error in Subscription
Processing

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you raise your event for this practice, the raise event details should look
similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 20

Practice 1: Handling an Error in Subscription


Processing
Practice 1:
Handling an Error in Subscription
Processing

Copyright Oracle Corporation, 2001. All rights reserved.

Practice 1 Solution
When you review the error notification for this practice, the notification should
look similar to this.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 21

Summary
Summary
In this lesson, you should have learned how to:

Describe the status codes returned by


subscription rule functions.

Describe the WF_ERROR agent.


Explain the Default Event Error process.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Error Handling for Subscription Processing


Chapter 9 - Page 22

Setting Up the Business


Event System
Chapter 10

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 1

Setting Up the Business Event System

Setting Up the Business Event System

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Describe the global preferences for the Business


Event System.

Discuss how to run the Java Function Activity


Agent.

Describe setting up database links and queues for


the Business Event System.

Discuss setting up a queue handler for integration


with Oracle Message Broker.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 3

Business Event System Setup Steps


Business Event System Setup Steps
Step 1

Step 2

Step 3

Global User
Preferences

Java Function
Activity Agent

Database Links
and Queues

Step 4
OMB
Queue Handler

Background
Engines

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Setup Steps


In addition to the other setup steps for Oracle Workflow, perform the following
steps to set up the Business Event System.
1. Set the default Workflow preferences for your entire enterprise using the
Global Workflow Preferences web page.
2. Start the Java Function Activity Agent if you want to run external Java
function activities.
3. Set up database links and queues for the Business Event System.
4. Set up the WF_EVENT_OMB_QH queue handler if you want to use
Oracle Message Broker to propagate event messages between systems.
For more information, refer to the Setting Up Oracle Workflow chapter in the
Oracle Workflow Guide.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 4

Step 1 Setting Global User Preferences


Step 1
Setting Global User Preferences
Use the Global Workflow Preferences web page to
set:

Local SystemThe system where this installation


of Oracle Workflow is located

System Status
Enabled
Local Only
External Only
Disabled

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Global User Preferences


To access the Global Workflow Preferences web page, use a web browser to
connect to the Oracle Workflow home page at the following URL:
<webagent>/wfa_html.home
Replace <webagent> with the base URL of the web agent configured for Oracle
Workflow in your Web server.
Then choose the Global Workflow Preferences link.
Note: You must have workflow administrator privileges to access the Global
Workflow Preferences web page.
Set values for all appropriate global Workflow preferences, including
preferences related to the Business Event System.
Local System
When you install Oracle Workflow, the database where the installation is
located is automatically defined as a system in the Event Manger and set as the
local system in the Global Workflow Preferences page.
System Status
EnabledSubscriptions are executed on all events.
Local OnlySubscriptions are executed only on events raised on the local
system.
External OnlySubscriptions are executed only on events received from
external systems.
DisabledNo subscriptions are executed on any events.
Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 5

Oracle Workflow sets the system status to Local Only by default. After you
finish setting up the Business Event System, change the setting to the status you
want for event processing.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 6

Step 2 Starting the Java Function Activity Agent


Step 2
Starting the Java Function Activity Agent

Run the Java Function Activity Agent if you want


to execute external Java function activities.

To start the Java Function Activity Agent, you can:


Run JRE against
'oracle.apps.fnd.wf.WFFALsnr'
Edit and run sample scripts called wfjvlsnr.csh
for UNIX or wfjvlsnr.bat for Windows NT

Copyright Oracle Corporation, 2001. All rights reserved.

Starting the Java Function Activity Agent


You must have Java Runtime Environment (JRE) Version 1.1.8 or higher
installed to run the Java Function Activity Agent.
Starting the Java Function Activity Agent Manually
To start the Java Function Activity Agent manually, run JRE against
'oracle.apps.fnd.wf.WFFALsnr', specifying your CLASSPATH and the user
name and password of your Oracle Workflow database account. The
CLASSPATH must point to the Java Runtime Environment, the top-level
Workflow Java directory, the Oracle XML parser, the Oracle JDBC
implementation, and the following Workflow JAR files:
wfjava.jarThe Java Function Activity Agent
wfapi.jarWorkflow Java APIs
fndbalishare.jarUtilities referenced by the Workflow Java APIs
fndewt.jarUtilities referenced by the Workflow Java APIs
fndswing.jarOptional additional utilities
If you define your own external Java function activities, you must also include
the JAR files containing your custom Java classes in the CLASSPATH.
Starting the Java Function Activity Agent From a Script
Oracle Workflow also provides sample scripts called wfjvlsnr.csh and
wfjvlsnr.bat which you can modify to run the Java Function Activity Agent on
UNIX or on Windows NT, respectively. These scripts are located on your server
in the Oracle Workflow admin subdirectory. Before you can use these sample
Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 7

scripts, you must edit them to include the actual directory paths to your Oracle
Home and to the JRE rt.jar file. Also, if you define your own external Java
function activities, you must include the path to the JAR files containing your
custom Java classes. Then you can run the scripts with the user name and
password of your Oracle Workflow database account to submit the Java
Function Activity Agent.
Stopping the Java Function Activity Agent
Normally, the Java Function Activity Agent runs as a perpetual job. However,
you can stop the agent by running a script called wfjvstop.sql, located in the
admin/sql subdirectory on your Oracle Workflow server.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 8

Step 3 Setting Up Database Links and Queues


Step 3
Setting Up Database Links and Queues

If you want to communicate business events


between the local system and external systems,
create database links to those external systems.
If you want to use custom queues for propagating
events, set up your queues.
You can either create database links and set up
queues manually, or use Oracle DBA Studio in the
Oracle Enterprise Manager.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up Database Links and Queues


Database Links
When you set up database links for use by the Business Event System, you
should fully qualify each database link name with the domain name.
Queues
Oracle Workflow provides three standard queues that you can use for event
processing:
WF_IN
WF_OUT
WF_ERROR
You must not change the setup of these queues. However, you must schedule a
listener for WF_ERROR to enable error handling for the Business Event
System. Also, if you want to use WF_IN and WF_OUT for event message
propagation, schedule a listener for WF_IN and a propagation for WF_OUT as
well.
You can also set up your own queues for event message propagation. To set up
a queue, you must create the queue table, create the queue, and start the queue.
Oracle Workflow provides a sample script called wfevquec.sql which you can
modify to set up your queues, as well as a sample script called wfevqued.sql
which you can modify to drop queues. These scripts are located on your server
in the Oracle Workflow sql subdirectory for the standalone version of Oracle

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 9

Workflow, or in the sql subdirectory under $FND_TOP for the version of


Oracle Workflow embedded in Oracle Applications.
If you define a queue with a payload type other than the standard
WF_EVENT_T Workflow format, you must create a queue handler to translate
between WF_EVENT_T and the format required by the queue.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 10

Step 4 Setting Up the WF_EVENT_OMB_QH Queue


Handler

Step 4
Setting Up the WF_EVENT_OMB_QH
Queue Handler
If you want to use Oracle Message Broker (OMB)
to propagate event messages between systems,
set up the WF_EVENT_OMB_QH queue handler.
WF_EVENT_OMB_QH translates between the
standard Workflow event message structure,
WF_EVENT_T, and the structure required by OMB
queues, OMBAQ_TEXT_MSG.
You can assign WF_EVENT_OMB_QH to agents
that use propagation protocols you have
implemented through OMB.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the WF_EVENT_OMB_QH Queue Handler


1. Use OMB to create the AQ queues that you want to use for event message
propagation. The queues should be single consumer queues created in
your Oracle Workflow schema. You should create at least one inbound
and one outbound queue. For example, create queues
2. Run the script wfquhndos.pls to create the PL/SQL spec for the
WF_EVENT_OMB_QH package. This script is located in the wf/sql
subdirectory in your Oracle Home.
3. Run the script wfquhndob.pls to create the PL/SQL body for the
WF_EVENT_OMB_QH package. This script is located in the wf/sql
subdirectory in your Oracle Home.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 11

Review Questions
Review Questions
1. What does the System Status global preference
setting control?
2. What modifications do you need to make before
you can run the wfjvlsnr.csh and wfjvlsnr.bat
scripts?
3. What steps are required to set up a queue?
4. When should you set up the WF_EVENT_OMB_QH
queue handler?

Copyright Oracle Corporation, 2001. All rights reserved.

Review Questions and Solutions


1. What does the System Status global preference setting control?
The System Status global preference controls which events can trigger
subscriptions: all events, only local events, only external events, or no
events at all.
2. What modifications do you need to make before you can run the
wfjvlsnr.csh and wfjvlsnr.bat scripts?
You must edit the scripts to include the actual directory paths to your
Oracle Home and to the JRE rt.jar file.
3. What steps are required to set up a queue?
To set up a queue, you must create the queue table, create the queue,
and start the queue.
4. When should you set up the WF_EVENT_OMB_QH queue handler?
Set up WF_EVENT_OMB_QH if you want to use Oracle Message
Broker (OMB) to propagate event messages between systems.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 12

Summary
Summary
In this lesson, you should have learned how to:

Describe the global preferences for the Business


Event System.

Discuss how to run the Java Function Activity


Agent.

Describe setting up database links and queues for


the Business Event System.

Discuss setting up a queue handler for integration


with Oracle Message Broker.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 13

Copyright Oracle Corporation, 2001. All rights reserved.

Setting Up the Business Event System


Chapter 10 - Page 14

Business Event System


Summary
Chapter 11

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 1

Business Event System Summary

Business Event System Summary

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 2

Objectives
Objectives
After completing this lesson, you should be able to
do the following:

Describe the main components of the Business


Event System

Discuss how Oracle Workflow enables business


process based integration

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 3

Business Event System Components


Business Event System Components

Event Manager
Contains a registry of events, systems, agents,
and subscriptions
Executes subscriptions when events are
raised locally or received from external
sources

Workflow Engine event activities


Represent events within workflow
processes
Receive, raise, or send events

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 4

Subscription Processing
Subscription Processing
Subscriptions can include the following types of
processing:

Executing custom code on the event


Sending the event to a workflow process
Sending the event to other agents or systems

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 5

Event Communication
Event Communication

Events can be communicated among systems


both within and beyond the enterprise.

Communication among systems is accomplished


by sending an event message from one agent to
another.

The Business Event System leverages Oracle


Advanced Queuing to propagate messages by the
SQLNET protocol.

You can also implement an external service to


propagate messages by a different protocol.

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 6

Business Process Based Integration


Business Process Based Integration
Event based workflows:

Allow modeling of cross-system business


processes

Express policies for end-to-end processes


Control and route objects between applications
powerfully and flexibly

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 7

Review Question 1
Review Question 1
What does the Generate function for an event do?
A. Raises the event with the event key
B. Defines the event with the internal name
C. Generates the event key for the event
D. Generates the complete event data from the event
key
E. Generates the error message for the event

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 8

Answer to Review Question 1


Answer to Review Question 1
What does the Generate function for an event do?
A. Raises the event with the event key
B. Defines the event with the internal name
C. Generates the event key for the event
D. Generates the complete event data from the event
key
E. Generates the error message for the event

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 9

Review Question 2
Review Question 2
What is the name of the abstract datatype used to
store event messages?
A. EVENT_MESSAGE
B. WF_EVENT_MESSAGE
C. WF_EVENT_T
D. WF_EVENT_MESSAGE_T
E. EVENT_T

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 10

Answer to Review Question 2


Answer to Review Question 2
What is the name of the abstract datatype used to
store event messages?
A. EVENT_MESSAGE
B. WF_EVENT_MESSAGE
C. WF_EVENT_T
D. WF_EVENT_MESSAGE_T
E. EVENT_T

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 11

Review Question 3
Review Question 3
What does a queue handler do?
A. Translates between the standard Workflow format
and the format required by the queue
B. Propagates messages from one queue to another
C. Moves errored messages onto the error queue
D. Handles expired messages on the queue
E. Purges the queue

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 12

Answer to Review Question 3


Answer to Review Question 3
What does a queue handler do?
A. Translates between the standard Workflow format
and the format required by the queue
B. Propagates messages from one queue to another
C. Moves errored messages onto the error queue
D. Handles expired messages on the queue
E. Purges the queue

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 13

Review Question 4
Review Question 4
Which events have a source type of External?
A. Any events dequeued from the WF_ERROR agents
queue
B. Any events raised by applications other than
Oracle Workflow
C. Any events received from a remote system
D. Any events received from a system outside the
enterprise
E. Any events received by an inbound agent on the
local system, whether the sending agent is located
on a remote system or the local system

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 14

Answer to Review Question 4


Answer to Review Question 4
Which events have a source type of External?
A. Any events dequeued from the WF_ERROR agents
queue
B. Any events raised by applications other than Oracle
Workflow
C. Any events received from a remote system
D. Any events received from a system outside the
enterprise
E. Any events received by an inbound agent on the
local system, whether the sending agent is located
on a remote system or the local system

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 15

Review Question 5
Review Question 5
What does Oracle Workflow do if you do not specify a
rule function for a subscription?
A. Performs no processing for the event
B. Executes the default rule function
C. Raises the Unexpected event
D. Raises an exception
E. Places the event on the WF_ERROR queue

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 16

Answer to Review Question 5


Answer to Review Question 5
What does Oracle Workflow do if you do not specify a
rule function for a subscription?
A. Performs no processing for the event
B. Executes the default rule function
C. Raises the Unexpected event
D. Raises an exception
E. Places the event on the WF_ERROR queue

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 17

Review Question 6
Review Question 6
For which agents do you need to schedule listeners?
A. All local agents
B. All outbound agents
C. All inbound agents
D. Local outbound agents
E. Local inbound agents

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 18

Answer to Review Question 6


Answer to Review Question 6
For which agents do you need to schedule listeners?
A. All local agents
B. All outbound agents
C. All inbound agents
D. Local outbound agents
E. Local inbound agents

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 19

Review Question 7
Review Question 7
How do you specify that an event can be sent to a
Receive event activity to launch a new workflow
process?
A. Mark the Receive event activity as a Start activity
B. Place a standard Start activity after the Receive
event activity
C. Define the event details for the Receive event
activity node
D. Leave the event filter blank for the Receive event
activity
E. Define an item attribute to store the event message

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 20

Answer to Review Question 7


Answer to Review Question 7
How do you specify that an event can be sent to a
Receive event activity to launch a new workflow
process?
A. Mark the Receive event activity as a Start activity
B. Place a standard Start activity after the Receive event
activity
C. Define the event details for the Receive event activity
node
D. Leave the event filter blank for the Receive event
activity
E. Define an item attribute to store the event message

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 21

Review Question 8
Review Question 8
Which Oracle Workflow component executes external
Java programs?
A. Workflow Engine
B. Workflow Builder
C. Background Engine
D. Java Function Activity Agent
E. Event Manager

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 22

Answer to Review Question 8


Answer to Review Question 8
Which Oracle Workflow component executes external
Java programs?
A. Workflow Engine
B. Workflow Builder
C. Background Engine
D. Java Function Activity Agent
E. Event Manager

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 23

Review Question 9
Review Question 9
What does the predefined Error subscription to the
Any event do?
A. Returns the status code ERROR
B. Raises an exception to the calling application
C. Sends the event to the Default Event Error process
D. Places the event on the WF_ERROR queue
E. Sends the event back to the originating system

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 24

Answer to Review Question 9


Answer to Review Question 9
What does the predefined Error subscription to the
Any event do?
A. Returns the status code ERROR
B. Raises an exception to the calling application
C. Sends the event to the Default Event Error process
D. Places the event on the WF_ERROR queue
E. Sends the event back to the originating system

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 25

Review Question 10
Review Question 10
What is the default system status setting in the
Global Workflow Preferences page when you install
Oracle Workflow?
A. Enabled
B. Local Only
C. External Only
D. Disabled
E. Active

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 26

Answer to Review Question 10


Answer to Review Question 10
What is the default system status setting in the
Global Workflow Preferences page when you install
Oracle Workflow?
A. Enabled
B. Local Only
C. External Only
D. Disabled
E. Active

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 27

Summary
Summary
In this lesson, you should have learned how to:

Describe the main components of the Business


Event System

Discuss how Oracle Workflow enables business


process based integration

Copyright Oracle Corporation, 2001. All rights reserved.

Copyright Oracle Corporation, 2001. All rights reserved.

Business Event System Summary


Chapter 11 - Page 28