You are on page 1of 436

Oracle Workflow

Student Guide
14467GC10
Production 1.0
July 2000
M0-11868
Copyright Oracle Corporation, 2000. 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.
Authors
Paula Baldock
Robin Seiden
Technical Contributors and Reviewers
Siu Chang
Kevin Hudson
Clara Jaeckel
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
i
Table of Contents
Oracle Workflow Release 2.5 Introduction.........................................................................1-1
Oracle Workflow Release 2.5..............................................................................................1-2
Objectives ............................................................................................................................1-3
Agenda.................................................................................................................................1-4
Overview .............................................................................................................................1-5
Why Workflow?.....................................................................................................................2-1
Why Workflow? ..................................................................................................................2-2
Objectives ............................................................................................................................2-3
All Businesses Must Become E-Businesses .......................................................................2-4
Oracle Workflow.................................................................................................................2-5
Workflow Driven Business Processes .................................................................................2-6
Example Workflow Processes .............................................................................................2-7
Designing Business Processes for Change...........................................................................2-8
Workflow is Essential..........................................................................................................2-9
Expense Report Processing..................................................................................................2-10
Common Expense Reports Questions..................................................................................2-11
Expense Report Processing..................................................................................................2-13
Expense Report Processing @ Oracle .................................................................................2-14
New Hire Processing ...........................................................................................................2-15
New Hire Process @ Oracle ................................................................................................2-16
Workflow Enabled e-business Suite ....................................................................................2-20
Workflow.............................................................................................................................2-22
Overview of Oracle Workflow..............................................................................................3-1
Overview of Oracle Workflow............................................................................................3-2
Objectives ............................................................................................................................3-3
Overview .............................................................................................................................3-4
Workflow Architecture........................................................................................................3-5
Oracle Workflow Features and Definitions .........................................................................3-6
Oracle Workflow Builder ....................................................................................................3-7
Workflow Process Definition ..............................................................................................3-8
Supported Process Constructs..............................................................................................3-9
Workflow Engine.................................................................................................................3-11
Workflow Definitions Loader..............................................................................................3-12
Notification System.............................................................................................................3-13
Notification Worklist Web Page..........................................................................................3-14
Notification Details Web Page ............................................................................................3-15
Email Notifications..............................................................................................................3-16
Email Notifications - Response Template ...........................................................................3-17
Directory Services ...............................................................................................................3-18
Oracle Workflow Monitor ...................................................................................................3-19
Demonstration......................................................................................................................3-22
Planning a Workflow Process...............................................................................................4-1
Planning a Workflow Process..............................................................................................4-2
Objectives ............................................................................................................................4-3
Process Components............................................................................................................4-4
Oracle Workflow Builder ....................................................................................................4-5
Oracle Workflow Builder (continued) .................................................................................4-6
Planning a Workflow Process..............................................................................................4-7
Planning a Workflow Process (continued) ..........................................................................4-8
Activities and Lookup Types...............................................................................................4-9
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
ii
Creating a New Process from Bottom Up............................................................................4-11
Creating a New Process from Top Down ............................................................................4-12
Demonstration......................................................................................................................4-13
Defining Item Types, Item Attributes, and Lookup Types ................................................5-1
Defining Item Types, Item Attributes, and Lookup Types ..................................................5-2
Objectives ............................................................................................................................5-3
Create a New Workflow Process Definition........................................................................5-4
Top-Down Design ...............................................................................................................5-5
Quick Start Wizard ..............................................................................................................5-6
Quick Start Wizard (Continued) ..........................................................................................5-7
Define an Item Type ............................................................................................................5-9
Item Type Selector/Callback Function ................................................................................5-10
Define Item Type Attributes................................................................................................5-11
Define Item Type Attributes (continued).............................................................................5-12
Form Attributes....................................................................................................................5-14
Document Attributes............................................................................................................5-15
URL Attributes ....................................................................................................................5-16
Activities and Lookup Types...............................................................................................5-17
Define Lookup Types ..........................................................................................................5-18
Define Lookup Codes ..........................................................................................................5-19
Defining a Notification Activity............................................................................................6-1
Defining a Notification Activity..........................................................................................6-2
Objectives ............................................................................................................................6-3
Workflow Terms..................................................................................................................6-4
Create a New Workflow Process Definition........................................................................6-5
Define a Message.................................................................................................................6-6
Define a Message (Continued) ............................................................................................6-7
Define a Message Attribute .................................................................................................6-8
Define a Respond Attribute .................................................................................................6-9
Respond Attributes in an E-mail Notification......................................................................6-10
Respond Attributes in the Notifications Web Page .............................................................6-11
Define a Notification Activity .............................................................................................6-12
Standard PL/SQL API for Calling Functions ......................................................................6-13
Execution Modes .................................................................................................................6-14
Standard Voting Activity.....................................................................................................6-16
Define Notification Activity Details....................................................................................6-17
Define a Dynamic Priority for a Notification ......................................................................6-18
Practice Les 6-1 Overview...................................................................................................6-19
Practice Les 6-1 Overview Continued .................................................................................6-20
Guided Practice Les 6-1: Planning a Notification Only Process .........................................6-21
Guided Practice Les 6-1: Using the Quick Start Wizard .....................................................6-22
Guided Practice Les 6-1: Designing a Process Top Down ..................................................6-23
Guided Practice Les 6-1: Creating Supporting Item Attributes ...........................................6-24
Guided Practice Les 6-1: Creating Supporting Messages....................................................6-25
Guided Practice Les 6-1: Creating Supporting Messages Continued ..................................6-26
Guided Practice Les 6-1: Setting Selected Node Properties ................................................6-27
Guided Practice Les 6-1: Saving Your Process ...................................................................6-28
Les 6-1 Summary.................................................................................................................6-29
Overview of the Workflow Directory Service .....................................................................7-1
Overview of the Workflow Directory Service.....................................................................7-2
Objectives ............................................................................................................................7-3
Terms...................................................................................................................................7-4
Directory Service Views......................................................................................................7-5
WF_USERS View...............................................................................................................7-6
WF_USERS View (continued) ............................................................................................7-7
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
iii
WF_ROLES View...............................................................................................................7-8
WF_ROLES View (continued)............................................................................................7-9
WF_USER_ROLES View...................................................................................................7-10
WF_USER_ROLES View (continued)................................................................................7-11
Oracle Workflow Local Tables............................................................................................7-12
Implementing Global User Preferences ...............................................................................7-13
User Preference Information................................................................................................7-14
Ad Hoc Users/Roles ............................................................................................................7-15
Directory Service for Oracle Applications...........................................................................7-16
Directory Services for Oracle Workflow Standalone Version.............................................7-17
Defining Function and Process Activities ............................................................................8-1
Defining Function and Process Activities............................................................................8-2
Objectives ............................................................................................................................8-3
Create a New Workflow Process Definition........................................................................8-4
Define a Function Activity ..................................................................................................8-5
Assigning a Cost to a Function Activity..............................................................................8-7
Standard PL/SQL API for Calling Functions ......................................................................8-8
Execution Modes .................................................................................................................8-9
Notification Activities Revisited .........................................................................................8-10
Execution Modes .................................................................................................................8-13
Post-Notification Function...................................................................................................8-15
Exception Handling .............................................................................................................8-16
Exception Handling Example ..............................................................................................8-17
Defining a Function Activity Attribute................................................................................8-18
Defining a Process Activity.................................................................................................8-19
Defining Activity Details.....................................................................................................8-20
Looping................................................................................................................................8-21
Self-Looping Transitions .....................................................................................................8-23
Default Error Process...........................................................................................................8-24
Error Handling.....................................................................................................................8-25
Error Handling (Continued).................................................................................................8-26
Practice Les 8-1 Overview...................................................................................................8-27
Practice Les 8-1 Overview Continued .................................................................................8-28
Guided Practice Les 8-1 Creating a Vacation Schedule Table ............................................8-29
Guided Practice Les 8-1 Creating a PL/SQL Procedure......................................................8-30
Guided Practice Les 8-1 RUN processing ...........................................................................8-31
Guided Practice Les 8-1 CANCEL processing....................................................................8-32
Guided Practice Les 8-1 Adding a Function Activity..........................................................8-33
Guided Practice Les 8-1 Adding a Function Activity Continued ........................................8-34
Les 8-1 Summary.................................................................................................................8-35
Practice Les 8-2 Overview Optional....................................................................................8-36
Practice Les 8-2 Overview Continued .................................................................................8-37
Guided Practice Les 8-2 Creating a PL/SQL Procedure.....................................................8-39
Guided Practice Les 8-2 RESPOND processing..................................................................8-40
Guided Practice Les 8-2 RESPOND processing continued.................................................8-41
Guided Practice Les 8-2 FORWARD processing...............................................................8-43
Guided Practice Les 8-2 FORWARD, RUN, TIMEOUT processing.................................8-44
Guided Practice Les 8-2 Adding a Post-Notification Function............................................8-45
Les 8-2 Summary.................................................................................................................8-46
Diagramming a Workflow Process.......................................................................................9-1
Diagramming a Workflow Process......................................................................................9-2
Objectives ............................................................................................................................9-3
Create a New Workflow Process Definition........................................................................9-4
Loading Roles......................................................................................................................9-5
Diagramming a Process .......................................................................................................9-6
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
iv
Quick Start Wizard ..............................................................................................................9-7
Diagramming a Process (continued)....................................................................................9-8
Show Label in Designer Menu Option ................................................................................9-9
Display Modes.....................................................................................................................9-10
Diagramming a Process (continued)....................................................................................9-11
Self-Looping Transitions .....................................................................................................9-13
<Any> Transitions...............................................................................................................9-14
Top Down Design................................................................................................................9-15
Validation Performed by the Verify Command...................................................................9-17
Validation Performed by the Verify Command (continued)................................................9-18
Editing a Transition .............................................................................................................9-19
Editing a Transition (continued) ..........................................................................................9-20
Customizing a Process Node ...............................................................................................9-21
Setting Activity Attribute Values.........................................................................................9-22
Deleting Item Attributes ......................................................................................................9-23
Standard Activities...............................................................................................................9-24
Saving the Process Definition..............................................................................................9-25
Reviewing the Process Definition........................................................................................9-26
Version Compatibility..........................................................................................................9-27
Display Name Conflicts.......................................................................................................9-28
Practice Les 9-1 Overview...................................................................................................9-29
Practice Les 9-1 Overview Continued .................................................................................9-30
Guided Practice Les 9-1 Adding a Timeout.........................................................................9-32
Guided Practice Les 9-1 Adding a Self-Timeout Transition................................................9-33
Guided Practice Les 9-1 Adding a Loop Counter Function Activity...................................9-34
Guided Practice Les 9-1 Adding a Loop Counter Function Activity Continued .................9-35
Guided Practice Les 9-1 Adding a Timeout transition to Loop Counter ............................9-36
Guided Practice Les 9-1 Adding a Timeout transition to Loop Counter Continued...........9-37
Guided Practice Les 9-1 Assigning a Process Result and Error Process ............................9-38
Guided Practice Les 9-1 Labeling End nodes with Result...................................................9-39
Les 9-1 Summary.................................................................................................................9-40
Overview of the Workflow Engine .......................................................................................10-1
Overview of the Workflow Engine......................................................................................10-2
Objectives ............................................................................................................................10-3
Overview of the Workflow Engine......................................................................................10-4
Overview of the Workflow Engine (continued) ..................................................................10-5
Workflow Engine Features ..................................................................................................10-6
Initiating a Workflow Process .............................................................................................10-7
Workflow Engine Processing ..............................................................................................10-8
Activity Statuses ..................................................................................................................10-9
Calling the Workflow Engine ..............................................................................................10-10
Oracle Workflow APIs ........................................................................................................10-11
Oracle Workflow APIs (continued) .....................................................................................10-12
Workflow Engine APIs........................................................................................................10-13
Background Engine .............................................................................................................10-18
Deferred Processing.............................................................................................................10-20
Timed Out Notification Activities .......................................................................................10-21
Error Processing...................................................................................................................10-22
Completing Workflow Notification Activities .....................................................................11-1
Completing Workflow Notification Activities ....................................................................11-2
Objectives ............................................................................................................................11-3
Oracle Workflow Home Page..............................................................................................11-4
Find Notifications Web Page...............................................................................................11-5
Notifications Worklist .........................................................................................................11-6
Notification Details..............................................................................................................11-8
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
v
Reassigning Notifications....................................................................................................11-9
Launching Oracle Application Forms..................................................................................11-11
E-Mail Notification..............................................................................................................11-12
E-Mail Notification (continued) ..........................................................................................11-14
E-Mail Summary of Notifications .......................................................................................11-15
Automatic Notification Processing......................................................................................11-16
Listing Notification Processing Rules .................................................................................11-17
Creating a New Notification Processing Rule .....................................................................11-18
Creating a New Notification Processing Rule (continued) ..................................................11-19
Monitoring Workflow Processes ..........................................................................................12-1
Monitoring Workflow Processes .........................................................................................12-2
Objectives ............................................................................................................................12-3
Workflow Monitor...............................................................................................................12-4
Process Title ........................................................................................................................12-5
Process Diagram Window ...................................................................................................12-6
Detail Tab Window..............................................................................................................12-7
Administration Buttons........................................................................................................12-8
Application-Controlled Access to the Workflow Monitor...................................................12-9
Application-Controlled Access to the Workflow Monitor (Continued) ..............................12-10
Direct Access to the Workflow Monitor..............................................................................12-11
Find Processes Web Page ....................................................................................................12-12
Reviewing the Process List..................................................................................................12-13
Reviewing the Notifications List .........................................................................................12-14
Filtering Activities in the Activities List .............................................................................12-16
Filtering Activities in the Activities List (continued) ..........................................................12-17
Child/Parent Instances .........................................................................................................12-18
Practice Les 12-1 Overview.................................................................................................12-19
Practice Les 12-1 Overview Continued ...............................................................................12-20
Guided Practice Les 12-1 Initiating a Work Item................................................................12-21
Guided Practice Les 12-1: Monitoring the Results..............................................................12-22
Guided Practice Les 12-1 Timing out Vacation Proposal notification ................................12-23
Guided Practice Les 12-1 Testing Schedule Vacation Function..........................................12-24
Guided Practice Les 12-1 Testing Schedule Vacation Function Continued ........................12-25
Guided Practice Les 12-1 Testing Post-Notification Function ............................................12-26
Guided Practice Les 12-1 Testing Post-Notification Function Continued...........................12-27
Les 12-1 Summary...............................................................................................................12-28
PL/SQL Documents ...............................................................................................................13-1
PL/SQL Documents.............................................................................................................13-2
Objectives ............................................................................................................................13-3
Integrating PL/SQL Documents in Workflow Processes.....................................................13-4
Defining Procedures to Generate a PL/SQL Document ......................................................13-5
Defining Procedures to Generate a PL/SQL Document (continued) ...................................13-7
PL/SQL Document Attachments .........................................................................................13-8
Practice Les 13-1 Overview.................................................................................................13-9
Guided Practice Les 13-1 Creating a PL/SQL Document Procedure ..................................13-10
Guided Practice Les 13-1 Using a PL/SQL Document Attribute ........................................13-13
Guided Practice Les 13-1 Setting a Document Attribute Value ..........................................13-16
Guided Practice Les 13-1 Testing a PL/SQL Document (HTML) ......................................13-17
Les 13-1 Summary...............................................................................................................13-18
Practice Les 13-2 Overview.................................................................................................13-19
Guided Practice Les 13-2 Creating a PL/SQL Procedure with Result.................................13-20
Guided Practice Les 13-2 RUN processing .........................................................................13-21
Guided Practice Les 13-2 CANCEL processing..................................................................13-22
Guided Practice Les 13-2 Adding a Function Activity........................................................13-23
Guided Practice Les 13-2 Adding a Function Activity Continued ......................................13-24
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
vi
Les 13-2 Summary...............................................................................................................13-25
Selector Functions..................................................................................................................14-1
Selector Functions ...............................................................................................................14-2
Objectives ............................................................................................................................14-3
Item Type Selector Function................................................................................................14-4
Standard API for the Selector/Callback Function................................................................14-5
Standard API for the Selector/Callback Function (continued).............................................14-6
Defining a Selector/Callback Function................................................................................14-7
Defining a Selector/Callback Function (continued).............................................................14-8
Calling a Selector/Callback Function ..................................................................................14-9
Practice Les 14-1 Overview.................................................................................................14-10
Guided Practice Les 14-1 Duplicating a Process.................................................................14-11
Guided Practice Les 14-1 Assigning a Selector Function....................................................14-12
Guided Practice Les 14-1 Creating a Selector Procedure ...................................................14-13
Guided Practice Les 14-1 RUN processing .........................................................................14-14
Guided Practice Les 14-1 Testing a Selector Function........................................................14-15
Guided Practice Les 14-1: Monitoring the Results..............................................................14-16
Les 14-1 Summary...............................................................................................................14-17
External System Integration.................................................................................................15-1
External System Integration.................................................................................................15-2
Objectives ............................................................................................................................15-3
Oracle Workflow Terms ......................................................................................................15-4
External Function Activity Support .....................................................................................15-5
Advanced Queues Processing..............................................................................................15-6
Advanced Queue Integration ...............................................................................................15-7
Block Activity......................................................................................................................15-14
CompleteActivity.................................................................................................................15-15
Forced Synchronous Processing...........................................................................................16-1
Forced Synchronous Processing ..........................................................................................16-2
Objectives ............................................................................................................................16-3
Forced Synchronous Processes............................................................................................16-4
Process Definition Restrictions............................................................................................16-5
Process Definition Restrictions (continued) ........................................................................16-6
Purge.......................................................................................................................................17-1
Purge....................................................................................................................................17-2
Objectives ............................................................................................................................17-3
Purging Obsolete Workflow Data........................................................................................17-4
Purging Obsolete Workflow Data in Oracle Applications...................................................17-5
Purging Obsolete Workflow Data in Oracle Applications (continued) ...............................17-6
Demonstration......................................................................................................................17-7
Document Management Integration....................................................................................18-1
Document Management Integration ....................................................................................18-2
Objectives ............................................................................................................................18-3
Document Management Integration ....................................................................................18-4
Document Management .......................................................................................................18-5
Defining Document Management Repositories...................................................................18-6
Document Management Integration in Notifications...........................................................18-7
Accessing a DM Document Sent by a Notification .............................................................18-8
Responding to a Notification with a DM Document ...........................................................18-9
Setting Up Oracle Workflow ................................................................................................19-1
Setting Up Oracle Workflow...............................................................................................19-2
Objectives ............................................................................................................................19-3
Required Set Up Steps .........................................................................................................19-4
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
vii
Step 1 Setting Global User Preferences ...............................................................................19-5
Step 2 Setting Up an Oracle Workflow Directory Service ..................................................19-6
Step 3 Verifying the WF_LANGUAGES View..................................................................19-7
Step 4 Setting the http_proxy Environment Variable ..........................................................19-8
Step 5 Setting the WF_RESOURCES Environment Variable.............................................19-9
Step 6 Setting Up Background Workflow Engines..............................................................19-10
Optional Setup Steps............................................................................................................19-11
Optional Step 1 Document Management Repositories .......................................................19-12
Optional Step 2 Notification Mailer ....................................................................................19-13
Optional Step 2 Notification Mailer Overview....................................................................19-14
Optional Step 2 continued Notification Mailer...................................................................19-15
Optional Step 2 continued Running the Notification Mailer ..............................................19-16
Optional Step 2 continued Notification Mailer Arguments ................................................19-18
Optional Step 3 Message Templates....................................................................................19-20
Optional Step 3 continued Message Templates ...................................................................19-21
Optional Step 4 Workflow Web Page Logo ........................................................................19-22
Optional Step 5 Custom Icons .............................................................................................19-23
Oracle Workflow Access Protection....................................................................................19-24
Access Levels ......................................................................................................................19-25
Setting Access Level............................................................................................................19-26
Setting Access, Protection, and Customization Levels........................................................19-27
Example of Access Protection .............................................................................................19-28
Workflow Definitions Loader..............................................................................................19-29
Transferring Workflow Definitions: Oracle Workflow Standalone....................................19-30
Transferring Workflow Definitions: Oracle Workflow embedded in Oracle Applications 19-32
Master/Detail Coordination Activities .................................................................................20-1
Master/Detail Coordination Activities.................................................................................20-2
Objectives ............................................................................................................................20-3
Master/Detail Coordination Activities.................................................................................20-4
Master/Detail Coordination Activities (continued)..............................................................20-5
Example of Master Process..................................................................................................20-6
Example of Detail Process...................................................................................................20-7
Extra Practices.......................................................................................................................21-1
Extra Practices .....................................................................................................................21-2
Extra Practice 1 Overview...................................................................................................21-3
Extra Practice 2 Overview...................................................................................................21-4
Extra Practice 3 Overview...................................................................................................21-5
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
ix
Preface
Profile
Before You Begin This Course
Before you begin this course, you should have the following qualifications:
Thorough knowledge of Oracle8 and/or Oracle 8i and Oracle WebDB,
Oracle Web Application Server, and/or Oracle Application Server
technology; and, if you plan to use Oracle Workflow with Oracle
Applications, a thorough knowledge of Oracle Applications
Working experience with PL/SQL
Prerequisites
Introduction to Oracle: SQL and PL/SQL
Overview of Oracle Workflow
How This Course Is Organized
Oracle Workflow 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.
Oracle Workflow Table of Contents
x
Related Publications
Oracle Publications
Title Part Number
Oracle Workflow Guide Release 2.5 A75397
Additional Publications
System release bulletins
Installation and users guides
read.me files
Oracle Applications Users Group (OAUG) articles
Oracle Magazine
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
xi
Typographic Conventions
Typographic Conventions in Text
Convention Element Example
Bold italic Glossary term (if
there is a glossary)
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
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.
Quotation
marks
Interface elements
with long names
that have only
initial caps;
lesson and chapter
titles in cross-
references
Select Include a reusable module component
and click Finish.
This subject is covered in Unit II, Lesson 3,
Working with Objects.
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.
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
xii
Convention Element Example
Arrow Menu paths Select File> Save.
Brackets Key names Press [Enter].
Commas Key sequences Press and release keys one at a time:
[Alternate], [F], [D]
Plus signs Key combinations Press and hold these keys simultaneously:
[Ctrl]+[Alt]+[Del]
Typographic Conventions in Code
Convention Element Example
Caps and
lowercase
Oracle Forms
triggers
When-Validate-Item
Lowercase Column names,
table names
SELECT last_name
FROM s_emp;
Passwords DROP USER scott
IDENTIFIED BY tiger;
PL/SQL objects OG_ACTIVATE_LAYER
(OG_GET_LAYER
(prod_pie_layer))
Lowercase
italic
Syntax variables CREATE ROLE role
Uppercase SQL commands and
functions
SELECT userid
FROM emp;
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.
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
xiii
Notations :
(N) = Navigator
(M) = Menu
(T) = Tab
(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.
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Table of Contents
xiv
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Release 2.5 Introduction
Chapter 1 - Page 1
Oracle Workflow Release 2.5
Introduction
Chapter 1
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Release 2.5 Introduction
Chapter 1 - Page 2
Oracle Workflow Release 2.5
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5


Oracle Workflow Release 2.5
Introduction
Introduction
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Release 2.5 Introduction
Chapter 1 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this course, you should be able to:
Explain why you would use Workflow
Design a workflow process using Oracle Workflow
Builder
Define your Oracle Workflow users and roles
View and respond to notification activities
Monitor and administer the status of a workflow
process
Write custom PL/SQL procedures that can be
executed as automated functions in a workflow
process
Set up Oracle Workflow for your site
After this course, you should be able to:
Explain why you would use Workflow
Design a workflow process using Oracle Workflow
Builder
Define your Oracle Workflow users and roles
View and respond to notification activities
Monitor and administer the status of a workflow
process
Write custom PL/SQL procedures that can be
executed as automated functions in a workflow
process
Set up Oracle Workflow for your site
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Release 2.5 Introduction
Chapter 1 - Page 4
Agenda
Copyright Oracle Corporation, 2000. All rights reserved.

Agenda
Agenda
Overview of Oracle Workflow
Planning and Creating a Workflow Process
Defining Function and Process Activities
Diagramming a Workflow Process
Advanced Features
Overview of Oracle Workflow
Planning and Creating a Workflow Process
Defining Function and Process Activities
Diagramming a Workflow Process
Advanced Features
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Release 2.5 Introduction
Chapter 1 - Page 5
Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Overview
Overview
This course provides detailed information about
Oracle Workflow and its components so that you
can use its technology to workflow-enable any
application based on Oracle
This course provides detailed information about
Oracle Workflow and its components so that you
can use its technology to workflow-enable any
application based on Oracle
Copyright Oracle Corporation, 2000. All rights reserved.
Oracle Workflow Release 2.5 Introduction
Chapter 1 - Page 6
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 1
Why Workflow?
Chapter 2
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 2
Why Workflow?
Copyright Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Why Workflow?
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Explain why you would use Workflow
Explain and describe Workflow processes
After this lesson, you should be able to:
Explain why you would use Workflow
Explain and describe Workflow processes
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 4
All Businesses Must Become E-Businesses
Copyright Oracle Corporation, 2000. All rights reserved.

All Businesses
Must Become E-Businesses
All Businesses
Must Become E-Businesses
Streamlined business processes plays a critical role
with the transformation to e-business
The wiring for
e-business
Oracle Workflow
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 5
Oracle Workflow
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow
Oracle Workflow
Oracle Workflow automates and streamlines
business processes contained within and
between enterprises:
Add personalized trading partner rules
Validate self-service transactions
Achieve closed loop business intelligence
Approve standard business documents
Step through daily transaction flows

Oracle Workflow automates and streamlines
business processes contained within and
between enterprises:
Add personalized trading partner rules
Validate self-service transactions
Achieve closed loop business intelligence
Approve standard business documents
Step through daily transaction flows

The heart of e-business
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 6
Workflow Driven Business Processes
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Driven Business Processes


Workflow Driven Business Processes
Define and implement your business policies
Streamline the entire process
Capture exceptions and take action
Build continuous improvements directly into the
process definition
Adapt your processes as your business changes
Define and implement your business policies
Streamline the entire process
Capture exceptions and take action
Build continuous improvements directly into the
process definition
Adapt your processes as your business changes
Manage the process, not the transactions
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 7
Example Workflow Processes
Copyright Oracle Corporation, 2000. All rights reserved.

Example Workflow Processes


Example Workflow Processes
Unre s e rve
Clos e - Line Cre a te Supply -
Line
Sche dule - Line He a de r Le ve l
Invoice - Line ,
De fe rre d
Ente r - Line End Ship - Line ,
Ma nua l
Line Flow - Generic with Header Level Invoicing
End Hea der level
Invoice - Orde r
Book - Order,
Manual
Clos e - Order Enter
Order Flow - Generic with Header Level Invoicing
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 8
Designing Business Processes for Change
Copyright Oracle Corporation, 2000. All rights reserved.

Designing Business Processes for


Change
Business processes will change
No artificial constraints on the business
process
Enabling dynamic processes sympathetic to
change
Change business processes without changing
code (reduced cost of ownership)
Requires visual overview of business processes
You can only fix what you can see
Visual documentation of the business process
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 9
Workflow is Essential
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow is Essential
Workflow is Essential
Complete process representation
Crosses organizational, company boundaries
Build in management metrics, performance
goals
Adaptable workflow processes
Provides alternatives
Allow for refinement
Analyze time and costs of entire processes with
multidimensional analysis
Reducing costs and time
Complete process representation
Crosses organizational, company boundaries
Build in management metrics, performance
goals
Adaptable workflow processes
Provides alternatives
Allow for refinement
Analyze time and costs of entire processes with
multidimensional analysis
Reducing costs and time
Workflow enables continuous process improvement
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 10
Expense Report Processing
Copyright Oracle Corporation, 2000. All rights reserved.

Expense Report Processing


Expense Report Processing
Fast and efficient payment of expense
reports that conform to corporate
policy
Workflow enabled Self Service
Expense Reports
Goal:
Technique:
Accounts Payables professionals should spend
their time:
Entering expense reports
Responding to the telephone queries
regarding the status of an expense report
Defining and enforcing corporate policy,
saving the company money
Accounts Payables professionals should spend
their time:
Entering expense reports
Responding to the telephone queries
regarding the status of an expense report
Defining and enforcing corporate policy,
saving the company money
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 11
Common Expense Reports Questions
Copyright Oracle Corporation, 2000. All rights reserved.

Common Expense Reports Questions


Common Expense Reports Questions
Has my expense report been approved?
Which manager is holding up my expense report?
Has the Accounts Payable department verified my
receipts?
When will I get paid?
Why am I always short paid?
Has my expense report been approved?
Which manager is holding up my expense report?
Has the Accounts Payable department verified my
receipts?
When will I get paid?
Why am I always short paid?
Workflow empowers the process participants
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 12
Common Expense Reports Questions
Copyright Oracle Corporation, 2000. All rights reserved.

Common Expense Reports Questions


Common Expense Reports Questions
Has my expense report been approved?
Which manager is holding up my expense?
Has the Accounts Payable department verified my
receipts?
When will I get paid?
Why am I always short paid?
Has my expense report been approved?
Which manager is holding up my expense?
Has the Accounts Payable department verified my
receipts?
When will I get paid?
Why am I always short paid?
Workflow empowers the process participants
Lets take a look at the process
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 13
Expense Report Processing
Copyright Oracle Corporation, 2000. All rights reserved.

Expense Report Processing


Expense Report Processing
Approve d
ShortPa y
AP Approva l
Manage r Approval
Serve r Va lidation Approve
Reje ct
Re submit Re port Abort
AP Approval
Proces s
End (Approve)
End (Reje ct)
Start Determine
Which Proces s
To Start From
Manager
(Spending)
Approva l
Proces s
Reje ction
Proces s
Se rver Side
Valida tion
Proces s
Shortpa y
Unverified
Receipt Ite ms
AP Standard Expense Report Process
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 14
Expense Report Processing @ Oracle
Copyright Oracle Corporation, 2000. All rights reserved.

Expense Report Processing @ Oracle


Expense Report Processing @ Oracle
No
Yes
No
Yes
No
Ye s
No
Yes
AP Adjus tment
Ma de Due To
Spending Policy
NonComplia nce
Approved
(Automatic)
Mark Expense
Report As
Approve d
(Manua l)
End (ShortPay)
Start AP Expens e
Report Review
Complete
End (Approved)
Inform Preparer
That Expe ns e
Re port Has
Be en Adjus ted
Get Adjus tme nt
Te xt
Any J us tifica tion
Re quired for
Expense Report
Any Receipt
Require d For
Expense Report
Re ques t AP To
Re vie w For
complia nce With
Spending Policy
All Expens e
Lines Pas s AP
Approva l
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 15
New Hire Processing
Copyright Oracle Corporation, 2000. All rights reserved.

Hiring Managers should spend their time:


Determining whose approval is required
Chasing the HR department to mail offer
letters
Interviewing candidates, hiring the
best people
Hiring Managers should spend their time:
Determining whose approval is required
Chasing the HR department to mail offer
letters
Interviewing candidates, hiring the
best people
New Hire Processing
New Hire Processing
Empower managers in the hiring Empower managers in the hiring
process and hiring the best people process and hiring the best people
Workflow enable Self Service Hiring Workflow enable Self Service Hiring
Goal:
Technique:
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 16
New Hire Process @ Oracle
Copyright Oracle Corporation, 2000. All rights reserved.

New Hire Process @ Oracle


New Hire Process @ Oracle
Approved
Re jected
<Defa ult>
Accepted
Declined
Initialize Offer
Proce ss
Obta in Offe r
Approval
Proces s Offer
End (De clined)
End (Accepted)
End (De cline d)
End (De cline d)
Enabling e-business at Oracle
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 17
New Hire Process @ Oracle
Copyright Oracle Corporation, 2000. All rights reserved.

New Hire Process @ Oracle


New Hire Process @ Oracle
Enabling e-business at Oracle
Approved
Rejected
<Default>
Declined
Initialize Offer
Process
Obtain Offer
Approval
Process Offer
End (Declined)
End (Accepted)
End (Declined)
End (Declined)
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 18
New Hire Process @ Oracle
Copyright Oracle Corporation, 2000. All rights reserved.

New Hire Process @ Oracle


New Hire Process @ Oracle
Enabling e-business at Oracle
Approved
Rejected
<Default>
Declined
Initialize Offer
Process
Obtain Offer
Approval
Process Offer
End (Declined)
End (Accepted)
End (Declined)
End (Declined)
Notify Facilities
ofNew Hire
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 19
New Hire Process @ Oracle
Copyright Oracle Corporation, 2000. All rights reserved.

New Hire Process @ Oracle


New Hire Process @ Oracle
Enabling e-business at Oracle
Approved
Rejected
<Default>
Declined
Accepted
Initialize Offer
Process
Obtain Offer
Approval
Process Offer
End (Declined)
End (Accepted)
End (Declined)
End (Declined)
Notify Facilities
ofNewHire
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 20
Workflow Enabled e-business Suite
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow enabled
Workflow Enabled e-business Suite
Workflow Enabled e-business Suite
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 21
Workflow Enabled e-business Suite
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Enabled e-business Suite


Workflow Enabled e-business Suite
Self-Service
Professional
.
Workflow
Workflow enforces a common set of business rules
Copyright Oracle Corporation, 2000. All rights reserved.
Why Workflow?
Chapter 2 - Page 22
Workflow
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow
is much more
than approvals
Workflow
Workflow
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 1
Overview of Oracle Workflow
Chapter 3
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 2
Overview of Oracle Workflow
Copyright Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Overview of Oracle Workflow
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Understand the concept of a workflow process
Describe the architecture of Oracle Workflow
Describe Oracle Workflows features
After this lesson, you should be able to:
Understand the concept of a workflow process
Describe the architecture of Oracle Workflow
Describe Oracle Workflows features
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 4
Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Overview
Overview
Routes Information
Defines any rule
Delivers electronic notifications
Routes Information
Defines any rule
Delivers electronic notifications
Oracle Workflow accomplishes three important business requirements:
Routes Information
Routes information through Oracle Application.
These attachments include self-service Web page and Application forms.
Defines Any Rule
Oracle Workflow Builder lets you graphically define the business rules of
your process.
PL/SQL lets you express those rules as automated activities.
Delivers Electronic Notifications
Delivers electronic notifications to any Oracle Applications user.
Delivers electronic notifications to any e-mail or Internet user.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 5
Workflow Architecture
Copyright Oracle Corporation, 2000. All rights reserved.

Roles Users
Directory Services
Notification Services
Send
Respond
Forward
Cancel
Query
Oracle Workflow Enabled Application
Oracle Server
Engine
Execution
Definition
Administration
Monitoring
Query
Workflow
Builder
Workflow
Loader
Workflow
Definition
Files
Workflow
Development
Client
Oracle
Application
Server
or
WebDB
Notification
Mailer
Application
Server
Web
Notification
Worklist
Web
Process
Monitor
Web
Analysis
Tools
End-User
Client
Mail
Applications
Workflow Architecture
Workflow Architecture
Workflow Development Client
The development client is a PC running Windows95 or Windows NT. It is
a platform that will be used to create and modify the Oracle Workflow
definitions.
Oracle Server
The Oracle Server platform is the Oracle RDBMS. This hosts the business
application, integrated with Oracle Workflow.
Application Server
The Application Server is the environment outside of the RDBMS. This
includes ancillary services such as Oracle Web Application Server,
WebDB, and the Notification Mailer.
End-User Client
The End-User Client is the workstation or PC that the end user uses to
perform their daily tasks. This will include support for reviewing and
responding to notifications and using the Oracle Workflow Monitor.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 6
Oracle Workflow Features and Definitions
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Features and Definitions


Oracle Workflow Features and Definitions
Oracle Workflow Builder
Workflow Engine
Workflow Definitions Loader
Notification System
Notification Worklist
Directory Services
Workflow Monitor
Oracle Workflow Builder
Workflow Engine
Workflow Definitions Loader
Notification System
Notification Worklist
Directory Services
Workflow Monitor
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 7
Oracle Workflow Builder
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Builder


Oracle Workflow Builder
Development tool for Oracle Workflow
Used to graphically define and customize the
workflow definitions
Requires a PC running Windows 95, 98, 2000
or Windows NT
Workflow definitions: you can save them to a
database or a flat file
There are two parts to the Workflow Builder:
Object Navigator
Process Diagram
Development tool for Oracle Workflow
Used to graphically define and customize the
workflow definitions
Requires a PC running Windows 95, 98, 2000
or Windows NT
Workflow definitions: you can save them to a
database or a flat file
There are two parts to the Workflow Builder:
Object Navigator
Process Diagram
Workflow Builder
Saving the workflow definition on the local file system enables the
designer to back up their work and provides source control.
Object Navigator
The Navigator provides a tree structure with the highest level being the
data store. The lower levels are the workflow objects, for example,
messages, notifications, functions. All of these objects are organized into
their respective categories.
Process Diagram
The diagram is built by dragging the objects from the navigator and
dropping them onto the process diagram.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 8
Workflow Process Definition
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Process Definition


Workflow Process Definition
Oracle Workflow Process Definition
A workflow process definition must be saved to the same database as the
Workflow Engine.
A process definition is composed of activities and the transitions between
them.
A completed application transaction or event can initiate a workflow process
for an item by calling a series of Workflow Engine APIs.
The Workflow Engine locates the Start activity in the process definition.
The Workflow Engine drives the item through the process, performing all
automated steps until a notification or blocking activity occurs.
The Workflow Engine calls the Notification System to deliver the notification
message to an appropriate role.
Once a user of that role completes the notification response, the Workflow
Engine continues to drive the item through the remaining activities in the
process.
If a blocking activity is encountered, the Workflow Engine waits for an
external program to complete and call the appropriate Workflow
Engine API before it proceeds to the next activity.
The process completes when the Workflow Engine encounters an End
activity.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 9
Supported Process Constructs
Copyright Oracle Corporation, 2000. All rights reserved.

Supported Process Constructs


Supported Process Constructs
Looping Looping
Results-based Results-based
branching branching
Parallel flows Parallel flows
Rendezvous Rendezvous
Workflow Engine
The Workflow Engine supports sophisticated workflow rules including looping,
branching, parallel flows and subflows.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 10
Supported Process Constructs
Copyright Oracle Corporation, 2000. All rights reserved.

Supported Process Constructs


Supported Process Constructs
Voting Voting
Timeouts Timeouts
Escalation Escalation
Automatic Automatic
forwarding forwarding
Subprocesses Subprocesses
(unlimited (unlimited
hierarchy) hierarchy)
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 11
Workflow Engine
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Engine
Workflow Engine
Is embedded in the Oracle8i server
Uses the process definition created with Oracle
Workflow Builder to coordinate the routing of
activities for the process
Monitors the state of each activity in a workflow
process
Signals any changes in the workflow state to the
engine using calls to PL/SQL or Java APIs
Guarantees consistency between the application
and the workflow state because of Oracle8i
transactional integrity
Is embedded in the Oracle8i server
Uses the process definition created with Oracle
Workflow Builder to coordinate the routing of
activities for the process
Monitors the state of each activity in a workflow
process
Signals any changes in the workflow state to the
engine using calls to PL/SQL or Java APIs
Guarantees consistency between the application
and the workflow state because of Oracle8i
transactional integrity
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 12
Workflow Definitions Loader
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Definitions Loader


Workflow Definitions Loader
Workflow
Builder
Oracle 8 or higher
Workflow
Engine
Workflow
Loader
Proc
ess
Defin
itions
Workflow
Loader
Process
Definition
Loading Workflow Definitions
Workflow Definitions Loader is a utility program that lets you transfer process
definitions between a database and a flat file. The Workflow Definitions Loader:
Runs on the server machine
Lets you upgrade a database with new versions of process definitions or
upload existing process definitions after a database upgrade
Is also integrated into Oracle Workflow Builder
Allows process definitions to be source-controlled as flat files
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 13
Notification System
Copyright Oracle Corporation, 2000. All rights reserved.

Notification System
Notification System
e.g. UNIX Sendmail e.g. UNIX Sendmail
or MAPI compliant or MAPI compliant
Mail System Mail System
Application
Notification
Mailer
Oracle
Applications
Screens
Workflow
Worklist
Workflow
Engine
Notification
System
Directory
Services
Oracle 8 or higher
Notification System Features
Routes notifications to a role, which can be a single user or group of
users
Enables users to receive and respond to notifications using an e-mail
application or Web browser of choice
Allows users with access to the Internet to be included in a workflow
process
Access to Notification Worklist from Oracle Applications
Enables users to drill down to any URL or Oracle Applications screen to
respond to a notification from the Notification Worklist
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 14
Notification Worklist Web Page
Notification Worklist Web Page
Notification Worklist Web Page
Notification Worklist
The Notification Worklist is a facility that provides a list of the open
notifications to a particular user. The Worklist is viewable through the
Oracle Workflow Web Agent or through Oracle Applications. You can
also configure the Notification Mailer to send an e-mail summarizing the
outstanding notifications. From the Worklist the user can view the
notifications as well as respond to those that require a response.
Viewing Notifications from a Web Page
Requires Oracle WebDB 2.0 or higher, Oracle Web Application
Server 3.0.1 or higher, or Oracle Application Server 4.0.7 or higher
Requires a Web browser that supports Frames and JavaScript
Note: Notification System has an Oracle Web Agent interface that
dynamically generates the list of notifications for a user.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 15
Notification Details Web Page
Copyright Oracle Corporation, 2000. All rights reserved.

Notification Details Web Page


Notification Details Web Page
Extended HTML
message formats
Research and make a decision
through online inquiry
Viewing Notifications from a Web Page
Requires Oracle WebDB 2.0 or higher, Oracle Web Application
Server 3.0.1 or higher, or Oracle Application Server 4.0.7 or higher
Requires a Web browser that supports Frames and JavaScript
Note: Notification System has an Oracle Web Agent interface that
dynamically generates each notification for a user.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 16
Email Notifications
Email Notifications
Email Notifications
Automatic generation of
response template
E-Mail Notification Overview
The Notification System interfaces with the Notification Mailer
program to send e-mail notifications to users and roles.
There are three versions of the Notification Mailer program to
integrate with Oracle InterOffice Messaging Option, UNIX
Sendmail, or Windows NT MAPI-compliant mail applications.
E-mail notifications can be delivered to users on other mail
systems if the appropriate Oracle InterOffice or UNIX gateway
software is also installed.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 17
Email Notifications - Response Template
Copyright Oracle Corporation, 2000. All rights reserved.

Email Notifications - Response Template


Email Notifications - Response Template
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 18
Directory Services
Copyright Oracle Corporation, 2000. All rights reserved.

Directory Services
Directory Services
WF_USERS
Contains information on the user names,
display names for the users, their notification
preference and their e-mail addresses
WF_USER_ROLES
Contains information on the association of the
users to the roles
WF_ROLES
Contains information on the roles of which
users can be members
WF_USERS
Contains information on the user names,
display names for the users, their notification
preference and their e-mail addresses
WF_USER_ROLES
Contains information on the association of the
users to the roles
WF_ROLES
Contains information on the roles of which
users can be members
Directory Services
The directory service for Oracle Workflow is implemented as a set of
views that are mapped across the user tables of the underlying application.
The above slide lists the three views.
Users can be associated with more than one role and a role may contain
more than one user. The Engine and Notification System utilize the
Directory Services to determine who should receive Notifications and in
what format. Notifications can be delivered to an individual user or to all
members of a particular role.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 19
Oracle Workflow Monitor
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Monitor


Oracle Workflow Monitor
Workflow Monitor Notifications List
Displays all the current notifications that have been sent for a
process that require a response
Shows the decision makers in the process as well as the current
owner of any outstanding notifications
Note: The Find Processes Web page lets you search for the process
instance to display in the Workflow Monitor Notifications List.
Workflow Monitor Requirements
Requires Oracle WebDB 2.0 or above, or Oracle Web Application
Server 3.0.1 or above, or Oracle Application Server 4.0.7 or above
Requires a Web browser that supports Frames, JavaScript, Java
Development Kit (JDK) Version 1.1.4 and Abstract Windowing
Toolkit (AWT), such as Netscape Communicator 4.04 and above
or Internet Explorer 4.0 and above
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 20
Oracle Workflow Monitor
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Monitor


Workflow Monitor Diagram
The Workflow Monitor Diagram is a Java applet that displays status information
for a single workflow process instance.
Workflow Monitor Features
Graphically depicts the status of a workflow process instance in its upper
frame
Displays detailed information about individual activities, as well as about
the process as a whole in the lower tabbed frame
Runs in USER mode to display end-user information or ADMIN
mode to display administrator information and functionality
Note: The Find Processes web page lets you search for the process instance to
display in the Workflow Monitor.
Workflow Monitor Requirements
Requires Oracle WebDB 2.0 or above, or Oracle Web Application
Server 3.0.1 or above, or Oracle Application Server 4.0.7 or above
Requires a web browser that supports Frames, JavaScript, Java
Development Kit (JDK) Version 1.1.4 and Abstract Windowing Toolkit
(AWT), such as Netscape Communicator 4.04 and above or Internet
Explorer 4.0 and above
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 21
Oracle Workflow Monitor
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Monitor


Copyright Oracle Corporation, 2000. All rights reserved.
Overview of Oracle Workflow
Chapter 3 - Page 22
Demonstration
Copyright Oracle Corporation, 2000. All rights reserved.

Demonstration
Demonstration
Start a Workflow process
Follow a Workflow process through to completion
Make changes to a Workflow process
Start a Workflow process
Follow a Workflow process through to completion
Make changes to a Workflow process
Using Oracle Workflow we will demonstrate how to: Using Oracle Workflow we will demonstrate how to:
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 1
Planning a Workflow Process
Chapter 4
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 2
Planning a Workflow Process
Copyright Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Planning a Workflow Process
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Identify the components of a workflow process
Plan a workflow process
After this lesson, you should be able to:
Identify the components of a workflow process
Plan a workflow process
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 4
Process Components
Copyright Oracle Corporation, 2000. All rights reserved.

Process Components
Process Components
Item Type
Process
Functions Notifications Subprocesses
...
...
...
Lookup
Types,
Attributes
Messages,
Lookup
Types,
Attributes
Functions,
Notifications,
Lookup
Types
...
Oracle Workflow Process Components
Item Type: A grouping of workflow components. All components of a
workflow process must be associated with a specific item type.
Item Type Attribute: Attributes of the item type that can be globally
referenced by any activity in a process.
Process Activity: The working diagram of a business process. Includes
function, notification, and process activities (that represent subprocesses)
and the transitions between these activities.
Function Activity: Automated unit of work defined as a PL/SQL stored
procedure.
Notification Activity: Activity that sends a message to a performer.
Message: The message may request the performer, the role receiving the
message, to do some work or may simply provide information.
Lookup Type: List of values that can be referenced by any component.
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 5
Oracle Workflow Builder
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Builder


Oracle Workflow Builder
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 6
Oracle Workflow Builder (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Builder (continued)


Oracle Workflow Builder (continued)
Is used to create the components of the process
Consists of a navigator tree which lists all process
components
Groups all components into an Item Type
Each Item Type includes the following branches
Attributes
Processes (Subprocesses)
Notifications
Functions
Messages
Lookup Types
Is used to create the components of the process
Consists of a navigator tree which lists all process
components
Groups all components into an Item Type
Each Item Type includes the following branches
Attributes
Processes (Subprocesses)
Notifications
Functions
Messages
Lookup Types
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 7
Planning a Workflow Process
Copyright Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Planning a Workflow Process
1. Identify your business needs
2. Identify the activities that will accomplish those
needs. For example:
a. What is the activitys type: Function,
Notification, or Process?
b. Will an activitys result affect the transition that
the Workflow Engine takes? If so, define the
activitys possible results as lookup codes in a
lookup type
1. Identify your business needs
2. Identify the activities that will accomplish those
needs. For example:
a. What is the activitys type: Function,
Notification, or Process?
b. Will an activitys result affect the transition that
the Workflow Engine takes? If so, define the
activitys possible results as lookup codes in a
lookup type
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 8
Planning a Workflow Process (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process (continued)


Planning a Workflow Process (continued)
3. Identify how the process will be initiated. For
example:
a. What condition initiates the process? Is it a
completed transaction, a database exception,
a button on a form, or some other condition?
b. Will there be an interface to initiate the
process? For example, the Web Requisition
Approvals process in Oracle Web Employees
4. Identify the possible results of the process. Define
the possible results as lookup codes in a lookup
type
3. Identify how the process will be initiated. For
example:
a. What condition initiates the process? Is it a
completed transaction, a database exception,
a button on a form, or some other condition?
b. Will there be an interface to initiate the
process? For example, the Web Requisition
Approvals process in Oracle Web Employees
4. Identify the possible results of the process. Define
the possible results as lookup codes in a lookup
type
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 9
Activities and Lookup Types
Copyright Oracle Corporation, 2000. All rights reserved.

Activities and Lookup Types


Activities and Lookup Types
S
E
E
Result A
Result B
Process:
Function: PL/SQL code
returns Result Result F
Result T
Y
N
T
F
Notification: Message
FYI
Response
Required
Send Attributes
Send and
Respond Attributes
RESULT
Resp 1
Result Type =
Lookup Type
}
}
Result N
Result Y
}
Resp 2
...
Process Activities
A process activity can be completed with a specific result that is defined in
a lookup type. For example, the New Hire Process can be completed with
a final result of Accepted or Declined, both of which are codes defined in
the Applicant Response lookup type.
Function Activities
The PL/SQL procedure for a function activity can return some result that
determines the next transition the Workflow Engine takes. That result
should be defined as a code in a lookup type.
Notification Activities
The message sent by a notification activity can simply convey information
or it can require a response:
If the message only provides information (such as an FYI), then
create and include Send message attributes in the message as
necessary.
If the message requires a response, then create Send message
attributes that provide enough information for the recipient to
respond and also create Respond message attributes that prompt
a response.
If a particular response defines the actual result of the notification
activity, then complete the Result tab for the message. The
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 10
information you enter creates a special Respond message
attribute that has an internal name of RESULT. The RESULT
attribute has a datatype of lookup and must reference a lookup type
that defines the possible result codes and matches the result type
for the notification activity.
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 11
Creating a New Process from Bottom Up
Copyright Oracle Corporation, 2000. All rights reserved.

Creating a New Process from Bottom Up


Creating a New Process from Bottom Up
1. Define the item type of the process.
2. Define the item type attributes for the process.
3. Define lookup types and lookup codes.
4. Define messages.
5. Define message attributes.
6. Define the activities in the process as Function,
Notification, or Process.
7. Diagram the relationship of the activities.
1. Define the item type of the process.
2. Define the item type attributes for the process.
3. Define lookup types and lookup codes.
4. Define messages.
5. Define message attributes.
6. Define the activities in the process as Function,
Notification, or Process.
7. Diagram the relationship of the activities.
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 12
Creating a New Process from Top Down
Copyright Oracle Corporation, 2000. All rights reserved.

Creating a New Process from Top Down


Creating a New Process from Top Down
1. Use the QuickStart Wizard to create the process
framework.
2. Define activities without underlying dependencies.
3. Diagram the relationship of the activities.
4. Define item type attributes for the process.
5. Define lookup types and lookup codes.
6. Define messages.
7. Define message attributes.
8. Update processes, functions, and notifications
with underlying components.
1. Use the QuickStart Wizard to create the process
framework.
2. Define activities without underlying dependencies.
3. Diagram the relationship of the activities.
4. Define item type attributes for the process.
5. Define lookup types and lookup codes.
6. Define messages.
7. Define message attributes.
8. Update processes, functions, and notifications
with underlying components.
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 13
Demonstration
Copyright Oracle Corporation, 2000. All rights reserved.

Demonstration
Demonstration
Samples of Oracle Applications R11i workflow
processes
Samples of Oracle Applications R11i workflow
processes
In Oracle Workflow we will show : In Oracle Workflow we will show :
Copyright Oracle Corporation, 2000. All rights reserved.
Planning a Workflow Process
Chapter 4 - Page 14
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 1
Defining Item Types, Item
Attributes, and Lookup Types
Chapter 5
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 2
Defining Item Types, Item Attributes, and Lookup Types
Copyright Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and


Lookup Types
Defining Item Types, Item Attributes, and
Lookup Types
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Create an item type
Create an item type selector/callback function
Create item type attributes
Create lookup types
After this lesson, you should be able to:
Create an item type
Create an item type selector/callback function
Create item type attributes
Create lookup types
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 4
Create a New Workflow Process Definition
Copyright Oracle Corporation, 2000. All rights reserved.

Create a New Workflow Process


Definition
Create a New Workflow Process
Definition
To create a new workflow process: To create a new workflow process:
Define the item type of the process Define the item type of the process
Define item type attributes for the process Define item type attributes for the process
Define lookup types and lookup codes Define lookup types and lookup codes
Define messages Define messages
Define message attributes Define message attributes
Define the activities in the process as Function, Define the activities in the process as Function,
Notification, or Process Notification, or Process
Diagram the relationship of the activities Diagram the relationship of the activities
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 5
Top-Down Design
Copyright Oracle Corporation, 2000. All rights reserved.

Top-Down Design
Top-Down Design
Draw the process diagram first and then define the
underlying components.
Create new activities while drawing a process
diagram.
View activity and process activity property pages
from one dialogue.
Property page includes all tabs for base activity of
the node and the usage of the individual node.
Save a partially completed or errored process and
complete or correct later.
Draw the process diagram first and then define the
underlying components.
Create new activities while drawing a process
diagram.
View activity and process activity property pages
from one dialogue.
Property page includes all tabs for base activity of
the node and the usage of the individual node.
Save a partially completed or errored process and
complete or correct later.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 6
Quick Start Wizard
Copyright Oracle Corporation, 2000. All rights reserved.

Quick Start Wizard


Quick Start Wizard
The steps listed on the earlier slide were the required The steps listed on the earlier slide were the required
steps for previous versions of Oracle Workflow. steps for previous versions of Oracle Workflow.
While these steps are still valid for Release 2.5 they While these steps are still valid for Release 2.5 they
are no longer required. A new Workflow Builder menu are no longer required. A new Workflow Builder menu
option guides you through building a workflow option guides you through building a workflow
process. process.
Quick Start Wizard
The Quick Start Wizard is initiated from the Builder File menu option or
from the Builder Navigator Toolbar Quick Start Wizard icon. The Quick
Start Wizard prompts for the minimum information necessary to create a
new item type and process.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 7
Quick Start Wizard (Continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Quick Start Wizard (Continued)


Quick Start Wizard (Continued)
Quick Start Wizard Tool
Enter unique internal and display names for the item type and process.
The persistence type controls when the run-time process status
information is eligible for purge after the process is complete.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 8
Quick Start Wizard (Continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Quick Start Wizard (Continued)


Quick Start Wizard (Continued)
Quick Start Wizard Tool (continued)
The Quick Start Wizard creates a process and opens the process diagram.
The start and end nodes are automatically created. The workflow
developer uses the process diagram toolbar icons to create additional
activity nodes.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 9
Define an Item Type
Copyright Oracle Corporation, 2000. All rights reserved.

Define an Item Type


Define an Item Type
Item Type Properties Page
Item types are defined in the navigator tree within a data store or workspace.
Select a data store or workspace, then select New Item Type... from the Edit
menu to create a new item type.
1. Specify an internal name with a maximum of eight characters that has no
colons or spaces.
2. Specify a display name and description.
3. Specify the persistence type for this item type
4. Specify the name of the selector/callback function for this item type.
The Item Type selector/callback function is a PL/SQL
procedure that the Workflow Engine can call before
executing an activity.
An item type can have multiple workflow processes
associated with it. If it does, the selector/callback function
(a PL/SQL stored procedure) can identify the appropriate
process to run.
The selector/callback function can also reset or test context
information for an item type before performing an activity.
Associating a selector/callback function to an item type
makes the item type better suited to future customizations.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 10
Item Type Selector/Callback Function
Copyright Oracle Corporation, 2000. All rights reserved.

Item Type Selector/Callback Function


Item Type Selector/Callback Function
The Workflow Engine can call the selector/callback
function with one of three commands:
RUN: selects the appropriate process to start
SET_CTX: sets any item type context
information needed for a function activity,
prior to executing the function activity in a new
database session
TEST_CTX: determines whether a form can be
launched with the current item type context
information just before the Notification Detail
Web page launches a reference form
The Workflow Engine can call the selector/callback
function with one of three commands:
RUN: selects the appropriate process to start
SET_CTX: sets any item type context
information needed for a function activity,
prior to executing the function activity in a new
database session
TEST_CTX: determines whether a form can be
launched with the current item type context
information just before the Notification Detail
Web page launches a reference form
Note: Launching a form from the Notification Detail Web page is only
available when Workflow is embedded in Oracle Applications.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 11
Define Item Type Attributes
Copyright Oracle Corporation, 2000. All rights reserved.

Define Item Type Attributes


Define Item Type Attributes
What should be considered an item type attribute?
Information required by notification messages,
such as the display format of a currency value
Information required by function activities,
such as values that link back to applications
data like a person_ID
Information maintained by a workflow activity,
such as activities that identify who to forward
information to and from in a loop construct
What should be considered an item type attribute?
Information required by notification messages,
such as the display format of a currency value
Information required by function activities,
such as values that link back to applications
data like a person_ID
Information maintained by a workflow activity,
such as activities that identify who to forward
information to and from in a loop construct
Note: Do not use item type attributes as a denormalized data store.
Always refer back to the base application to retrieve up-to-date values.
There is a trade-off between the convenience of storing global process
data in item type attributes and the overhead incurred loading item type
attributes when a process instance is created. Minimize the number of
item type attributes to improve the performance of your workflow process.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 12
Define Item Type Attributes (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Define Item Type Attributes (continued)


Define Item Type Attributes (continued)
Attributes Properties Page
Item type attributes are defined in the navigator tree beneath a given item
type. Select the item type, then select New Attribute from the Edit menu to
create a new item type attribute.
Specify an internal name, display name, and description for the
attribute.
Specify the attributes type (and format/default value if
applicable):
Text: A string of text of specified character length
Number: A number with an optional format mask
Date: A date with an optional format mask
Lookup: A lookup code value from a specified lookup type
Role: A role name from the list of roles defined in the
directory service
Attribute: The name of another existing item type attribute
in a process that you need for maintaining references
URL: A Universal Resource Locator (URL) to a network
location that you want a user to be able to access from the
Notifications Web page
Form: The internal function name and any optional form
parameters of an Oracle Applications form that you want a
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 13
user to be able to access from the Notification Detail Web
page
Document: An attached document, as specified by the
document type (the name of the document management
system and a document reference)
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 14
Form Attributes
Copyright Oracle Corporation, 2000. All rights reserved.

Form Attributes
Form Attributes
Click on form icon to launch
Oracle Applications form
Form Type Attribute
The Notification Detail Web page supports form attributes. They appear in
a notification message as a form icon. When you open your notification
you can click on the attached form icon which drills down to the
referenced form.
Form Attribute Values
The value of a form parameter can be a text string enclosed in quotes ( )
or can be token substituted with another predefined item type attribute in
any of the following ways:
parameterN = &item_type_attribute
parameterN = Value &item_type_attribute, where
&item_type_attribute represents the rest of the value
Note: This attribute type is not relevant for the standalone version of
Oracle Workflow.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 15
Document Attributes
Copyright Oracle Corporation, 2000. All rights reserved.

Document Attributes
Document Attributes
PL/SQL document: a document representing data
from the database, generated from a PL/SQL
procedure.
Ideal for use when document content varies
For example, purchase orders with variable
number of lines or sales orders with variable
lines, discounts, and shipping addresses
DM document: a document managed by an
external document management system
PL/SQL document: a document representing data
from the database, generated from a PL/SQL
procedure.
Ideal for use when document content varies
For example, purchase orders with variable
number of lines or sales orders with variable
lines, discounts, and shipping addresses
DM document: a document managed by an
external document management system
You can specify the following types of documents in You can specify the following types of documents in
the default value field: the default value field:
Document Type Attributes
The Notification Detail Web page supports document attributes. They
appear in a notification message as an inline link or as an attachment icon.
When you open your notification you can click on a link or an attachment
icon to open the referenced document.
Document Attribute Values
The value of a document attribute can be a text string or can be token
substituted.
A PL/SQL document value is specified in the format:
PLSQL:<procedure>/<document identifier>
A DM document value is specified in the format:
DM:<document management node id>:<document identifier as
assigned by the DM system>
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 16
URL Attributes
Copyright Oracle Corporation, 2000. All rights reserved.

URL Attributes
URL Attributes
URL Message Attribute Target
If the item attribute type you create is URL, specify a Frame Target. When
you reference this item attribute as the default value of a message attribute
in a message, the URL frame opens according to what you specified as the
frame target. The options are:
New Window: The URL loads in a new, unnamed browser
window.
Same Frame: The URL loads in the same frame as the element that
references the URL attribute.
Parent Frameset: The URL loads into the immediate FRAMESET
parent of the current frame. This value is equivalent to Same
Frame, if the current frame has no parent.
Full Window: The URL loads into the full, original window, thus
canceling all other frames. This value is equivalent to Same Frame,
if the current frame has no parent.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 17
Activities and Lookup Types
Copyright Oracle Corporation, 2000. All rights reserved.

Activities and Lookup Types


Activities and Lookup Types
S
E
E
Result A
Result B
Process:
Function: PL/SQL code
returns Result Result F
Result T
Y
N
T
F
Notification: Message
FYI
Response
Required
Send Attributes
Send and
Respond Attributes
RESULT
Resp 1
Result Type =
Lookup Type
}
}
Result N
Result Y
}
Resp 2
...
Lookup Types
Lookup types can be referenced by activities, attributes, and messages in a
process to provide a predefined list of values.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 18
Define Lookup Types
Copyright Oracle Corporation, 2000. All rights reserved.

Define Lookup Types


Define Lookup Types
Lookup Types Property Page
Although lookup types must be associated with a given item type and are defined
in the navigator tree beneath Lookup Types branches of that item type, lookup
types can be referenced by components in other item types. Select the item type,
then select New Lookup Type from the Edit menu to create a new lookup type.
1. Enter an internal and display name for the lookup type.
2. Enter a description.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 19
Define Lookup Codes
Copyright Oracle Corporation, 2000. All rights reserved.

Define Lookup Codes


Define Lookup Codes
Lookup Codes Property Page
The lookup codes for a lookup type are defined in the navigator tree beneath that
branch of the lookup type. Select the lookup type, then select New Lookup Code
from the Edit menu to create a new lookup code.
1. Enter an internal and display name for the lookup code.
2. Enter a thorough description.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Item Types, Item Attributes, and Lookup Types
Chapter 5 - Page 20
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 1
Defining a Notification
Activity
Chapter 6
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 2
Defining a Notification Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Defining a Notification Activity
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Define a message
Define a message attribute
Define a notification activity
After this lesson, you should be able to:
Define a message
Define a message attribute
Define a notification activity
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 4
Workflow Terms
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Terms
Workflow Terms
Notification Activity
A task that requires human intervention. A
notification activity sends a message to a user
containing the information needed to complete
the work.
Notification Activity
A task that requires human intervention. A
notification activity sends a message to a user
containing the information needed to complete
the work.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 5
Create a New Workflow Process Definition
Copyright Oracle Corporation, 2000. All rights reserved.

Create a New Workflow Process


Definition
Create a New Workflow Process
Definition
To create a new workflow process: To create a new workflow process:
Define the item type of the process Define the item type of the process
Define item type attributes for the process Define item type attributes for the process
Define lookup types and lookup codes Define lookup types and lookup codes
Define messages Define messages
Define message attributes Define message attributes
Define the activities in the process as Function, Define the activities in the process as Function,
Notification, or Process Notification, or Process
Diagram the relationship of the activities Diagram the relationship of the activities
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 6
Define a Message
Copyright Oracle Corporation, 2000. All rights reserved.

Define a Message
Define a Message
Message Property Page
Messages must be associated with an item type and are created in the navigator
tree under the Messages branch of the item type. Select the item type, then
select New Message... from the Edit menu.
1. Enter an internal name, display name and description for the message.
2. Specify a priority for the message.
The priority entered here is specific to the message.
Recipients of this message can sort their notifications based on this priority.
Note: The 1 to 99 message priority scale of previous releases is now obsolete.
The notification priority values are: High, Normal and Low.
Body Property Page
Select the Body tab to display the Body property page.
1. Specify the message subject and body. The message body can be entered
using text or HTML formatting.
2. Optionally include message attributes in the subject or body.
Define a message attribute using the Message Attributes property page.
Specify the internal name of the message attribute and precede that internal
name with an & in the subject or body of the message.
Message attributes are token substituted with a runtime value when the
message is sent.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 7
Define a Message (Continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Define a Message (Continued)


Define a Message (Continued)
Message Result
Create a result for a message when you wish to send a message that
prompts for a response and then uses that response as the result of its
notification activity.
Select the Result tab of the Message Property page.
Enter a Display Name. This will be the response prompt.
Select a Lookup Type. This will provide the possible result values.
The lookup type associated with the message result should be the
same as the result type of the notification activity that sends the
notification message.
The icon for messages in the navigator tree includes a red question
mark in its bottom left corner when a message has a Result
defined.
Note: In version 2.0.3 of Oracle Workflow it was necessary to define a
message attribute which had an internal name of RESULT. This is
implemented through the message Result property tab in version 2.5.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 8
Define a Message Attribute
Copyright Oracle Corporation, 2000. All rights reserved.

Define a Message Attribute


Define a Message Attribute
Attribute Property Page
Message attributes must be associated with a message and are created in the
navigator tree beneath that message. Select a message, then select New
Attribute... from the Edit menu to create a new message attribute.
The Attributes property page for message attributes is identical to
the Attributes property page for Item type attributes but includes
one additional field, called source.
Set the value of Source to Send for any message attributes that
you include in the message subject and message body for token
substitution. These are called Send attributes.
Set the default value of Send attributes to reference a constant or
the runtime value of an item type attribute.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 9
Define a Respond Attribute
Copyright Oracle Corporation, 2000. All rights reserved.

Define a Respond Attribute


Define a Respond Attribute
Respond Attributes
If you wish to create a message that prompts a response from the recipient, then
define a message attribute that has Source set to Respond.
The Notification System uses a message's Respond attributes to
generate the response section of the notification.
A message can have multiple Respond attributes.
The icon for Respond attributes in the navigator tree includes a red
question mark in its bottom left corner to distinguish it from Send
attributes.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 10
Respond Attributes in an E-mail Notification
Copyright Oracle Corporation, 2000. All rights reserved.

Respond Attributes in an E-mail


Notification
Respond Attributes in an E-mail
Notification
Respond Attributes as Reflected in an E-mail Notification
The response section of an e-mail notification is generated by the following
boilerplate text and information drawn from the properties of the Respond
attribute:
Enter the <Display Name> on line <Sequence>.
<Description>. <Type Hint>
Display Name: Comes from the property page and specifies the response
value expected.
Sequence: The sequence order that this Respond attribute is listed in the
Navigator tree among all the Respond attributes of the message.
Description: Comes from the property page and provides optional information
on how to complete a response.
Type Hint: A standard hint that is provided based on the attributes type:
Type Type Hint
Lookup Value must be one of the following:
<list of lookup codes>
Date Value must be a date in the form <format>.
Number Value must be a number in the form <format>.
Text Value must be <format> bytes or less.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 11
Respond Attributes in the Notifications Web Page
Copyright Oracle Corporation, 2000. All rights reserved.

Respond Attributes in the Notifications


Web Page
Respond Attributes in the Notifications
Web Page
Respond Attributes as Reflected in a Notifications Web Page
The response section of a Web notification is generated by information
drawn from the properties of the Respond attribute:
The response prompt comes from the Display Name field of the
Property page and specifies the response value expected.
The response prompt also links to information about the properties
of that Respond attribute.
A single Respond attribute of type URL lets you replace the
notification response section and processing with that of another
Web page. Multiple URL Respond attributes lets you provide the
recipient with multiple links to other Web pages. However, this
behavior appears only if the notification is viewed from the
Notifications Web page.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 12
Define a Notification Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Define a Notification Activity


Define a Notification Activity
Notification Activities
Notification activities must be associated with an item type and are created in
the navigator tree beneath the Notifications branch of the item type. Select the
item type, then select New Notification... from the Edit menu.
Activity Property Page
The procedure for defining a notification activity is as follows:
1. Specify an internal name, display name, and description for the
notification activity.
2. Specify the lookup type that contains the possible results that the activity
can return.
3. Choose a descriptive icon for the notification activity.
4. Choose a message to send from the list of predefined messages.
5. If a message includes a Result, then the result type of the notification
activity must be the same as the lookup type that the message Result references.
6. If you want to send this notification to a multi-user role, ensuring each
user receives an individual copy of the notification, select the Expand Roles
check box.
7. You can optionally specify a PL/SQL stored procedure in the Function
field. The procedure is known as a post-notification function and can be used to
couple processing logic to the notification activity.
8. Always select the Expand Roles check box for FYI-type notifications.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 13
Standard PL/SQL API for Calling Functions
Copyright Oracle Corporation, 2000. All rights reserved.

Standard PL/SQL API for Calling


Functions
Standard PL/SQL API for Calling
Functions
All PL/SQL stored procedures called by
notification activities in an Oracle Workflow
process should follow the standard API format so
that the Workflow Engine can properly execute the
activity.
All PL/SQL stored procedures called by
notification activities in an Oracle Workflow
process should follow the standard API format so
that the Workflow Engine can properly execute the
activity.
Standard API
if (funcmode=RESPOND) then
<your RESPOND executable statements>
resultout:=COMPLETE;
return;
endif;
if (funcmode=FORWARD) then
<your FORWARD executable statements>
resultout:=COMPLETE;
return;
endif;
if (funcmode=TRANSFER) then
<your TRANSFER executable statements>
resultout:=COMPLETE;
return;
endif;
if (funcmode=TIMEOUT) then
<your TIMEOUT executable statements>
resultout:=COMPLETE;
return;
endif;
...
Note: the sections on this page are only needed for post-notification functions.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 14
Execution Modes
Copyright Oracle Corporation, 2000. All rights reserved.

Execution Modes
Execution Modes
Notification activity with a post-notification
function modes are:
RESPOND
FORWARD
TRANSFER
RUN
TIMEOUT
Notification activity with a post-notification
function modes are:
RESPOND
FORWARD
TRANSFER
RUN
TIMEOUT
Post-Notification Function Modes
RESPOND: The performer responded to the notification. The post-
notification function can interpret the result and perform post-
response processing. The function can reject the response with an
error.
FORWARD: The performer delegates the notification to another
user. The function can audit or reject the delegation request with an
error. This state corresponds to the Delegate Authority option in
the user interface.
TRANSFER: The performer transfers the notification to another
user. The function can audit or reject the transfer request with an
error.
RUN: Called after RESPOND, FORWARD, or TRANSFER
modes. The post-notification function in RUN mode can perform
additional processing associated with the notification event.
TIMEOUT: If a notification activity does not complete within a
certain period of time then Oracle Workflow marks that activity as
timed out and then cancels any notification associated with the
timed out activity. The Notification System sends a cancellation
message to the performer only if the cancelled notification was
expecting a response and the performer's notification preference is
to receive e-mail.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 15
Note: If the post-notification function in RESPOND, FORWARD or
TRANSFER mode returns ERROR:<errcode> as a result or raises an
exception, the Workflow Engine aborts the respond, forward, or transfer
operation.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 16
Standard Voting Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Standard Voting Activity


Standard Voting Activity
Vote Yes/No
Vote Yes/No is a notification activity associated with the Standard item type. This
activity can be customized. Use this activity to send a notification to all users in a
role and tally the Yes/No responses of the users. The tallied responses determine
the final result of the notification activity.
The activity sends a message called Default Voting Message
Yes/No that includes message Result. The message prompts the
recipient to reply with Yes or No.
The possible results of this notification activity are stored in the
lookup type called Yes/No.
Choose the Expand Roles to ensure that all users in the role
receive a copy of the notification.
When the activity receives responses, it executes a PL/SQL
procedure called WF_STANDARD.VOTEFORRESULTTYPE to
tally the Yes/No responses.
Vote Yes/No has three activity attributes associated with it:
Voting Option: Specifies when and how to tally the votes
Percent Yes: Specifies what percentage of Yes responses
are required for a Yes result
Percent No: Specifies what percentage of No responses are
required for a No result
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 17
Define Notification Activity Details
Copyright Oracle Corporation, 2000. All rights reserved.

Define Notification Activity Details


Define Notification Activity Details
Details Property Page
Select the Details tab to display the Details property page.
Optionally specify the internal name of the item type that owns the
error process and then specify the internal name of the error
process activity to execute.
You can model a workflow process that specifically
handles unexpected errors and associate that error-handling
process with an activity.
If the activity encounters an error, the Workflow Engine
executes that error process.
Note: Notification Timeout has been moved to the Notification Node
properties.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 18
Define a Dynamic Priority for a Notification
Copyright Oracle Corporation, 2000. All rights reserved.

Define a Dynamic Priority for a


Notification
Define a Dynamic Priority for a
Notification
Dynamic Priority for a Notification Activity
By default, the Notification System assigns a priority to a notification
based on the priority value set for the message associated with the
notification.
When you drag and drop a notification activity into a process diagram as a
node, you can set a new priority for that node that overrides the default
priority of the message it sends. At runtime, the message has the override
priority.
You can set the overriding priority as a constant or from an item attribute.
The item attribute must be of type number and the following ranges apply:
High : 0-33
Normal : 34-66
Low : 67-99
Note: Notification Priority is available on the Notification Node
properties.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 19
Practice Les 6-1 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 6-1 Overview


Practice Les 6-1 Overview
This practice covers the following topics:
Planning a Notification Only Process
Using the QuickStart Wizard
Designing a Process Top Down
Creating Item Attributes and Messages
Setting Node Properties
(message, performer, Start/End)
Saving a Process
This practice covers the following topics:
Planning a Notification Only Process
Using the QuickStart Wizard
Designing a Process Top Down
Creating Item Attributes and Messages
Setting Node Properties
(message, performer, Start/End)
Saving a Process
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 20
Practice Les 6-1 Overview Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 6-1 Overview Continued


Practice Les 6-1 Overview Continued
Create a process that:
Starts.
Sends a vacation proposal from an employee to
his manager prompting the manager to approve or
reject. Allows the manager to respond with
alternate vacation dates and comments.
If the proposal is approved, sends a notification to
the requestor reporting the vacation is approved.
If the proposal is rejected, gives the requestor the
option to resubmit another vacation proposal to
the same manager.
Ends.
Create a process that:
Starts.
Sends a vacation proposal from an employee to
his manager prompting the manager to approve or
reject. Allows the manager to respond with
alternate vacation dates and comments.
If the proposal is approved, sends a notification to
the requestor reporting the vacation is approved.
If the proposal is rejected, gives the requestor the
option to resubmit another vacation proposal to
the same manager.
Ends.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 21
Guided Practice Les 6-1: Planning a Notification Only
Process
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 6-1:


Planning a Notification Only Process
Guided Practice Les 6-1:
Planning a Notification Only Process
1. Start with a rough sketch of a process that:
a. sends a vacation proposal from an employee
to his manager and prompts him to approve or
reject
b. on manager approval, sends a notification to
the requestor reporting the vacation proposal
is rejected
c. on manager reject, gives the requestor the
option to resubmit another vacation proposal
to the same manager
d. has two end points reflecting the approve and
reject paths through the process
1. Start with a rough sketch of a process that:
a. sends a vacation proposal from an employee
to his manager and prompts him to approve or
reject
b. on manager approval, sends a notification to
the requestor reporting the vacation proposal
is rejected
c. on manager reject, gives the requestor the
option to resubmit another vacation proposal
to the same manager
d. has two end points reflecting the approve and
reject paths through the process
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 22
Guided Practice Les 6-1: Using the Quick Start Wizard
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 6-1:


Using the Quick Start Wizard
Guided Practice Les 6-1:
Using the Quick Start Wizard
2. Create a new Item Type with an internal name of
WFVACXX where XX is the unique number
assigned to your station. The display name
should also include XX to make it easy for you
to identify your Item Type. For example, the
internal name may be WFVAC02 and the display
name may be 02 Vacation Proposal.
Hint: Use menu option File -> Quick Start Wizard
2. Create a new Item Type with an internal name of
WFVACXX where XX is the unique number
assigned to your station. The display name
should also include XX to make it easy for you
to identify your Item Type. For example, the
internal name may be WFVAC02 and the display
name may be 02 Vacation Proposal.
Hint: Use menu option File -> Quick Start Wizard
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 23
Guided Practice Les 6-1: Designing a Process Top
Down
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 6-1:


Designing a Process Top Down
Guided Practice Les 6-1:
Designing a Process Top Down
3. In the Builder Navigator, use Edit -> Find to locate
the End function in the Standard item type. Drag
and drop this function into your process diagram
to create an additional End node.
In the Builder Process diagram, use the New
Notification tool bar icon to create notification
activity nodes. Draw transitions between nodes
according to your process sketch.
Hint: Make use of the Approval and Yes/No
lookup types provided in the Standard item
type.
3. In the Builder Navigator, use Edit -> Find to locate
the End function in the Standard item type. Drag
and drop this function into your process diagram
to create an additional End node.
In the Builder Process diagram, use the New
Notification tool bar icon to create notification
activity nodes. Draw transitions between nodes
according to your process sketch.
Hint: Make use of the Approval and Yes/No
lookup types provided in the Standard item
type.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 24
Guided Practice Les 6-1: Creating Supporting Item
Attributes
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 6-1:


Creating Supporting Item Attributes
Guided Practice Les 6-1:
Creating Supporting Item Attributes
4. In the Builder Navigator, create the item attributes
to support your process.
Hint: Create Role type item attributes for the
Vacation Requestor and Vacation Approver.
Create Date type item attributes for the
Vacation Start and End dates.
4. In the Builder Navigator, create the item attributes
to support your process.
Hint: Create Role type item attributes for the
Vacation Requestor and Vacation Approver.
Create Date type item attributes for the
Vacation Start and End dates.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 25
Guided Practice Les 6-1: Creating Supporting
Messages
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 6-1:


Creating Supporting Messages
Guided Practice Les 6-1:
Creating Supporting Messages
5. In the Builder Navigator, create the messages to
support your process.
a. Create a proposal message that includes the
name of the requestor and the start and end
dates of the proposed vacation. As well as the
Approve/Reject result, the message should
include respond attributes for comments and
allow the manager to suggest an alternate
vacation date window.
Hint: Drag and drop the appropriate item
attributes to the message to create
message attributes.
5. In the Builder Navigator, create the messages to
support your process.
a. Create a proposal message that includes the
name of the requestor and the start and end
dates of the proposed vacation. As well as the
Approve/Reject result, the message should
include respond attributes for comments and
allow the manager to suggest an alternate
vacation date window.
Hint: Drag and drop the appropriate item
attributes to the message to create
message attributes.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 26
Guided Practice Les 6-1: Creating Supporting
Messages Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 6-1:


Creating Supporting Messages Continued
Guided Practice Les 6-1:
Creating Supporting Messages Continued
b. Create a proposal rejected message that
allows the vacation requestor to resubmit the
vacation proposal to the same manager with
the original or modified date window.
Hint: Use the Yes/No lookup type provided
in the Standard item type.
Hint: Make from date and to date respond
message attributes.
c. Create a proposal accepted FYI message.
b. Create a proposal rejected message that
allows the vacation requestor to resubmit the
vacation proposal to the same manager with
the original or modified date window.
Hint: Use the Yes/No lookup type provided
in the Standard item type.
Hint: Make from date and to date respond
message attributes.
c. Create a proposal accepted FYI message.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 27
Guided Practice Les 6-1: Setting Selected Node
Properties
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 6-1:


Setting Selected Node Properties
Guided Practice Les 6-1:
Setting Selected Node Properties
6. In the Builder Process Diagram, set Properties to
complete your process.
a. Assign a Message to each Notification Node.
b. Set the Performer for each Notification Node
the Vacation Proposal recipient should be
the manager
the Proposal Rejected and Proposal
Approved recipients should be the vacation
requestor
c. Set the Start/End on each End Node.
6. In the Builder Process Diagram, set Properties to
complete your process.
a. Assign a Message to each Notification Node.
b. Set the Performer for each Notification Node
the Vacation Proposal recipient should be
the manager
the Proposal Rejected and Proposal
Approved recipients should be the vacation
requestor
c. Set the Start/End on each End Node.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 28
Guided Practice Les 6-1: Saving Your Process
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 6-1:


Saving Your Process
Guided Practice Les 6-1:
Saving Your Process
7. In the Builder Navigator,
a. Verify the definition using File -> Verify.
b. Save your new data store and Item Type to a
workflow definition file.
c. Save your Item Type and process definition to
a test database.
7. In the Builder Navigator,
a. Verify the definition using File -> Verify.
b. Save your new data store and Item Type to a
workflow definition file.
c. Save your Item Type and process definition to
a test database.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 29
Les 6-1 Summary
Copyright Oracle Corporation, 2000. All rights reserved.

Les 6-1 Summary


Les 6-1 Summary
In this practice, you should have learned how to:
plan a simple notification only approval process
use the Quick Start Wizard to create an Item Type
and Process
find, drag and drop activities into a process
design a process top down within the Process
Window
create item attributes and messages
set node properties
save a process to a workflow definition file and to
a database
In this practice, you should have learned how to:
plan a simple notification only approval process
use the Quick Start Wizard to create an Item Type
and Process
find, drag and drop activities into a process
design a process top down within the Process
Window
create item attributes and messages
set node properties
save a process to a workflow definition file and to
a database
Sample Solutions
Refer to workflow definition file wfvacxx_61.wft for a sample solution.
To Copy a Sample Item Type
1. Open the sample workflow definition file data store in the Workflow Builder
navigator.
2. Drag the item type, holding down your select mouse button, to the same data
store.
3. You will be prompted to enter a new internal name and display name for the
item type in the Item Type property page. This is because every item type must
have unique internal and display names. Change internal name WFVACXX and
display name XX Vacation Proposal, replacing XX with the unique number
assigned to your work station.
4. Create a new data store using navigator menu option File -> New , ctrl+N, or
the New Store icon from the navigator tool bar.
5. Drag and drop the Standard item type into your new data store. Drag and drop
your copied and renamed WFVACXX item type into your new data store.
6. Select File -> Save As from the navigator menu. Enter a descriptive file
name for your new data store.
7. Close data store wfvacxx_61.wft without saving your changes.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining a Notification Activity
Chapter 6 - Page 30
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 1
Overview of the Workflow
Directory Service
Chapter 7
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 2
Overview of the Workflow Directory Service
Copyright Oracle Corporation, 2000. All rights reserved.

Overview of the
Workflow Directory Service
Overview of the
Workflow Directory Service
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Explain how Oracle Workflow receives information
about a role
Map Oracle Workflow to your directory repository
After this lesson, you should be able to:
Explain how Oracle Workflow receives information
about a role
Map Oracle Workflow to your directory repository
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 4
Terms
Copyright Oracle Corporation, 2000. All rights reserved.

Terms
Terms
Role
Directory Repository
Role
Directory Repository
Workflow Definitions
Role: A grouping of one or more users who share a common responsibility
Directory Repository: A set of database tables that contain user information
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 5
Directory Service Views
Copyright Oracle Corporation, 2000. All rights reserved.

Directory Service Views


Directory Service Views
WF_USERS
WF_ROLES
WF_USER_ROLES
WF_USERS
WF_ROLES
WF_USER_ROLES
Oracle Workflow Directory Service
Oracle Workflow does not maintain its own repository of users and
roles.
The Oracle Workflow directory service consists of three views that
map to a designated data repository of users and roles information.
Each view contains the columns that Oracle Workflow needs to
reference to get information about a user or a role.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 6
WF_USERS View
Copyright Oracle Corporation, 2000. All rights reserved.

WF_USERS View
WF_USERS View
Name: Internal name of a user
Display Name: Display name of a user
Description: Description of a user
Notification Preference: A value of MAILTEXT,
MAILATTH, MAILHTML, QUERY or SUMMARY to
indicate how user prefers to receive notifications
Language: NLS_LANGUAGE initialization
parameter that specifies the default language-
dependent behavior
Territory: NLS_TERRITORY initialization parameter
that specifies the default language-dependent date
and numeric formatting used
Name: Internal name of a user
Display Name: Display name of a user
Description: Description of a user
Notification Preference: A value of MAILTEXT,
MAILATTH, MAILHTML, QUERY or SUMMARY to
indicate how user prefers to receive notifications
Language: NLS_LANGUAGE initialization
parameter that specifies the default language-
dependent behavior
Territory: NLS_TERRITORY initialization parameter
that specifies the default language-dependent date
and numeric formatting used
Columns in WF_USERS contain the following Columns in WF_USERS contain the following
information: information:
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 7
WF_USERS View (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

WF_USERS View (continued)


WF_USERS View (continued)
Email_Address: Valid email address for the user or
mail distribution list
Fax: A fax number for the user
Orig_System: Name identifying the base tables of
this view
Orig_System_ID: Primary key that identifies this
user in the base tables
Status: ACTIVE, EXTLEAVE, INACTIVE,
TMPLEAVE are the status choices
Expiration_date: Date at which the user is no
longer valid in the directory service
Email_Address: Valid email address for the user or
mail distribution list
Fax: A fax number for the user
Orig_System: Name identifying the base tables of
this view
Orig_System_ID: Primary key that identifies this
user in the base tables
Status: ACTIVE, EXTLEAVE, INACTIVE,
TMPLEAVE are the status choices
Expiration_date: Date at which the user is no
longer valid in the directory service
Note: The Oracle Workflow Directory Service APIs use the
ORIG_SYSTEM_ID stored in the views to allow indexed access back to
the directory service base tables.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 8
WF_ROLES View
Copyright Oracle Corporation, 2000. All rights reserved.

WF_ROLES View
WF_ROLES View
Name
Display Name
Description
Notification Preference
Language
Name
Display Name
Description
Notification Preference
Language
Workflow roles can be roles, positions or Workflow roles can be roles, positions or
responsibilities referenced in a directory repository. responsibilities referenced in a directory repository.
The columns in WF_ROLES are similar to those in The columns in WF_ROLES are similar to those in
WF_USERS view: WF_USERS view:
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 9
WF_ROLES View (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

WF_ROLES View (continued)


WF_ROLES View (continued)
Territory
Email_Address
Fax
Orig_System
Orig_System_ID
Expiration_date
Territory
Email_Address
Fax
Orig_System
Orig_System_ID
Expiration_date
Note:
Every user must also be defined as a role.
The Oracle Workflow Directory Service APIs use the
ORIG_SYSTEM_ID stored in the views to allow indexed access back to
the directory service base tables.
If the e-mail address is null for a given role, the Notification Mailer sends
an individual e-mail to each user within the role.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 10
WF_USER_ROLES View
Copyright Oracle Corporation, 2000. All rights reserved.

WF_USER_ROLES View
WF_USER_ROLES View
User_Name: Internal name of the user as listed in
WF_USERS view
User_Orig_System: Name assigned to the
directory repository that WF_USERS is based on
User_Orig_System_ID: Primary key that identifies
this user in the user directory repository
User_Name: Internal name of the user as listed in
WF_USERS view
User_Orig_System: Name assigned to the
directory repository that WF_USERS is based on
User_Orig_System_ID: Primary key that identifies
this user in the user directory repository
WF_USER_ROLES is an intersection of the users and WF_USER_ROLES is an intersection of the users and
roles in WF_USER and WF_ROLES. roles in WF_USER and WF_ROLES.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 11
WF_USER_ROLES View (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

WF_USER_ROLES View (continued)


WF_USER_ROLES View (continued)
Role_Name: Internal name of the user as listed in
WF_ROLES view
Role_Orig_System: Name assigned to the
directory repository that WF_ROLES is based on
Role_Orig_System_ID: Primary key that identifies
this role in the role directory repository
Role_Name: Internal name of the user as listed in
WF_ROLES view
Role_Orig_System: Name assigned to the
directory repository that WF_ROLES is based on
Role_Orig_System_ID: Primary key that identifies
this role in the role directory repository
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 12
Oracle Workflow Local Tables
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Local Tables


Oracle Workflow Local Tables
WF_LOCAL_USERS
WF_LOCAL_ROLES
WF_LOCAL_USER_ROLES
WF_LOCAL_USERS
WF_LOCAL_ROLES
WF_LOCAL_USER_ROLES
Local Directory Service Tables
Use Oracle Workflow Local tables to add information about users
and roles not included in your existing directory repository.
Oracle Workflow Local tables include the same columns as the
WF_USERS, WF_ROLES and WF_USER_ROLES views
respectively.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 13
Implementing Global User Preferences
Copyright Oracle Corporation, 2000. All rights reserved.

Implementing Global User Preferences


Implementing Global User Preferences
Interaction with Oracle Workflow
Access to the Global Preferences Web page
Override a default user preference
Interaction with Oracle Workflow
Access to the Global Preferences Web page
Override a default user preference
Setting Global User Preferences
Control interaction with Oracle Workflow by globally setting
default user preference values for the entire enterprise.
Only the workflow administrator has access to the Global
Preferences Web page.
An individual user can override a default user preference at any
time by changing the value of the user preference in the User
Preferences Web page.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 14
User Preference Information
Copyright Oracle Corporation, 2000. All rights reserved.

User Preference Information


User Preference Information
Overriding Global User Preferences
The values that you specify in the User Preferences Web page
override the default global values set by your workflow
administrator in the Global Preferences Web page.
Note:
The Language, Territory, and Notification preference settings in the
Global Preferences and User Preferences Web pages are valid only if your
directory service views map these columns to the Oracle Workflow
preference functions.
Please note the above is the screen in the standalone version of Oracle
Workflow not Workflow embedded in applications.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 15
Ad Hoc Users/Roles
Copyright Oracle Corporation, 2000. All rights reserved.

Ad Hoc Users/Roles
Ad Hoc Users/Roles
You can create and manage ad hoc users and
roles in a workflow process.
Use server PL/SQL APIs to dynamically create new
user and role definitions in the directory service.
The new APIs store the information in the
WF_LOCAL_* tables.
The WF_USERS and WF_ROLES views use the
EXPIRATION_DATE.
WF_LOCAL_USER_ROLES keeps track of the
originating system of the users and roles.
You can create and manage ad hoc users and
roles in a workflow process.
Use server PL/SQL APIs to dynamically create new
user and role definitions in the directory service.
The new APIs store the information in the
WF_LOCAL_* tables.
The WF_USERS and WF_ROLES views use the
EXPIRATION_DATE.
WF_LOCAL_USER_ROLES keeps track of the
originating system of the users and roles.
WF_DIRECTORY package APIs supporting ad hoc users/roles are:
CreateAdHocUser()
CreateAdHocRole()
AddUsersToAddHocRole()
GetRoleDisplayName()
SetAdHocUserStatus()
SetAdHocRoleStatus()
SetAdHocUserExpiration()
SetAdHocRoleExpiration()
SetAdHocUserAttr()
SetAdHocRoleAttr()
RemoveUsersFromAdHocRole()
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 16
Directory Service for Oracle Applications
Copyright Oracle Corporation, 2000. All rights reserved.

Directory Service for Oracle Applications


Directory Service for Oracle Applications
Oracle Workflow ships a unified directory service
for Oracle Applicationswfdirhrv.sql. The unified
directory service maps:
WF_USERS to Oracle HRMS employees,
Oracle Application/Oracle Self-Service
Application users, Oracle Receivables
customer contacts and WF_LOCAL_USERS.
WF_ROLES to users in WF_USERS, Oracle
HRMS positions, Oracle Federal HR group
boxes, Oracle Applications responsibilities,
Oracle Engineering approval lists, and
WF_LOCAL_ROLES.
Oracle Workflow ships a unified directory service
for Oracle Applicationswfdirhrv.sql. The unified
directory service maps:
WF_USERS to Oracle HRMS employees,
Oracle Application/Oracle Self-Service
Application users, Oracle Receivables
customer contacts and WF_LOCAL_USERS.
WF_ROLES to users in WF_USERS, Oracle
HRMS positions, Oracle Federal HR group
boxes, Oracle Applications responsibilities,
Oracle Engineering approval lists, and
WF_LOCAL_ROLES.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 17
Directory Services for Oracle Workflow Standalone
Version
Copyright Oracle Corporation, 2000. All rights reserved.

Directory Services for Oracle Workflow


Standalone Version
Directory Services for Oracle Workflow
Standalone Version
Two sample Directory Services scripts are located
in the Oracle Workflow sql subdirectory:
wfdirouv.sql maps workflow users and roles to
the native users and roles defined in the
Oracle RDBMS.
wfdircsv.sql maps workflow users and roles to
the users and roles stored in the Oracle
Workflow local tables.
Two sample Directory Services scripts are located
in the Oracle Workflow sql subdirectory:
wfdirouv.sql maps workflow users and roles to
the native users and roles defined in the
Oracle RDBMS.
wfdircsv.sql maps workflow users and roles to
the users and roles stored in the Oracle
Workflow local tables.
wfdirouv.sql
This script creates three views based on the following native Oracle tables:
DBA_USERS
DBA_ROLES
DBA_ROLE_PRIVS
wfdircsv.sql
This script creates three views based on the following tables:
WF_LOCAL_USERS
WF_LOCAL_ROLES
WF_LOCAL_USER_ROLES
Note: You can use WF_LOCAL_* tables to store users and roles not
included in your central data repository. When you create your directory
service views, you will need to select from the tables in your central
repository as well as from the WF_LOCAL tables to get the complete list
of users and roles.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Directory Service
Chapter 7 - Page 18
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 1
Defining Function and
Process Activities
Chapter 8
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 2
Defining Function and Process Activities
Copyright Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Defining Function and Process Activities
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Define a function activity
Define an activity attribute
Apply the Workflow Engine APIs to your function
activities
Define a process activity
After this lesson, you should be able to:
Define a function activity
Define an activity attribute
Apply the Workflow Engine APIs to your function
activities
Define a process activity
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 4
Create a New Workflow Process Definition
Copyright Oracle Corporation, 2000. All rights reserved.

Create a New Workflow Process


Definition
Create a New Workflow Process
Definition
To create a new workflow process: To create a new workflow process:
Define the item type of the process Define the item type of the process
Define item type attributes for the process Define item type attributes for the process
Define lookup types and lookup codes Define lookup types and lookup codes
Define messages Define messages
Define message attributes Define message attributes
Define the activities in the process as Function, Define the activities in the process as Function,
Notification, or Process Notification, or Process
Diagram the relationship of the activities Diagram the relationship of the activities
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 5
Define a Function Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Define a Function Activity


Define a Function Activity
Function Activities
Function activities must be associated with an item type and are created in
the navigator tree beneath the Functions branch of the item type. Select the
item type, then select New Function from the Edit menu.
Activity Property Page
Specify an internal name, display name, and description for the
function activity.
Choose a descriptive icon for the activity.
Specify a function type and function for the activity.
PL/SQL: Enter the name of the PL/SQL stored procedure
that you want the Workflow Engine to execute for this
function activity.
External: Enter the name of the external program you want
the Workflow Engine to enqueue in the Outbound queue.
The correlation value of that entry is set to the value you
specify in the Function field.
Specify the result type that contains the possible results that the
activity can return.
Specify a relative cost, in seconds, that represents how long the
procedure takes to run. If the cost exceeds the Workflow Engine
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 6
threshold, the activity will be deferred for later processing by a
background engine.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 7
Assigning a Cost to a Function Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Assigning a Cost to a Function Activity


Assigning a Cost to a Function Activity
Cost is entered in seconds and converted to
hundredths of a second when stored in the
database.
Assign a high cost to function activities that
require a large amount of processing to complete.
If the cost of an activity exceeds the threshold
cost of the Workflow Engine, the activity gets
deferred by the Workflow Engine.
A background engine set up to poll for deferred
activities can execute the deferred activity at a
later time.
Cost is entered in seconds and converted to
hundredths of a second when stored in the
database.
Assign a high cost to function activities that
require a large amount of processing to complete.
If the cost of an activity exceeds the threshold
cost of the Workflow Engine, the activity gets
deferred by the Workflow Engine.
A background engine set up to poll for deferred
activities can execute the deferred activity at a
later time.
Assigning a Cost to a Function Activity
Note: The Workflow Engine executes one activity at a time. If possible,
you should avoid placing costly activities along the critical path of a
process. Instead, place costly activities on parallel branches in a process,
where they can be deferred for a background engine to process later.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 8
Standard PL/SQL API for Calling Functions
Copyright Oracle Corporation, 2000. All rights reserved.

Standard PL/SQL API for Calling


Functions
Standard PL/SQL API for Calling
Functions
All PL/SQL stored procedures called by function
activities in an Oracle Workflow process should
follow the standard API format so that the
Workflow Engine can properly execute the activity.
All PL/SQL stored procedures called by function
activities in an Oracle Workflow process should
follow the standard API format so that the
Workflow Engine can properly execute the activity.
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
Standard API
procedure <procedure name> (
itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2) is
<local declarations>
begin
if (funcmode=RUN) then
<your Run executable statements>
resultout:=COMPLETE:<result>;
return;
endif;
if (funcmode=CANCEL) then
<your CANCEL executable statements>
resultout:=COMPLETE;
return;
endif;
...
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 9
Execution Modes
Copyright Oracle Corporation, 2000. All rights reserved.

Execution Modes
Execution Modes
Function activity modes:
RUN
Activities that are executed for the first time
Follows CANCEL mode on a loop reset
CANCEL
Activities revisited as part of a loop reset
Activities that are part of a process that has
been canceled by a call to
WF_ENGINE.AbortProcess
Activities that are part of the process
stream being undone by a call to
WF_ENGINE.HandleError
Function activity modes:
RUN
Activities that are executed for the first time
Follows CANCEL mode on a loop reset
CANCEL
Activities revisited as part of a loop reset
Activities that are part of a process that has
been canceled by a call to
WF_ENGINE.AbortProcess
Activities that are part of the process
stream being undone by a call to
WF_ENGINE.HandleError
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 10
Notification Activities Revisited
Copyright Oracle Corporation, 2000. All rights reserved.

Notification Activities Revisited


Notification Activities Revisited
All PL/SQL stored procedures referenced by
notification activities in an Oracle Workflow
process should follow the standard API format so
that the Workflow Engine can properly execute the
activity.
All PL/SQL stored procedures referenced by
notification activities in an Oracle Workflow
process should follow the standard API format so
that the Workflow Engine can properly execute the
activity.
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
Standard API (revisited)
procedure <procedure name> (
itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2) is
<local declarations>
begin
if (funcmode=RESPOND) then
<your RESPOND executable statements>
resultout:=COMPLETE;
return;
endif;
if (funcmode=FORWARD) then
<your FORWARD executable statements>
resultout:=COMPLETE;
return;
endif;
if (funcmode=TRANSFER) then
<your TRANSFER executable statements>
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 11
resultout:=COMPLETE;
return;
endif;
...
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 12
Notification Activities Revisited
Copyright Oracle Corporation, 2000. All rights reserved.

Notification Activities Revisited


Notification Activities Revisited
All PL/SQL stored procedures referenced by
notification activities in an Oracle Workflow
process should follow the standard API format so
that the Workflow Engine can properly execute the
activity.
All PL/SQL stored procedures referenced by
notification activities in an Oracle Workflow
process should follow the standard API format so
that the Workflow Engine can properly execute the
activity.
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
Standard API (revisited)
procedure <procedure name> (
itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2) is
<local declarations>
begin
...
if (funcmode=RUN) then
<your Run executable statements>
resultout:=COMPLETE:<result>;
return;
endif;
if (funcmode=TIMEOUT) then
<your TIMEOUT executable statements>
resultout:=COMPLETE;
return;
endif;
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 13
Execution Modes
Copyright Oracle Corporation, 2000. All rights reserved.

Execution Modes
Execution Modes
Notification activity with a post-notification
function modes are:
RESPOND
FORWARD
TRANSFER
RUN
TIMEOUT
Notification activity with a post-notification
function modes are:
RESPOND
FORWARD
TRANSFER
RUN
TIMEOUT
Post-Notification Function Modes
RESPOND: The performer responded to the notification. The post-
notification function can interpret the result and perform post-
response processing. The function can reject the response with an
error.
FORWARD: The performer delegates the notification to another
user. The function can audit or reject the delegation request with an
error. This state corresponds to the Delegate Authority option in
the user interface.
TRANSFER: The performer transfers the notification to another
user. The function can audit or reject the transfer request with an
error.
RUN: Called after RESPOND, FORWARD, or TRANSFER
modes. The post-notification function in RUN mode can perform
additional processing associated with the notification event.
TIMEOUT: If a notification activity does not complete within a
certain period of time then Oracle Workflow marks that activity as
timed out and then cancels any notification associated with the
timed out activity. The Notification System sends a cancellation
message to the performer only if the cancelled notification was
expecting a response and the performer's notification preference is
to receive e-mail.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 14
Note: If the post-notification function in RESPOND, FORWARD or
TRANSFER mode returns ERROR:<errcode> as a result or raises an
exception, the Workflow Engine aborts the respond, forward, or transfer
operation.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 15
Post-Notification Function
Copyright Oracle Corporation, 2000. All rights reserved.

Post-Notification Function
Post-Notification Function
Reference Global WF_ENGINE variables in PL/SQL
Global Context Information set:
WF_ENGINE.context_nid = notification_ID
WF_ENGINE.context_text = new recipient_role
available in TRANSFER or FORWARD mode
WF_ENGINE.context_text = responder
available in RESPOND mode
Reference Global WF_ENGINE variables in PL/SQL
Global Context Information set:
WF_ENGINE.context_nid = notification_ID
WF_ENGINE.context_text = new recipient_role
available in TRANSFER or FORWARD mode
WF_ENGINE.context_text = responder
available in RESPOND mode
Note: The value of responder varies depending on the notification
interface the recipient uses to respond. If the recipient responds using the
Notification Web page, responder is set to the role name of the responder.
If the recipient responds using e-mail, responder is set to
email:responder_email_address.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 16
Exception Handling
Copyright Oracle Corporation, 2000. All rights reserved.

Exception Handling
Exception Handling
Use WF_CORE APIs to raise and catch errors in
your PL/SQL procedures
Engine sets function activity status ERROR if:
PL/SQL procedure raises an unhandled
exception
PL/SQL procedure returns a result beginning
with ERROR:
Use WF_CORE APIs to raise and catch errors in
your PL/SQL procedures
Engine sets function activity status ERROR if:
PL/SQL procedure raises an unhandled
exception
PL/SQL procedure returns a result beginning
with ERROR:
Debugging Function Activities Debugging Function Activities
Activities that Error
The following columns from the table
WF_ITEM_ACTIVITY_STATUSES, viewable from the Workflow
Monitor are set to reflect the error:
ERROR_NAME
ERROR_MESSAGE
ERROR_STACK
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 17
Exception Handling Example
Copyright Oracle Corporation, 2000. All rights reserved.

Exception Handling Example


Exception Handling Example

exception
when others then
WF_CORE.CONTEXT (<package name>,
<procedure name>, <itemtype>, <itemkey>,
to_char(<actid>), <funcmode>;
raise;
end <procedure name>

exception
when others then
WF_CORE.CONTEXT (<package name>,
<procedure name>, <itemtype>, <itemkey>,
to_char(<actid>), <funcmode>;
raise;
end <procedure name>
Exception Handling
WF_CORE.CONTEXT adds an entry to the error stack to provide context
information that helps locate the source of an error.
Use the exception handler example construct in your PL/SQL procedures to
facilitate debugging workflow function activities.
If a call to procedure name failed with an unhandled exception, the
column ERROR_STACK in WF_ITEM_ACTIVITY_STATUSES would
record the call to procedure name and its arguments.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 18
Defining a Function Activity Attribute
Copyright Oracle Corporation, 2000. All rights reserved.

Defining a Function Activity Attribute


Defining a Function Activity Attribute
Function Activity Attributes
If the PL/SQL procedure or external program for a function
activity contains external parameters, you can redefine those
parameters as activity attributes.
You can change the value of an activity attribute at any time in
Oracle Workflow Builder.
Function activity attributes can only be associated with a function
activity and are created in the navigator tree beneath that function
activity. Select the function activity, then select New Attribute
from the Edit menu.
Attributes Property Page
Activity attributes are defined the same way that item type
attributes are defined.
Activity attributes apply only to the current activity and, unlike
item type attributes, are not global to a process.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 19
Defining a Process Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Defining a Process Activity


Defining a Process Activity
Process Activities
A process activity must be defined before a business process can be
diagrammed.
Process activities must be associated with an item type and are created in the
navigator tree beneath the Processes branch of the item type. Select the
item type, then select New Process... from the Edit menu.
Activity Property Page
1. Specify an internal name, display name, and description for the process
activity.
2. Choose a descriptive icon for your process.
3. Specify the result type that contains the possible results that the process
can return.
4. Select the Runnable check box if this is a top level workflow process that
can be initiated.
Clear the Runnable check box if this process activity can only be executed
as a subprocess called by another higher-level process.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 20
Defining Activity Details
Copyright Oracle Corporation, 2000. All rights reserved.

Defining Activity Details


Defining Activity Details
Details Property Page
Every activity has a Details property page. The activity details for process,
notification, and function activities are similar.
1. Specify the internal name of the item type that owns the error process that
will be executed if an error occurs in the current activity, whether or not that
activity is a process, function, or notification.
2. Specify the internal name of the error process.
3. Specify the value for On Revisit to determine how the Workflow Engine
handles this activity when it is transitioned to more than once.
Ignore: For OR-type operations where the rest of the branch is ignored.
Reset: Permits resetting status by recalling activities in CANCEL-mode.
Loop: Performs loop without any reset.
Note: You set the effective date when you save your changes using the Save As
option in the File menu. All your activity modifications share the same effective
date when you save. The version number of the activity is maintained by Oracle
Workflow.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 21
Looping
Copyright Oracle Corporation, 2000. All rights reserved.

Looping
Looping
Looping occurs when the completion of an activity
causes a transition to another activity that has
already been completed.
The first activity detected as a revisited activity is
also called a loop point or pivot activity.
The Workflow Engine can handle a revisited
activity in one of three ways:
Ignore
Reset
Re-execute
Looping occurs when the completion of an activity
causes a transition to another activity that has
already been completed.
The first activity detected as a revisited activity is
also called a loop point or pivot activity.
The Workflow Engine can handle a revisited
activity in one of three ways:
Ignore
Reset
Re-execute
Handling a Revisited Activity
Ignore the activity and stop further processing of the thread, so in
effect, the activity can only run once.
Reset the loop to the loop point before re-executing by first
running logic to undo the activities within the loop.
Re-execute the loop point and all activities within the loop without
running any compensatory logic.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 22
Looping
Copyright Oracle Corporation, 2000. All rights reserved.

Looping
Looping
Non-canceling Loop can improve performance by
preventing the rerun of functions in CANCEL
mode.
Non-canceling Loop can improve performance by
preventing the rerun of functions in CANCEL
mode.
Ignore: is for OR-type
operations where rest of
branch is ignored.
Reset: permits resetting
status by recalling
activities
in CANCEL-mode.
Loop: performs loop
without any reset.
Non-Canceling Loop
Looping occurs when the completion of an activity causes a transition to
another activity that has already been completed. The first activity that is
detected as a revisited activity is called a loop point or pivot activity.
Every activity has an On Revisit pop-up list field in its Oracle Workflow
Builder Details property page. The On Revisit pop-up list lets you specify
the behavior of the Workflow Engine when it revisits the activity in a
workflow process. It is an important flag to set for the pivot activity of a
loop. You can set the field to Ignore, Reset, or Loop. Setting On Revisit
to Loop for an activity is useful when you want to simply re-execute
activities in a loop without resetting the status of the activities in the loop.
Loop causes the Workflow Engine to re-execute the activity in RUN mode
without executing any CANCEL mode logic for the activity.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 23
Self-Looping Transitions
Copyright Oracle Corporation, 2000. All rights reserved.

Self-Looping Transitions
Self-Looping Transitions
<Timeout>
Approve
Reject
Approve
Reject
<Timeout>
End (Approve)
End (Re je ct)
Notify
Requis ition
Approval
Re quire d
Reminder-Approval
Nee ded
Or
Or
Start
Activity loops
back to
itself
on Timeout
Self-Looping Transitions
You can draw a transition that loops back to its source activity without
creating additional activity nodes.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 24
Default Error Process
Copyright Oracle Corporation, 2000. All rights reserved.

Default Error Process


Default Error Process
The System:Error Item Type contains the following The System:Error Item Type contains the following
components: components:
Two process activities called Default Error
Process and Retry-only
Four function activities called Abort, Error Still
Active, Initialize Error, and Retry
Two Notification activities called Notify
Administrator and NTF with RETRY only
Two process activities called Default Error
Process and Retry-only
Four function activities called Abort, Error Still
Active, Initialize Error, and Retry
Two Notification activities called Notify
Administrator and NTF with RETRY only
Default Error Process
You can use the default error process or retry-only process as needed to
handle unexpected errors that occur in a process.
Avoid relying on an error process to handle exceptions in the
PL/SQL procedure of a function activity. Instead, try to model
your process to handle any known errors that could occur.
The Notify Administrator and NTF with RETRY only notifications
return:
Item Type
Item Key
User Key
Error Name
Error Message
Error Stack
Activity ID
Activity Label
Result Code
Notification ID
Assigned User
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 25
Error Handling
Copyright Oracle Corporation, 2000. All rights reserved.

Error Handling
Error Handling
Notify System Administrator or a user of your
choice if an unexpected error occurs
Option to retry, abort or ignore from the
notification
Link to directly access administrator toolkit on the
monitor for more complex processing
Automatically terminates when error is no longer
active
Notify System Administrator or a user of your
choice if an unexpected error occurs
Option to retry, abort or ignore from the
notification
Link to directly access administrator toolkit on the
monitor for more complex processing
Automatically terminates when error is no longer
active
Error Item Type Support
You can add custom error processes to the System: Error item type or to
any other item type. However, you cannot edit the two predefined System:
Error error processes.
In addition, the default error process in the WFERROR item type includes
additional information in the notification that it sends to the workflow
administrator:
Monitor URL: Enables the administrator to navigate to the error
process.
A request to either retry or abort the process
Use the WF_ADMINISTRATOR item attribute in your item type to
specify to which role to send the error notification; the default is the
System Administrator role.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 26
Error Handling (Continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Error Handling (Continued)


Error Handling (Continued)
Abort
<Timeout>
Re try
Re s olve d
Fa ls e
True
True
Fa ls e
False
True
Re try Initia lize Error Notify
Adminis trator
Sta rt End
End Abort
End
Error Still Active End
Error Still Active
End
Error Still Active
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 27
Practice Les 8-1 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 8-1 Overview


Practice Les 8-1 Overview
This practice covers the following topics:
Creating a PL/SQL procedure for a function
activity
Creating a Function Activity
Note: You will have an opportunity to test these
changes in a later Practice. The primary goal in
this practice is to get a clean compilation of
your PL/SQL procedure.
This practice covers the following topics:
Creating a PL/SQL procedure for a function
activity
Creating a Function Activity
Note: You will have an opportunity to test these
changes in a later Practice. The primary goal in
this practice is to get a clean compilation of
your PL/SQL procedure.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 28
Practice Les 8-1 Overview Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 8-1 Overview Continued


Practice Les 8-1 Overview Continued
Create an Employee Vacation Schedule Update
PL/SQL procedure that includes the following
logic to record an approved vacation proposal:
if the function activity is called by the workflow
engine in RUN mode, insert the requestor,
approver, and vacation dates into a vacation
schedule table (of your own design)
if the function activity is called in CANCEL
mode, delete the appropriate requestor,
approver, and vacation date row from the
vacation schedule table
Create a function activity to execute the Employee
Vacation Schedule Update PL/SQL procedure
Create an Employee Vacation Schedule Update
PL/SQL procedure that includes the following
logic to record an approved vacation proposal:
if the function activity is called by the workflow
engine in RUN mode, insert the requestor,
approver, and vacation dates into a vacation
schedule table (of your own design)
if the function activity is called in CANCEL
mode, delete the appropriate requestor,
approver, and vacation date row from the
vacation schedule table
Create a function activity to execute the Employee
Vacation Schedule Update PL/SQL procedure
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 29
Guided Practice Les 8-1 Creating a Vacation Schedule
Table
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-1


Creating a Vacation Schedule Table
Guided Practice Les 8-1
Creating a Vacation Schedule Table
1. Create a Vacation Schedule Table named
WFVACXX_VACATION_SCHEDULE where XX is
the unique number assigned to your station, with
the following columns:
requestor varchar2(30)
approver varchar2(30)
from_date date
to_date date
1. Create a Vacation Schedule Table named
WFVACXX_VACATION_SCHEDULE where XX is
the unique number assigned to your station, with
the following columns:
requestor varchar2(30)
approver varchar2(30)
from_date date
to_date date
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 30
Guided Practice Les 8-1 Creating a PL/SQL Procedure
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-1


Creating a PL/SQL Procedure
Guided Practice Les 8-1
Creating a PL/SQL Procedure
2. Use the standard API format for your PL/SQL
specification and body.
2. Use the standard API format for your PL/SQL
specification and body.
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
a. Name your package WFVACXX where XX is
the unique number assigned to your station.
b. Give your procedure a descriptive name such
as SCHEDULE_ UPDATE.
a. Name your package WFVACXX where XX is
the unique number assigned to your station.
b. Give your procedure a descriptive name such
as SCHEDULE_ UPDATE.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 31
Guided Practice Les 8-1 RUN processing
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-1


RUN processing
Guided Practice Les 8-1
RUN processing
3. In your PL/SQL procedure include logic for RUN
funcmode:
a. retrieve the values for requestor, approver,
vacation from date, and vacation to date using
API calls to wf_engine.GetItemAttrText and
wf_engine.GetItemAttrDate
b. insert a row into your Vacation Schedule table
using the appropriate item attribute values
c. set resultout to
wf_engine.eng_completed||:||wf_engine.eng_
null
d. return
3. In your PL/SQL procedure include logic for RUN
funcmode:
a. retrieve the values for requestor, approver,
vacation from date, and vacation to date using
API calls to wf_engine.GetItemAttrText and
wf_engine.GetItemAttrDate
b. insert a row into your Vacation Schedule table
using the appropriate item attribute values
c. set resultout to
wf_engine.eng_completed||:||wf_engine.eng_
null
d. return
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 32
Guided Practice Les 8-1 CANCEL processing
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-1


CANCEL processing
Guided Practice Les 8-1
CANCEL processing
4. In your PL/SQL procedure include logic for
CANCEL funcmode:
a. retrieve the values for requestor, approver,
vacation from date, and vacation to date using
API calls to wf_engine.GetItemAttrText and
wf_engine.GetItemAttrDate
b. delete the row from your Vacation Schedule
table based on requestor, approver, from and
to dates
c. set resultout to
wf_engine.eng_completed||:||wf_engine.eng_
null
d. return
4. In your PL/SQL procedure include logic for
CANCEL funcmode:
a. retrieve the values for requestor, approver,
vacation from date, and vacation to date using
API calls to wf_engine.GetItemAttrText and
wf_engine.GetItemAttrDate
b. delete the row from your Vacation Schedule
table based on requestor, approver, from and
to dates
c. set resultout to
wf_engine.eng_completed||:||wf_engine.eng_
null
d. return
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 33
Guided Practice Les 8-1 Adding a Function Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-1


Adding a Function Activity
Guided Practice Les 8-1
Adding a Function Activity
5. Using the Vacation Proposal process created in
practice Les 7-2, open the Vacation Proposal
process diagram:
a. Delete the transition between the Vacation
Approved and End nodes
b. Click on the New Function icon, position the
cross-hairs between the Vacation Approved
and End nodes, and click again to open the
properties
c. Enter unique Internal and Display Names,
select an appropriate icon , enter a Function
Name with format <package.procedure> for the
PL/SQL procedure you just created
5. Using the Vacation Proposal process created in
practice Les 7-2, open the Vacation Proposal
process diagram:
a. Delete the transition between the Vacation
Approved and End nodes
b. Click on the New Function icon, position the
cross-hairs between the Vacation Approved
and End nodes, and click again to open the
properties
c. Enter unique Internal and Display Names,
select an appropriate icon , enter a Function
Name with format <package.procedure> for the
PL/SQL procedure you just created
Function Activity Internal Name
As a workflow development standard, use the procedure name as the
corresponding function activity internal name where possible.
Function Value
<package.procedure> value should look something like
WFVACXX.SCHEDULE_UPDATE, where XX is the unique number assigned
to your work station.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 34
Guided Practice Les 8-1 Adding a Function Activity
Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-1


Adding a Function Activity Continued
Guided Practice Les 8-1
Adding a Function Activity Continued
d. Draw transitions from Vacation Approved to
Update Schedule, Update Schedule to End
d. Draw transitions from Vacation Approved to
Update Schedule, Update Schedule to End
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 35
Les 8-1 Summary
Copyright Oracle Corporation, 2000. All rights reserved.

Les 8-1 Summary


Les 8-1 Summary
In this practice, you should have learned how to:
Create a PL/SQL procedure using the standard API
format for function activities
Use the Workflow APIs to retrieve item attribute
values
Write logic to allow a function activity to run more
than once
Create a new function activity and node
In this practice, you should have learned how to:
Create a PL/SQL procedure using the standard API
format for function activities
Use the Workflow APIs to retrieve item attribute
values
Write logic to allow a function activity to run more
than once
Create a new function activity and node
Sample Solutions
Refer to table creation script wfvacxxc.sql, PL/SQL package specification and
body definition files wfvacxxs.sql and wfvacxxb.sql, and workflow definition file
wfvacxx_81.wft for sample solutions.
The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample procedures
used throughout the lesson practices. The procedure specific to Practice 8-1 is
WFVACXX.SCHEDULE_UPDATE.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 36
Practice Les 8-2 Overview Optional
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 8-2 Overview


Optional
Practice Les 8-2 Overview
Optional
This optional practice covers the following topics:
Creating a PL/SQL procedure to perform post-
notification response processing
Adding Post-notification Response processing to
a Notification Activity
Note: You will have an opportunity to test these
changes in a later Practice. The primary goal
in this practice is to get a clean compilation of
your PL/SQL procedure.
This optional practice covers the following topics:
Creating a PL/SQL procedure to perform post-
notification response processing
Adding Post-notification Response processing to
a Notification Activity
Note: You will have an opportunity to test these
changes in a later Practice. The primary goal
in this practice is to get a clean compilation of
your PL/SQL procedure.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 37
Practice Les 8-2 Overview Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 8-2 Overview Continued


Practice Les 8-2 Overview Continued
Create a PL/SQL procedure that includes the
following logic to validate action taken on the
Vacation Proposal notification:
if the approver rejects the Vacation Proposal
alternate vacation dates must be provided
alternate from date must be prior to
alternate to date
the approver is allowed to delegate (forward)
the notification response to another role
the approver is not allowed to transfer the
notification to another role
Create a PL/SQL procedure that includes the
following logic to validate action taken on the
Vacation Proposal notification:
if the approver rejects the Vacation Proposal
alternate vacation dates must be provided
alternate from date must be prior to
alternate to date
the approver is allowed to delegate (forward)
the notification response to another role
the approver is not allowed to transfer the
notification to another role
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 38
Practice Les 8-2 Overview Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 8-2 Overview Continued


Practice Les 8-2 Overview Continued
Associate a post-notification function with the
Vacation Proposal notification
Associate a post-notification function with the
Vacation Proposal notification
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 39
Guided Practice Les 8-2 Creating a PL/SQL Procedure
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-2


Creating a PL/SQL Procedure
Guided Practice Les 8-2
Creating a PL/SQL Procedure
1. Use the standard API format for your PL/SQL
specification and body.
1. Use the standard API format for your PL/SQL
specification and body.
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
a. Add to your package WFVACXX created in
practice Les 8-1.
b. Give your procedure the same name as the
internal name of the notification it validates.
a. Add to your package WFVACXX created in
practice Les 8-1.
b. Give your procedure the same name as the
internal name of the notification it validates.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 40
Guided Practice Les 8-2 RESPOND processing
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-2


RESPOND processing
Guided Practice Les 8-2
RESPOND processing
2. In your PL/SQL procedure include logic for
RESPOND funcmode:
a. get the notification id (nid) from the engine
context variable wf_engine.context_nid
b. retrieve the response result using API call
wf_notification.GetAttrText(nid,RESULT)
2. In your PL/SQL procedure include logic for
RESPOND funcmode:
a. get the notification id (nid) from the engine
context variable wf_engine.context_nid
b. retrieve the response result using API call
wf_notification.GetAttrText(nid,RESULT)
Setting Resultout Parameter
Parameter resultout should be set to wf_engine.eng_completed||:||<ntf result
retrieved> if the response was successfully validated.
Resultout should be set to wf_engine.eng_error||:||wf_engine.eng_null if the
response failed validation.
Resultout should be set to wf_engine.eng_null if the function mode is not
implemented or you do not wish to override the current result for the activity.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 41
Guided Practice Les 8-2 RESPOND processing
continued
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-2


RESPOND processing continued
Guided Practice Les 8-2
RESPOND processing continued
3. If response is APPROVED, no further response
validation is needed
a. set the resultout to
wf_engine.eng_completed||:||<ntf result
retrieved>
b. return
3. If response is APPROVED, no further response
validation is needed
a. set the resultout to
wf_engine.eng_completed||:||<ntf result
retrieved>
b. return
Setting Resultout Parameter
Parameter resultout should be set to wf_engine.eng_completed||:||<ntf result
retrieved> if the response was successfully validated.
Resultout should be set to wf_engine.eng_error||:||wf_engine.eng_null if the
response failed validation.
Resultout should be set to wf_engine.eng_null if the function mode is not
implemented or you do not wish to override the current result for the activity.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 42
Guided Practice Les 8-2 RESPOND processing
continued
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-2


RESPOND processing continued
Guided Practice Les 8-2
RESPOND processing continued
4. If response is REJECTED, retrieve the alternate
from and to dates using API call
wf_notification.GetAttrDate(nid,<attribute_ name>)
a. if the alternate dates are valid, set resultout to
wf_engine.eng_completed||:||<ntf result
retrieved>
b. if the alternate dates are in error, raise an
exception using API call wf_core.Raise(<your
message>) and set resultout to
wf_engine.eng_error||:||wf_engine.eng_null
4. If response is REJECTED, retrieve the alternate
from and to dates using API call
wf_notification.GetAttrDate(nid,<attribute_ name>)
a. if the alternate dates are valid, set resultout to
wf_engine.eng_completed||:||<ntf result
retrieved>
b. if the alternate dates are in error, raise an
exception using API call wf_core.Raise(<your
message>) and set resultout to
wf_engine.eng_error||:||wf_engine.eng_null
Setting Resultout Parameter
Parameter resultout should be set to wf_engine.eng_completed||:||<ntf result
retrieved> if the response was successfully validated.
Resultout should be set to wf_engine.eng_error||:||wf_engine.eng_null if the
response failed validation.
Resultout should be set to wf_engine.eng_null if the function mode is not
implemented or you do not wish to override the current result for the activity.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 43
Guided Practice Les 8-2 FORWARD processing
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-2


FORWARD processing
Guided Practice Les 8-2
FORWARD processing
5. In your PL/SQL procedure include logic for
TRANSFER funcmode:
a. raise an exception using API call
wf_core.Raise(<your message>) and set
resultout to
wf_engine.eng_error||:||wf_engine.eng_null
5. In your PL/SQL procedure include logic for
TRANSFER funcmode:
a. raise an exception using API call
wf_core.Raise(<your message>) and set
resultout to
wf_engine.eng_error||:||wf_engine.eng_null
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 44
Guided Practice Les 8-2 FORWARD, RUN, TIMEOUT
processing
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-2


FORWARD, RUN, TIMEOUT processing
Guided Practice Les 8-2
FORWARD, RUN, TIMEOUT processing
6. In your PL/SQL procedure do not implement logic
for FORWARD, RUN, or TIMEOUT funcmodes:
a. no special logic needed
b. set parameter resultout to wf_engine.eng_null
to indicate the funcmode is not implemented
6. In your PL/SQL procedure do not implement logic
for FORWARD, RUN, or TIMEOUT funcmodes:
a. no special logic needed
b. set parameter resultout to wf_engine.eng_null
to indicate the funcmode is not implemented
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 45
Guided Practice Les 8-2 Adding a Post-Notification
Function
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 8-2


Adding a Post-Notification Function
Guided Practice Les 8-2
Adding a Post-Notification Function
7. In the Workflow Builder Vacation Proposal process
diagram:
a. Open the Properties for the Vacation Proposal
notification node and enter a Function Name
with format <package.procedure> for the
PL/SQL procedure you just created.
7. In the Workflow Builder Vacation Proposal process
diagram:
a. Open the Properties for the Vacation Proposal
notification node and enter a Function Name
with format <package.procedure> for the
PL/SQL procedure you just created.
Function Value
<package.procedure> value should look like
WFVACXX.NTF_VACATION_PROPOSAL where XX is the unique number
assigned to your work station.
Copyright Oracle Corporation, 2000. All rights reserved.
Defining Function and Process Activities
Chapter 8 - Page 46
Les 8-2 Summary
Copyright Oracle Corporation, 2000. All rights reserved.

Les 8-2 Summary


Les 8-2 Summary
In this practice, you should have learned how to:
Create a PL/SQL procedure using the standard API
format for notification activity functions
Write post-notification processing to validate and
reject a notification response
Write post-notification processing to prevent
transfer of a notification
Write post-notification processing to allow a
notification to be delegated
Assign a function to a notification activity
In this practice, you should have learned how to:
Create a PL/SQL procedure using the standard API
format for notification activity functions
Write post-notification processing to validate and
reject a notification response
Write post-notification processing to prevent
transfer of a notification
Write post-notification processing to allow a
notification to be delegated
Assign a function to a notification activity
Sample Solutions
Refer to PL/SQL package specification and body definition files wfvacxxs.sql and
wfvacxxb.sql and workflow definition file wfvacxx_82.wft for sample solutions.
The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample procedures
used throughout the lesson practices. The procedure specific to Practice 8-2 is
WFVACXX.NTF_VACATION_PROPOSAL.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 1
Diagramming a Workflow
Process
Chapter 9
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 2
Diagramming a Workflow Process
Copyright Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Diagramming a Workflow Process
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson you should be able to:
Diagram a workflow process
Incorporate standard activities in a process
Review the process definition for the item type
After this lesson you should be able to:
Diagram a workflow process
Incorporate standard activities in a process
Review the process definition for the item type
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 4
Create a New Workflow Process Definition
Copyright Oracle Corporation, 2000. All rights reserved.

Create a New Workflow Process


Definition
Create a New Workflow Process
Definition
To create a new workflow process: To create a new workflow process:
Define the item type of the process Define the item type of the process
Define item type attributes for the process Define item type attributes for the process
Define lookup types and lookup codes Define lookup types and lookup codes
Define messages Define messages
Define message attributes Define message attributes
Define the activities in the process as Function, Define the activities in the process as Function,
Notification, or Process Notification, or Process
Diagram the relationship of the activities Diagram the relationship of the activities
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 5
Loading Roles
Copyright Oracle Corporation, 2000. All rights reserved.

Loading Roles
Loading Roles
Loading Roles
If you wish to set the recipient of a notification to a constant value, you must
first load the roles stored in your Oracle Workflow directory service into Oracle
Workflow Builder. To load roles, use the following procedure:
1. Choose File>Open to connect to your database and open the item type
for which you are creating a process diagram.
2. Choose File>Load Roles from Database.
3. Specify search criteria in the Find Roles field of the Role selection
window and then choose Find.
4. Select the roles you want to load in the Query Results list, then choose
Add to add them to the Loaded Roles list.
5. Choose OK to load the roles and make them available to the objects in
your open item type.
Directory Service Display
Use the Directory Service branch in the navigator tree to see information about
the roles you load from the database.
List-of-Values for Role Attributes
You can select roles from the list of values which the directory service
populates. List-of-values is available wherever large lists are used.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 6
Diagramming a Process
Copyright Oracle Corporation, 2000. All rights reserved.

Diagramming a Process
Diagramming a Process
1. To begin drawing a process diagram, you must
display the process window. This can be done in
several ways:
a. Double-click on the process activity on the
navigator tree.
b. Select the process activity and press Ctrl + E.
c. Select the process activity and choose Process
Details from the Edit menu.
d. Use the Quick Start Wizard to create a process
activity and initial diagram with Start and End
nodes.
1. To begin drawing a process diagram, you must
display the process window. This can be done in
several ways:
a. Double-click on the process activity on the
navigator tree.
b. Select the process activity and press Ctrl + E.
c. Select the process activity and choose Process
Details from the Edit menu.
d. Use the Quick Start Wizard to create a process
activity and initial diagram with Start and End
nodes.
Each process diagram must have one or more Start
activities and one or more End activities.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 7
Quick Start Wizard
Copyright Oracle Corporation, 2000. All rights reserved.

Quick Start Wizard


Quick Start Wizard
Quick Start Wizard
The Quick Start Wizard creates a process and opens the process window.
The start and end nodes are automatically created. The workflow
developer uses the process diagram toolbar icons to create additional
activity nodes.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 8
Diagramming a Process (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Diagramming a Process (continued)


Diagramming a Process (continued)
2. Create a new node in the process by using one of
the following methods:
a. Select an activity (process, function or
notification) from the navigator tree and drag it
to the process window
b. Choose from the New
Function/Process/Notification toolbar button
c. Choose Create Activity from the right mouse
button menu while your cursor is in the
process window
2. Create a new node in the process by using one of
the following methods:
a. Select an activity (process, function or
notification) from the navigator tree and drag it
to the process window
b. Choose from the New
Function/Process/Notification toolbar button
c. Choose Create Activity from the right mouse
button menu while your cursor is in the
process window
Drawing the Process Diagram
Note: In the process window, you can display information about an activity by
moving your mouse over the activity. The Label Name, Internal Name, Display
Name, Comment, and Performer appears in a tool-tip-style display.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 9
Show Label in Designer Menu Option
Copyright Oracle Corporation, 2000. All rights reserved.

Show Label in Designer Menu Option


Show Label in Designer Menu Option
View/Show Label in Designer Navigator Menu Options
The View>Show Label In Designer menu options are:
Instance Label: Uses the node label for each activity node
Internal Name: Uses the internal name of an activity as the label
for each activity node
Display name: Uses the display name of an activity as the label for
each activity node
Performer: Uses the activitys performer as the label for each
activity node
Comment: Uses the activitys comment as the label for each
activity node
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 10
Display Modes
Copyright Oracle Corporation, 2000. All rights reserved.

Display Modes
Display Modes
Object Internal names
Standard icons
used for display
Display Modes
You can toggle between the following two display modes of the workflow
builder:
Presentation mode
Developer mode
In presentation mode, workflow builder shows the names for the activity
icons that you specify in their property page.
The developer mode assists you in developing large complex processes as
follows:
Providing visual distinctions between top-level processes and
subprocesses in the navigator tree
Setting the icons for each activity and object to the default icon of
its object type or subtype in both the navigator tree and the process
diagram window
Identifying each object in the navigator tree by its internal, or
developer, name
Identifying each activity in the process diagram window by its
activity label
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 11
Diagramming a Process (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Diagramming a Process (continued)


Diagramming a Process (continued)
3. Create a transition (arrow) between two nodes by
holding down the right mouse button and
dragging the cursor from the source activity to the
destination activity.
4. Choose a result from the list of possible result
codes that appear if the source activity has a
result type defined.
3. Create a transition (arrow) between two nodes by
holding down the right mouse button and
dragging the cursor from the source activity to the
destination activity.
4. Choose a result from the list of possible result
codes that appear if the source activity has a
result type defined.
Drawing the Process Diagram (continued)
If the source activity has no result type associated with it, by default no label
appears on the transition. You can choose to show a label for such a transition
by selecting the transition, holding down the right mouse button, and clearing
the Hidden Label option. The label will display as <Default>.
If the source activity has an associated result type you can create transitions to
follow:
a. When a specific result is returned by the activity, labeled with the result
display name
b. When a result returned is not covered by other transitions, labeled <Default>
c. Regardless of result returned, labeled <Any>
d. When the activity times out, labeled <Timeout>
If the source activity is a voting activity you can also create transitions to
follow:
a. When the vote results in a tie, labeled <Tie>
b. When the vote doesnt return a result, labeled <No Match>
Note: For more information on good diagramming practices please see the
following URL :
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 12
http://www-apps.us.oracle.com/atg/wf/index.html.
Choose the Workflow Development Standards link to the More Tips for Good
Diagramming link.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 13
Self-Looping Transitions
Copyright Oracle Corporation, 2000. All rights reserved.

Self-Looping Transitions
Self-Looping Transitions
Activity loops
back to itself
on Timeout
Self-Looping Transitions
How to draw a self-loop transition
1. Select the activity node.
2. Hold down the right mouse button.
3. Drag the cursor away and back to the same activity node.
4. Release the right mouse button and select the transition label from the list
of results.
Note: The node Timeout property must be set to enable the <Timeout> option
in the transition list of results.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 14
<Any> Transitions
Copyright Oracle Corporation, 2000. All rights reserved.

<Any> Transitions
<Any> Transitions
No
Ye s
Approve
Reje ct
<Any>
Document
Approve d
Document
Re jecte d
End (Re ject)
End (Approve)
Review
Document
Start
Log Re view
Automatic parallel branching
with the
<Any> transition
<Any> Transition
The Workflow Engine follows an <Any> transition regardless of what
completion result the activity returns. This allows you to include a generic
activity in the process that the Workflow Engine executes in parallel with
the result-specific activity.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 15
Top Down Design
Copyright Oracle Corporation, 2000. All rights reserved.

Top Down Design


Top Down Design
Palette permits
creating processes,
notifications or
functions without
underlying
dependencies
No need to
specify function
at this point
Top Down Design
Oracle Workflow Builder previously required you to enter a workflow
definition by defining underlying components before drawing the process
diagram. The top-down design approach lets you draw the process
diagram first and then define the underlying components.
When you save a partially completed top-down process, workflow builder
displays an error window with a list of invalid or missing information.
You can save the errored process definition and correct the errors later.
The activity and process activity property pages are now accessible from
one dialogue. The property page now includes all tabs both for the base
activity of the node and the usage of the individual node.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 16
Top Down Design
Copyright Oracle Corporation, 2000. All rights reserved.

Top Down Design


Top Down Design
Functions can be created
while designing
Palette permits
creating processes,
notifications or
functions without
underlying
dependencies
No need to
specify function
at this point
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 17
Validation Performed by the Verify Command
Copyright Oracle Corporation, 2000. All rights reserved.

Validation Performed by the Verify


Command
Validation Performed by the Verify
Command
At least one Start and one End activity exists.
A process does not contain itself as a process
activity.
The same subprocess is not being used twice in a
process.
All possible activity results are modeled as
outgoing transitions.
All activity nodes marked as END nodes do not
have any outgoing transitions.
At least one Start and one End activity exists.
A process does not contain itself as a process
activity.
The same subprocess is not being used twice in a
process.
All possible activity results are modeled as
outgoing transitions.
All activity nodes marked as END nodes do not
have any outgoing transitions.
Verify Transitions
When you save your work the Workflow Builder automatically validates
the process definition for any invalid or missing information and displays
what it finds in a Workflow Error verification window. You can verify
your workflow definition at any time during a builder session by selecting
an object (for example, data store, item type, and process) in the navigator
tree and choosing Verify from the File menu options. This will validate
the definitions in the current data store.
Note: The Verify option is enabled in the File menu only when the
navigator window is the current window.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 18
Validation Performed by the Verify Command
(continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Validation Performed by the Verify


Command (continued)
Validation Performed by the Verify
Command (continued)
Each notification activity's result type matches the
lookup type defined for the message's RESULT
message attribute.
All message attributes referenced in a message
body for token substitution exist in the message
definition.
All processes that reference objects from another
item type verify the existence of requisite item
attributes associated with that referenced item.
Each notification activity's result type matches the
lookup type defined for the message's RESULT
message attribute.
All message attributes referenced in a message
body for token substitution exist in the message
definition.
All processes that reference objects from another
item type verify the existence of requisite item
attributes associated with that referenced item.
Advanced Definition Validation
You should always validate any new process definition you create as it
helps you to identify any potential problems with the definition that might
prevent it from executing successfully.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 19
Editing a Transition
Copyright Oracle Corporation, 2000. All rights reserved.

Editing a Transition
Editing a Transition
1. Select the transition you want to edit.
2. Click on the right mouse button to edit the
transition
Delete transition: deletes the selected
transition
Locked: toggles between locking and
unlocking the transition from further edits
Hidden label: toggles between displaying and
hiding the transition label
Straighten: straightens the transition by
removing extra vertex points causing the bend
Results: allows changing of result label
already assigned
1. Select the transition you want to edit.
2. Click on the right mouse button to edit the
transition
Delete transition: deletes the selected
transition
Locked: toggles between locking and
unlocking the transition from further edits
Hidden label: toggles between displaying and
hiding the transition label
Straighten: straightens the transition by
removing extra vertex points causing the bend
Results: allows changing of result label
already assigned
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 20
Editing a Transition (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Editing a Transition (continued)


Editing a Transition (continued)
3. Repositioning a transition label: select the label
with the mouse and drag to the new position
4. Bending a transition: select the transition and drag
by holding down the left mouse button to create a
vertex point.
5. Creating a self-looping transition: one of two ways
Hold down right mouse button and drag
mouse from source activity back to itself
Draw a transition to some other activity, add a
vertex point to the transition, then select the
arrowhead with left mouse button and drag
back to originating activity
6. Removing vertex point: select the vertex and drag
over another to combine the two points
3. Repositioning a transition label: select the label
with the mouse and drag to the new position
4. Bending a transition: select the transition and drag
by holding down the left mouse button to create a
vertex point.
5. Creating a self-looping transition: one of two ways
Hold down right mouse button and drag
mouse from source activity back to itself
Draw a transition to some other activity, add a
vertex point to the transition, then select the
arrowhead with left mouse button and drag
back to originating activity
6. Removing vertex point: select the vertex and drag
over another to combine the two points
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 21
Customizing a Process Node
Copyright Oracle Corporation, 2000. All rights reserved.

Customizing a Process Node


Customizing a Process Node
Customize a Node
Since an activity can be reused throughout a process, a node represents an
instance of that activity and its properties are unique to that instance. To
customize a node, in the Process Activity property page:
1. Specify whether the activity is a Start, End, or Normal activity in the
process.
For an End activity, if the process itself has a result type associated with it,
you should specify what the result of the process is when this End activity
completes. Choose from the possible results listed in the result type of the
process activity.
2. If you use an activity more than once in a process, subsequent nodes of
that activity will have an -N appended to its label name to identify it as a
unique instance.
3. If the activity is a notification, specify a performer.
A performer is a role that can consist of one or more users.
You can specify a static role. Specify Constant for the Performer Type, then
select a role name. Note that you must first load roles from your database
first.
You can alternatively specify a dynamic role. Select item attribute for the
Performer type, then select an Item Type attribute that returns a role name
during runtime.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 22
Setting Activity Attribute Values
Copyright Oracle Corporation, 2000. All rights reserved.

Setting Activity Attribute Values


Setting Activity Attribute Values
Activity Attributes
Because an activity can be reused throughout a process, the value of an activity
attribute can vary from node to node. Specify the values for the attributes in the
Attribute Values property page.
1. Select the attribute.
2. The value can be constant or dynamic:
For a constant value, select Constant, then enter a value.
For a dynamic value, select Item Attribute, then select the name of an item
type attribute that returns a value of the same type during runtime.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 23
Deleting Item Attributes
Copyright Oracle Corporation, 2000. All rights reserved.

Deleting Item Attributes


Deleting Item Attributes
You use workflow builder to delete item attributes
from a workflow definition in a database
To actually delete an attribute from the database
you must be connected to that database. Deleting
from a flat file and uploading it will not delete the
attribute from the database
You use workflow builder to delete item attributes
from a workflow definition in a database
To actually delete an attribute from the database
you must be connected to that database. Deleting
from a flat file and uploading it will not delete the
attribute from the database
Note: Deleting an item attribute from a workflow definition stored in a flat
file, then uploading that flat file definition to a database will not delete the
item attribute from the definition stored in the database. To delete an item
attribute completely, you must delete it from your flat file definition and
specifically from any databases in which that workflow item type is
loaded.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 24
Standard Activities
Copyright Oracle Corporation, 2000. All rights reserved.

Standard Activities
Standard Activities
Standard Activities
The standard item type includes function and notification activities that
can be included in process diagrams associated with the other item types.
For a full explanation of the above standard activities please see the
Oracle Workflow Guide (Release 2.5), chapter 6, Predefined Workflow
Activities.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 25
Saving the Process Definition
Copyright Oracle Corporation, 2000. All rights reserved.

Saving the Process Definition


Saving the Process Definition
Always save the process definition to a flat file for
source control.
Before saving the process definition to the
production database, save to a development
database for testing.
The Workflow Loader is a utility program that
moves workflow definitions between database and
flat files. It is used to move definitions between
development and production databases, or to
apply upgrades to existing definitions.
Always save the process definition to a flat file for
source control.
Before saving the process definition to the
production database, save to a development
database for testing.
The Workflow Loader is a utility program that
moves workflow definitions between database and
flat files. It is used to move definitions between
development and production databases, or to
apply upgrades to existing definitions.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 26
Reviewing the Process Definition
Copyright Oracle Corporation, 2000. All rights reserved.

Reviewing the Process Definition


Reviewing the Process Definition
Item Type Definition Web Page
The Item Type Definition Web page provides you with distributed access to
workflow definitions stored in your Oracle Workflow database.
The item type Definition Web page provides detailed view of attributes,
processes, notifications, functions, messages, and lookup types associated
with a given item type.
The information is displayed in two frames. The left frame lists all the objects
in the item type in an expandable hierarchy tree, similar to the navigator
tree in Oracle Workflow Builder. The right frame displays the details of
the object you select in the hierarchy tree. Select either frame at any time
and use the Print command in your Web browser to print all the
information in the selected frame.
Displaying the Item Type Definition Web Page
1. Enter the URL <webagent>/wf_item_definition.find_item_type in your
Web browser.
2. Select the item type to display.
3. Specify the effective date and time of the item type definition you want to
display, using the format DD-MON-RRRR.
4. Choose Find.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 27
Version Compatibility
Copyright Oracle Corporation, 2000. All rights reserved.

Version Compatibility
Version Compatibility
All Oracle Workflow client modules automatically
verify that the module is compatible with the
version of the Oracle Workflow server that it is
operating against.
To determine which version of the Oracle
Workflow server is running, connect to the
Workflow server account using SQL/PLUS and
execute the script wfver.sql
All Oracle Workflow client modules automatically
verify that the module is compatible with the
version of the Oracle Workflow server that it is
operating against.
To determine which version of the Oracle
Workflow server is running, connect to the
Workflow server account using SQL/PLUS and
execute the script wfver.sql
Version Compatibility Check
You can check that the workflow builder is compatible with the version of
the workflow server against which it is operating.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 28
Display Name Conflicts
Copyright Oracle Corporation, 2000. All rights reserved.

Display Name Conflicts


Display Name Conflicts
If a nonunique display name is encountered during
upload/upgrade, the Workflow Definition Loader
automatically resolves the display name conflict
by adding a @ character to the beginning of
conflicting display names.
If a nonunique display name is encountered during
upload/upgrade, the Workflow Definition Loader
automatically resolves the display name conflict
by adding a @ character to the beginning of
conflicting display names.
Display Name Conflicts
The workflow definitions loader automatically resolves display name
conflicts caused when the following entities share the same display name:
The upload/upgrade definition
The target database
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 29
Practice Les 9-1 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 9-1 Overview


Practice Les 9-1 Overview
This practice covers the following topics:
Creating a Notification Timeout
Adding a Result Type to a process
Adding an Error Process to a process
Note: You will have an opportunity to test these
changes in a later Practice.
This practice covers the following topics:
Creating a Notification Timeout
Adding a Result Type to a process
Adding an Error Process to a process
Note: You will have an opportunity to test these
changes in a later Practice.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 30
Practice Les 9-1 Overview Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 9-1 Overview Continued


Practice Les 9-1 Overview Continued
Using the Vacation Proposal process created in
Practice Les 8-1 or 8-2:
Add a Timeout to the Vacation Proposal
notification
Implement one of the following:
On timeout, transition back to the same
notification until a response is received
On timeout, transition to a loop counter and
back to the Vacation Proposal 2 times, on the
3rd loop exit to approve the proposal
On timeout, transition to a reminder
notification
Using the Vacation Proposal process created in
Practice Les 8-1 or 8-2:
Add a Timeout to the Vacation Proposal
notification
Implement one of the following:
On timeout, transition back to the same
notification until a response is received
On timeout, transition to a loop counter and
back to the Vacation Proposal 2 times, on the
3rd loop exit to approve the proposal
On timeout, transition to a reminder
notification
Sample Solutions
Refer to PL/SQL package specification and body definition files wfvacxxs.sql and
wfvacxxb.sql, and workflow definition files wfvacxx_81.wft and wfvacxx_82.wft
for sample solutions.
The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample procedures
used throughout the lesson practices.
The procedure specific to Practice 8-1 is WFVACXX.SCHEDULE_UPDATE.
The procedure specific to Practice 8-2 is
WFVACXX.NTF_VACATION_PROPOSAL.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 31
Practice Les 9-1 Overview Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 9-1 Overview Continued


Practice Les 9-1 Overview Continued
Modify the Vacation Proposal process properties:
assign Result Type Approval
assign Error Process DEFAULT_ERROR from
Error Item Type WFERROR
Label the two process End points with the
appropriate result
Modify the Vacation Proposal process properties:
assign Result Type Approval
assign Error Process DEFAULT_ERROR from
Error Item Type WFERROR
Label the two process End points with the
appropriate result
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 32
Guided Practice Les 9-1 Adding a Timeout
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 9-1


Adding a Timeout
Guided Practice Les 9-1
Adding a Timeout
1. In the Workflow Builder open the Vacation
Proposal process diagram created in Practice Les
8-1 or 8-2:
a. Open the Properties for the Vacation Proposal
notification node. Select the Node tab and set
the Timeout.
Hint: simplest method for testing is to set
the Timeout Type to Relative Time and the
Value to a short duration such as 5 Minutes
1. In the Workflow Builder open the Vacation
Proposal process diagram created in Practice Les
8-1 or 8-2:
a. Open the Properties for the Vacation Proposal
notification node. Select the Node tab and set
the Timeout.
Hint: simplest method for testing is to set
the Timeout Type to Relative Time and the
Value to a short duration such as 5 Minutes
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 33
Guided Practice Les 9-1 Adding a Self-Timeout
Transition
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 9-1


Adding a Self-Timeout Transition
Guided Practice Les 9-1
Adding a Self-Timeout Transition
2. In the Workflow Builder Vacation Proposal process
diagram:
a. Select the Vacation Proposal notification node,
hold down your right mouse button and drag
away and back to the Vacation Proposal node.
Let go of the right mouse button.
b. Choose <Timeout> from the transition results.
2. In the Workflow Builder Vacation Proposal process
diagram:
a. Select the Vacation Proposal notification node,
hold down your right mouse button and drag
away and back to the Vacation Proposal node.
Let go of the right mouse button.
b. Choose <Timeout> from the transition results.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 34
Guided Practice Les 9-1 Adding a Loop Counter
Function Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 9-1


Adding a Loop Counter Function Activity
Guided Practice Les 9-1
Adding a Loop Counter Function Activity
3. In the Workflow Builder WFVACXX item type:
a. Open the Vacation Proposal process diagram
b. Locate the Loop Counter function activity in
the Standard item type
c. Drag and drop the Loop Counter activity into
the Vacation Proposal process diagram
positioning it above the Vacation Proposal
notification node
d. Open the Loop Counter node Properties and
go to the Node Attributes tab to set the
number of times to loop
3. In the Workflow Builder WFVACXX item type:
a. Open the Vacation Proposal process diagram
b. Locate the Loop Counter function activity in
the Standard item type
c. Drag and drop the Loop Counter activity into
the Vacation Proposal process diagram
positioning it above the Vacation Proposal
notification node
d. Open the Loop Counter node Properties and
go to the Node Attributes tab to set the
number of times to loop
Locating the Loop Counter Function Activity
With the cursor in the Builder Navigator window, select Find from the Edit
menu (or ctrl+F). Enter Loop Counter in the Search Text field, check the
Display Name and Function checkboxes and click on the Search button. The
Loop Counter will be automatically selected. Close the Find window.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 35
Guided Practice Les 9-1 Adding a Loop Counter
Function Activity Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 9-1


Adding a Loop Counter Function Activity
Continued
Guided Practice Les 9-1
Adding a Loop Counter Function Activity
Continued
e. Select attribute Loop Limit and set it to a
Constant Type with a Value of 2
e. Select attribute Loop Limit and set it to a
Constant Type with a Value of 2
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 36
Guided Practice Les 9-1 Adding a Timeout transition to
Loop Counter
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 9-1


Adding a Timeout transition to Loop
Counter
Guided Practice Les 9-1
Adding a Timeout transition to Loop
Counter
4. In the Workflow Builder Vacation Proposal process
diagram:
a. Select the Vacation Proposal notification node,
draw a transition to the Loop Counter node
choosing <Timeout> from the Results menu
b. Create a vertex in the transition line between
the nodes
c. Select the Loop Counter node, draw a
transition to the Vacation Proposal notification
node choosing Loop from the transition
results
4. In the Workflow Builder Vacation Proposal process
diagram:
a. Select the Vacation Proposal notification node,
draw a transition to the Loop Counter node
choosing <Timeout> from the Results menu
b. Create a vertex in the transition line between
the nodes
c. Select the Loop Counter node, draw a
transition to the Vacation Proposal notification
node choosing Loop from the transition
results
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 37
Guided Practice Les 9-1 Adding a Timeout transition to
Loop Counter Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 9-1


Adding a Timeout transition to Loop
Counter Continued
Guided Practice Les 9-1
Adding a Timeout transition to Loop
Counter Continued
d. Select the Loop Counter node, draw a
transition to the Vacation Approved node
choosing Exit from the transition results
d. Select the Loop Counter node, draw a
transition to the Vacation Approved node
choosing Exit from the transition results
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 38
Guided Practice Les 9-1 Assigning a Process Result
and Error Process
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 9-1


Assigning a Process Result
and Error Process
Guided Practice Les 9-1
Assigning a Process Result
and Error Process
5. In the Workflow Builder Navigator open the
Properties for the Vacation Proposal process:
a. Select Approval from the Result Type poplist
b. Select the Details tab and enter:
Error Item Type WFERROR
Error Process DEFAULT_ERROR
5. In the Workflow Builder Navigator open the
Properties for the Vacation Proposal process:
a. Select Approval from the Result Type poplist
b. Select the Details tab and enter:
Error Item Type WFERROR
Error Process DEFAULT_ERROR
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 39
Guided Practice Les 9-1 Labeling End nodes with
Result
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 9-1


Labeling End nodes with Result
Guided Practice Les 9-1
Labeling End nodes with Result
6. In the Workflow Builder Vacation Proposal process
diagram:
a. Open the Properties for each End node and
select the Node tab
b. Select a value from the Result poplist
Approve for the End node associated with
the vacation proposal approved path
through the process
Reject for the End node associated with the
vacation proposal rejected path through the
process
6. In the Workflow Builder Vacation Proposal process
diagram:
a. Open the Properties for each End node and
select the Node tab
b. Select a value from the Result poplist
Approve for the End node associated with
the vacation proposal approved path
through the process
Reject for the End node associated with the
vacation proposal rejected path through the
process
Note:
The Start/End property must be set to End to enable the Result property on the
node.
Copyright Oracle Corporation, 2000. All rights reserved.
Diagramming a Workflow Process
Chapter 9 - Page 40
Les 9-1 Summary
Copyright Oracle Corporation, 2000. All rights reserved.

Les 9-1 Summary


Les 9-1 Summary
In this practice, you should have learned how to:
Set a Timeout property and create a <Timeout>
transition for a notification activity
Modify Process properties
Assign a result to a process End node
In this practice, you should have learned how to:
Set a Timeout property and create a <Timeout>
transition for a notification activity
Modify Process properties
Assign a result to a process End node
Sample Solutions
Refer to workflow definition file wfvacxx_91.wft for Timeout using a Loop
Counter sample solution.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 1
Overview of the Workflow
Engine
Chapter 10
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 2
Overview of the Workflow Engine
Copyright Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Engine


Overview of the Workflow Engine
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Give a general description of how the Workflow
Engine manages a process
Apply the Workflow Engine APIs to your function
activities
After this lesson, you should be able to:
Give a general description of how the Workflow
Engine manages a process
Apply the Workflow Engine APIs to your function
activities
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 4
Overview of the Workflow Engine
Copyright Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Engine


Overview of the Workflow Engine
Is implemented in server-side PL/SQL.
Is activated whenever a call to one of its PL/SQL
procedures or functions is made.
Manages the state of activities for each process
instance.
Determines the next activity once a prerequisite
activity completes.
Executes function activities automatically.
Calls the Notification System to send notification
messages.
Is implemented in server-side PL/SQL.
Is activated whenever a call to one of its PL/SQL
procedures or functions is made.
Manages the state of activities for each process
instance.
Determines the next activity once a prerequisite
activity completes.
Executes function activities automatically.
Calls the Notification System to send notification
messages.
The Oracle Workflow Engine: The Oracle Workflow Engine:
Note: The Notification System is also implemented in server-side PL/SQL and
can interface with an Oracle Web Agent or the Notification Mailer program to
deliver notifications to end users.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 5
Overview of the Workflow Engine (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Engine


(continued)
Overview of the Workflow Engine
(continued)
Supports results-based branches, parallel
branches, rendezvous, loops and subprocesses.
Can execute activities from non-savepoint
environments such as database triggers and
distributed transactions. It automatically traps
savepoint-not-allowed errors.
Can defer activities too costly to execute in real
time to background engines for processing.
Maintains a history of completed activities.
Detects error conditions and executes error
processes.
Supports results-based branches, parallel
branches, rendezvous, loops and subprocesses.
Can execute activities from non-savepoint
environments such as database triggers and
distributed transactions. It automatically traps
savepoint-not-allowed errors.
Can defer activities too costly to execute in real
time to background engines for processing.
Maintains a history of completed activities.
Detects error conditions and executes error
processes.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 6
Workflow Engine Features
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Engine Features


Workflow Engine Features
Managing process state
Coordinating execution of activities
Sophisticated rules including looping, results-
based branching, parallel flows, and subprocesses
Deferred processing
Detecting error conditions and running error
processes
Managing process state
Coordinating execution of activities
Sophisticated rules including looping, results-
based branching, parallel flows, and subprocesses
Deferred processing
Detecting error conditions and running error
processes
The Workflow Engine supports the following features: The Workflow Engine supports the following features:
Additional Workflow Engine Features
For explicit information on the above features please see the Oracle
Workflow Guide (Release 2.5), chapter 8 Oracle Workflow APIs.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 7
Initiating a Workflow Process
Copyright Oracle Corporation, 2000. All rights reserved.

Initiating a Workflow Process


Initiating a Workflow Process
Your application must execute a procedure that
calls the following Workflow Engine APIs:
WF_ENGINE.CreateProcess
WF_ENGINE.StartProcess
or
WF_ENGINE.LaunchProcess
The procedure must identify the value of the
process item type and item key for these APIs
Your application must execute a procedure that
calls the following Workflow Engine APIs:
WF_ENGINE.CreateProcess
WF_ENGINE.StartProcess
or
WF_ENGINE.LaunchProcess
The procedure must identify the value of the
process item type and item key for these APIs
To start a workflow process: To start a workflow process:
Initiating Workflow Processes
Oracle Workflow Release 2.5 now includes a new Launch Processes Web
Page for initiating workflow processes. The Launch Processes link can be
found on the Workflow Home Page. It is intended for use by the
Workflow Administrator and for testing workflow processes in a
development environment.
Note: For more information on the syntax and descriptions of the above
APIs please see the Oracle Workflow User Guide (Release 2.5), chapter 8
Workflow Engine APIs section.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 8
Workflow Engine Processing
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Engine Processing


Workflow Engine Processing
Upon starting a process, the Workflow Engine:
Identifies and executes the Start activity
Determines the next activity to transition to after
completing the prerequisite activity or activities
Drives through the process, automatically
executing all function activities, until it comes to a
notification or blocking activity
Calls the Notification System to notify the recipient
Continues driving through the process until it
encounters an End activity, (once the performer
completes the notification or the block activity is
completed)
Upon starting a process, the Workflow Engine:
Identifies and executes the Start activity
Determines the next activity to transition to after
completing the prerequisite activity or activities
Drives through the process, automatically
executing all function activities, until it comes to a
notification or blocking activity
Calls the Notification System to notify the recipient
Continues driving through the process until it
encounters an End activity, (once the performer
completes the notification or the block activity is
completed)
Workflow Engine
Sets a savepoint for each completed function activity
Saves all consecutively completed function activities as part of one
commit cycle
If an error occurs during a commit, the database can roll back to an
appropriate savepoint
Note: A notification activity that sends an FYI notification message will
be automatically completed by the Workflow Engine. Only notifications
that prompt for a response will cause the Workflow Engine to pause for
response from the notification recipient.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 9
Activity Statuses
Copyright Oracle Corporation, 2000. All rights reserved.

Activity Statuses
Activity Statuses
Once the Workflow Engine executes an activity, it
updates the state of the activity to one of the
following statuses:
Active
Complete
Waiting
Notified
Deferred
Error
Suspend
Once the Workflow Engine executes an activity, it
updates the state of the activity to one of the
following statuses:
Active
Complete
Waiting
Notified
Deferred
Error
Suspend
Activity Status Definitions
Active: Activity is currently being executed.
Complete: Activity executed successfully.
Waiting: Activity is waiting for dependencies to complete. An
example is the AND activity, where one of its incoming activity
transitions is complete but is still waiting for another required
incoming activity transition to complete before it can be marked as
complete.
Notified: Activity is waiting for a response from a notification or
for an external program to complete and call the Workflow Engine.
Deferred: Activity is deferred to a background engine for
execution.
Error: Activity has encountered an error during execution.
Suspend: Activity is suspended from further execution.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 10
Calling the Workflow Engine
Copyright Oracle Corporation, 2000. All rights reserved.

Calling the Workflow Engine


Calling the Workflow Engine
Engine must be informed when an activity
completes.
Process, notification, and function activities
automatically call
WF_ENGINE.CompleteActivity( ) when they
complete.
If a notification activity requires some action to
be taken in a form or Web page, then that form
or Web page must call
WF_ENGINE.CompleteActivity( ) when the user
completes the transaction.
If a function activity calls an external program,
then code that external program to call
WF_ENGINE.CompleteActivity( ) when it
completes.
Engine must be informed when an activity
completes.
Process, notification, and function activities
automatically call
WF_ENGINE.CompleteActivity( ) when they
complete.
If a notification activity requires some action to
be taken in a form or Web page, then that form
or Web page must call
WF_ENGINE.CompleteActivity( ) when the user
completes the transaction.
If a function activity calls an external program,
then code that external program to call
WF_ENGINE.CompleteActivity( ) when it
completes.
Note:
You can add a standard Block activity after any function activity that calls
an external program. The Block activity will pause the process until the
external program completes and makes a call to
WF_ENGINE.CompleteActivity( ).
For more information, see the Oracle Workflow Guide (Release 2.5) for a
complete description of all Oracle Workflow APIs.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 11
Oracle Workflow APIs
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow APIs


Oracle Workflow APIs
Oracle Workflow APIs are grouped as follows:
Engine APIs
Starting/running a process
Communicating attribute information
Communicating state changes
Core APIs: raising and catching errors
Purge APIs: purging obsolete runtime data
Directory APIs: communicating directory services
user and role information
Oracle Workflow APIs are grouped as follows:
Engine APIs
Starting/running a process
Communicating attribute information
Communicating state changes
Core APIs: raising and catching errors
Purge APIs: purging obsolete runtime data
Directory APIs: communicating directory services
user and role information
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 12
Oracle Workflow APIs (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow APIs (continued)


Oracle Workflow APIs (continued)
Monitor APIs: generating Workflow Monitor URLs
Notification APIs: managing notifications
Preference APIs: retrieving user preference
information
Queue APIs: handling workflow Advanced Queues
processing
Document Management APIs: returning URLs or
javascript functions
Views: providing public views to access workflow
data
Monitor APIs: generating Workflow Monitor URLs
Notification APIs: managing notifications
Preference APIs: retrieving user preference
information
Queue APIs: handling workflow Advanced Queues
processing
Document Management APIs: returning URLs or
javascript functions
Views: providing public views to access workflow
data
Note:
The public views are installed in the APPS account for the version of
Oracle Workflow embedded in Oracle Applications.
For more information, see the Oracle Workflow Guide (Release 2.5),
chapter 8 for a complete description of all Oracle Workflow APIs.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 13
Workflow Engine APIs
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Engine APIs


Workflow Engine APIs
Use the following APIs to start or run a workflow
process:
WF_ENGINE.CreateProcess
WF_ENGINE.StartProcess
WF_ENGINE.LaunchProcess
WF_ENGINE.SetItemOwner
WF_ENGINE.SetItemUserKey
WF_ENGINE.SetItemParent
WF_ENGINE.background
Use the following APIs to start or run a workflow
process:
WF_ENGINE.CreateProcess
WF_ENGINE.StartProcess
WF_ENGINE.LaunchProcess
WF_ENGINE.SetItemOwner
WF_ENGINE.SetItemUserKey
WF_ENGINE.SetItemParent
WF_ENGINE.background
Workflow Engine APIs to Start or Run a Process
The item type and item key uniquely identify an item and must be passed
to subsequent API calls for each specific process. The following APIs start
or run a workflow process:
WF_ENGINE.CreateProcess creates a new runtime process for an
application item.
WF_ENGINE.StartProcess begins execution of the specified
process.
WF_ENGINE.LaunchProcess launches a specified process by
creating the new runtime process and beginning its execution.
WF_ENGINE.SetItemOwner sets the owner of an existing item.
WF_ENGINE.SetItemUserKey sets a user-friendly identifier for
an item.
WF_ENGINE.SetItemParent defines the parent/child relationship
for a master-and-detail process.
WF_ENGINE.background runs a background engine to process
deferred and/or timed out activities.
For more information, see the Oracle Workflow Guide (Release 2.5),
chapter 8 for a complete description of all Oracle Workflow APIs.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 14
Workflow Engine APIs
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Engine APIs


Workflow Engine APIs
Use the following APIs to communicate attribute
information to the Workflow Engine:
WF_ENGINE.SetItemAttribute (3)
WF_ENGINE.SetItemAttrDocument
WF_ENGINE.getItemTypes
WF_ENGINE.GetItemAttribute (3)
WF_ENGINE.GetItemAttrDocument
Use the following APIs to communicate attribute
information to the Workflow Engine:
WF_ENGINE.SetItemAttribute (3)
WF_ENGINE.SetItemAttrDocument
WF_ENGINE.getItemTypes
WF_ENGINE.GetItemAttribute (3)
WF_ENGINE.GetItemAttrDocument
Workflow Engine APIs to Communicate Attribute Information
The following APIs communicate attribute information to the Workflow
Engine:
WF_ENGINE.SetItemAttribute (3) sets the value of an item type
attribute in a process.
WF_ENGINE.SetItemAttrDocument sets the value of an item
attribute of type document, to a documents identifier.
WF_ENGINE.getItemTypes returns a list of all the item types
defined in the Oracle Workflow database as a two dimensional
data object.
WF_ENGINE.GetItemAttribute (3) returns the value of an item
type attribute in a process.
WF_ENGINE.GetItemAttrDocument returns the document
identifier of an item attribute of type document.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 15
Workflow Engine APIs
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Engine APIs


Workflow Engine APIs
WF_ENGINE.GetActivityAttribute (3)
WF_ENGINE.AddItemAttr
WF_ENGINE.GetItemAttrInfo
WF_ENGINE.GetActivityAttrInfo
WF_ENGINE.GetActivityAttribute (3)
WF_ENGINE.AddItemAttr
WF_ENGINE.GetItemAttrInfo
WF_ENGINE.GetActivityAttrInfo
Workflow Engine APIs to Communicate Attribute Information (continued)
WF_ENGINE.GetActivityAttribute (3) returns the value of an
activity attribute in a process.
WF_ENGINE.AddItemAttr adds an empty item attribute variable
to the runtime process, so that a new item attribute can be defined
at runtime.
WF_ENGINE.GetItemAttrInfo returns information about an item
type attribute, such as its type and format.
WF_ENGINE.GetActivityAttrInfo returns information about an
activity attribute, such as its type and format.
For more information, see the Oracle Workflow Guide (Release 2.5),
chapter 8 for a complete description of all Oracle Workflow APIs.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 16
Workflow Engine APIs
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Engine APIs


Workflow Engine APIs
Use the following APIs to communicate state changes
to the Workflow Engine:
WF_ENGINE.CompleteActivity
WF_ENGINE.BeginActivity
WF_ENGINE.AssignActivity
WF_ENGINE.GetActivityLabel
WF_ENGINE.AbortProcess
WF_ENGINE.SuspendProcess
Use the following APIs to communicate state changes
to the Workflow Engine:
WF_ENGINE.CompleteActivity
WF_ENGINE.BeginActivity
WF_ENGINE.AssignActivity
WF_ENGINE.GetActivityLabel
WF_ENGINE.AbortProcess
WF_ENGINE.SuspendProcess
Workflow Engine APIs to Communicate State Changes
WF_ENGINE.CompleteActivity notifies the engine that the
specified activity has been completed for the item.
WF_ENGINE.BeginActivity determines if the specified activity
can currently be performed and raises an exception if it cannot.
WF_ENGINE.AssignActivity assigns an activity to another
performer.
WF_ENGINE.GetActivityLabel returns the instance label of an
activity, given the internal activity instance identification.
WF_ENGINE.AbortProcess aborts process execution and cancels
outstanding notifications.
WF_ENGINE.SuspendProcess suspends process execution so that
users cannot transition items to new activities.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 17
Workflow Engine APIs
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Engine APIs


Workflow Engine APIs
WF_ENGINE.ResumeProcess
WF_ENGINE.HandleError
WF_ENGINE.ItemStatus
WF_ENGINE.getProcessStatus
WF_ENGINE.ResumeProcess
WF_ENGINE.HandleError
WF_ENGINE.ItemStatus
WF_ENGINE.getProcessStatus
Workflow Engine APIs to Communicate State Changes (continued)
WF_ENGINE.ResumeProcess returns a suspended process to
normal execution status.
WF_ENGINE.HandleError handles any activity that has
encountered an error. This API can also be called for any arbitrary
activity in a process to roll back part of the process to that activity.
WF_ENGINE.ItemStatus returns the status and results for the root
process of the specified item instance.
WF_ENGINE.getProcessStatus returns the process status for the
given item type instance as a two dimensional data object.
For more information, see the Oracle Workflow Guide (Release 2.5),
chapter 8 for a complete description of all Oracle Workflow APIs.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 18
Background Engine
Copyright Oracle Corporation, 2000. All rights reserved.

Background Engine
Background Engine
The Background Engine is a PL/SQL procedure.
The Background Engine checks for and executes
any deferred or timed out activities that satisfy the
arguments of the procedure at the time the
procedure is invoked.
The procedure ends once all matching activities
are executed.
If new activities are deferred or timed out after the
initiation of the current Background Engine
procedure, they will be processed when the next
Background Engine procedure is initiated.
The Background Engine is a PL/SQL procedure.
The Background Engine checks for and executes
any deferred or timed out activities that satisfy the
arguments of the procedure at the time the
procedure is invoked.
The procedure ends once all matching activities
are executed.
If new activities are deferred or timed out after the
initiation of the current Background Engine
procedure, they will be processed when the next
Background Engine procedure is initiated.
Resubmitting the Background Engine
For Oracle Workflow standalone, use one of the sample scripts
provided or create your own custom script to make the background
engine procedure loop indefinitely:
wfbkg.sql: Located in the Oracle Workflow admin/sql
subdirectory
wfbkgchk.sql: Located in the Oracle Workflow admin/sql
subdirectory
For Oracle Workflow embedded in Oracle Applications, use the
Workflow Background Process concurrent program to schedule the
background engine procedure to run repeatedly.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 19
Background Engine
Copyright Oracle Corporation, 2000. All rights reserved.

Background Engine
Background Engine
Background Engine API Background Engine API
WF_ENGINE.BACKGROUND(
itemtype in varchar2,
minthresholdin number default null,
maxthresholdin number default null,
process_deferred in boolean default TRUE,
process_timeout in boolean default TRUE);
Background Engine Parameters
You can set up as many background engines as needed, but if you set up
only one, then that background engine must handle both deferred and timed out
activities. That is, process_deferred and process_timeout must both
be TRUE.
Background Engine Definitions
itemtype: Optional item type to restrict this engine to activities associated
with that item type.
minthreshold: Optional minimum cost that an activity must have for this
background engine to execute it, in hundredths of a second.
maxthreshold: Optional maximum cost an activity can have for this
background engine to execute it, in hundredths of a second.
process_deferred: Set to TRUE to allow the engine to check for deferred
activities. Setting this parameter to FALSE restricts the engine to handling
only activities that have timed out.
process_timeout: Set this parameter to TRUE to allow the engine to check for
timed out activities. Setting the value to FALSE restricts the engine to
handling only deferred activities.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 20
Deferred Processing
Copyright Oracle Corporation, 2000. All rights reserved.

Deferred Processing
Deferred Processing
Set the Workflow Engine threshold cost to control
which activities get deferred.
The default threshold cost of the Workflow Engine
is set to 50.
The Workflow Engine threshold is an externalized
constant.
Add this command to a PL/SQL stored procedure
or execute this command in SQL*PLUS to change
the threshold: WF_ENGINE.THRESHOLD := n;
Set the Workflow Engine threshold cost to control
which activities get deferred.
The default threshold cost of the Workflow Engine
is set to 50.
The Workflow Engine threshold is an externalized
constant.
Add this command to a PL/SQL stored procedure
or execute this command in SQL*PLUS to change
the threshold: WF_ENGINE.THRESHOLD := n;
Note: A function activity is deferred to a background engine for
processing if its cost exceeds the threshold cost of the Workflow Engine.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 21
Timed Out Notification Activities
Copyright Oracle Corporation, 2000. All rights reserved.

Timed Out Notification Activities


Timed Out Notification Activities
Workflow Engine calls on the Notification System
to deliver the notification and marks the activity as
NOTIFIED.
The background Engine configured for timed out
activities checks for Notified activities and
determines whether the Notified activities have
timeout values that have been exceeded.
If the timeout value is exceeded, the Background
Engine marks the activity as timed out and calls
the Workflow Engine to follow the <Timeout>
transition.
Timeouts may be set to an item attribute or to a
relative time in days/hours/minutes
Workflow Engine calls on the Notification System
to deliver the notification and marks the activity as
NOTIFIED.
The background Engine configured for timed out
activities checks for Notified activities and
determines whether the Notified activities have
timeout values that have been exceeded.
If the timeout value is exceeded, the Background
Engine marks the activity as timed out and calls
the Workflow Engine to follow the <Timeout>
transition.
Timeouts may be set to an item attribute or to a
relative time in days/hours/minutes
Dynamic Timeouts
You can fix the due date of an activity at design time or specify it when
you initiate an instance of the process.
If using Item Attribute to set the timeout value then the item attribute must
be set to type number or type date. If number type, the value entered is in
the unit of minutes. If date type, the value entered is a date in format DD-
MON-RR HH24:MI:SS.
Subprocess Timeouts
You can also set a timeout for a subprocess.
Note:
If a timed out activity does not have a <Timeout> transition modeled, the
Workflow Engine will try to find an error process to execute.
The Timeout property has been moved to the Node tab of the Properties
for Oracle Workflow 2.5.
Copyright Oracle Corporation, 2000. All rights reserved.
Overview of the Workflow Engine
Chapter 10 - Page 22
Error Processing
Copyright Oracle Corporation, 2000. All rights reserved.

Error Processing
Error Processing
If an activity error occurs the Workflow Engine:
Rolls back to the pre-activity savepoint.
Sets the activity to the ERROR status.
Attempts to run an Error Process.
If an activity error occurs the Workflow Engine:
Rolls back to the pre-activity savepoint.
Sets the activity to the ERROR status.
Attempts to run an Error Process.
Note: Workflow Engine attempts to locate an error process to run by
starting with the activity which caused the error, and then checking each
parent process activity until an associated error process is located.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 1
Completing Workflow
Notification Activities
Chapter 11
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 2
Completing Workflow Notification Activities
Copyright Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification


Activities
Completing Workflow Notification
Activities
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Respond to notifications from the Notification Web
page
Respond to notifications using email
Access the Oracle Workflow home page
Define notification routing rules
After this lesson, you should be able to:
Respond to notifications from the Notification Web
page
Respond to notifications using email
Access the Oracle Workflow home page
Define notification routing rules
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 4
Oracle Workflow Home Page
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Home Page


Oracle Workflow Home Page
Oracle Workflow Web-Based Features
Use the Oracle Workflow home page to link to all of Oracle Workflows
Web-based features.
The URL is <webagent>/wfa_html.home.
The home page displays your current Worklist of notifications.
Choose the Worklist link to display your list of notifications in the
full browser window. The Worklist allows you to view the
contents of a notification in the Notification Detail Web page.
Choose the Find Notifications link to search for a particular set of
notifications.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 5
Find Notifications Web Page
Copyright Oracle Corporation, 2000. All rights reserved.

Find Notifications Web Page


Find Notifications Web Page
Finding Notifications
Enter criteria to search for a specific set of notifications.
Users who have workflow administrator privileges can search for
notifications that belong to any other user/role by specifying an
internal role name in the User ID field.
Users who do not have workflow administrator privileges can only
search for their own notifications.
Choose Find to display matching notifications in the Notifications
Web page.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 6
Notifications Worklist
Copyright Oracle Corporation, 2000. All rights reserved.

Notifications Worklist
Notifications Worklist
Viewing Notifications from a Web Page
Access the Notifications Worklist using one of the following
methods:
From the Oracle Workflow home page, whose URL is
<webagent>/ wfa_html.home choose the Worklist or Find
Notifications links
Using the URL <webagent>/wfa_html.worklist
From the Oracle Self-Service Web Applications home page
Present a summary of notifications:
Notifications Worklist either displays the notifications that
match your search criteria if you navigated from the Find
Notifications page, or lists all your open notifications if you
navigated directly to this page.
Sort the summary by priority, type, subject, sent date, due
date, or status.
Choose a notification from the list to display the details of the
notification on another page.
You can respond to or reassign a notification. Once you respond to
or reassign a notification, it no longer appears in your Worklist on
return to the Worklist page. If a notification does not require a
response, choose Close to remove it from your Worklist.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 7
Use the Select checkbox to simultaneously close multiple
notifications that dont require a response or use the Select
checkbox to collectively reassign a group of notifications.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 8
Notification Details
Copyright Oracle Corporation, 2000. All rights reserved.

Notification Details
Notification Details
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 9
Reassigning Notifications
Copyright Oracle Corporation, 2000. All rights reserved.

User
List-of-values
Delegate or
Transfer
reassign options
Reassigning Notifications
Reassigning Notifications
Multiple Reassign Modes
Use the following options to reassign notifications:
Delegate: Grant permission to someone else to act on a notification
on your behalf while you remain as the owner and performer of the
activity. This performs the same as the former Reassign command.
Transfer: Transfer responsibility to act on a notification to
someone else and transfer the ownership and performance of the
activity to them.
The following Oracle Workflow areas use these notification reassign values:
The Monitor Diagram web page
The Notifications web page
If you view your notifications in e-mail, you can use only the Forward function
which performs similar to the Delegate option.
The delegate function is WF_NOTIFICATION.Forward and the transfer
function is WF_NOTIFICATION.Transfer.
You can associate a post-notification function with a notification activity. The
Workflow Engine executes the post-notification function in response to an update
of the notification's state after the notification is delivered.
When you specify a post-notification function, the Workflow engine first sets the
context information to be used with the function using the following two global
engine variables:
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 10
WF_ENGINE.context_nid=notification_NID
WF_ENGINE.context_text=new recipient role, if the post-
notification function gets called in FORWARD or TRANSFER
mode. This variable is the new role to which the notification gets
forwarded/transferred.
Note:
WF_ENGINE.context_text=responder, if the post-notification function gets called
in RESPOND mode. The value of responder varies depending on the notification
interface the recipient uses to respond. If the recipient responds using the
Notification web page, responder is set to the role name of the responder. If the
recipient responds using E-mail, responder is set to email:responder email
address.
You may reference these global engine variables in your PL/SQL function.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 11
Launching Oracle Application Forms
Copyright Oracle Corporation, 2000. All rights reserved.

Launching Oracle Application Forms


Launching Oracle Application Forms
Click on form icon to launch
Oracle Applications form
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 12
E-Mail Notification
Copyright Oracle Corporation, 2000. All rights reserved.

E-Mail Notification
E-Mail Notification
<Place screenshot here>
<Place screenshot here> <Place screenshot here>
Automatic
generation
of
response
template
Viewing E-Mail Notifications
You can receive e-mail notifications if your notification preference
is set to Plan text mail, HTML mail, or Plain text mail with
attachments in the User Preferences web page and your workflow
administrator sets up the Notification Mailer to run.
E-Mail notification contains all the details of the notification,
including instructions on how to respond to the notification.
Include the original note with your response to ensure that
the notification identification and notification access key is
within your reply.
Plain text Template Response: use the template of
response prompts provided in the notification and enter
your response values between the double quotes following
each prompt.
Plain text Direct Response: the first lines of your reply are
interpreted as your notification response, where each line
represents a separate response value listed in the same
order as its corresponding response prompt. If a response
value requires more than one line, enclose the entire
response value in double quotes. If a response prompt
provides a default value, then a matching blank line for a
response accepts the default value.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 13
Response values are interpreted literally, where upper case
values are distinct from lower case values.
Turn off automatic e-mail signatures when replying to
notifications.
If your mail applications support HTML attachments you
may respond to a notification using the attached HTML
Notification page.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 14
E-Mail Notification (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

E-Mail Notification (continued)


E-Mail Notification (continued)
Automatic
generation
of
response
template
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 15
E-Mail Summary of Notifications
Copyright Oracle Corporation, 2000. All rights reserved.

E-Mail Summary of Notifications


E-Mail Summary of Notifications
<Place screenshot here>
<Place screenshot here> <Place screenshot here>
Viewing a Summary of Notifications Using E-Mail
Delivers a single e-mail summarizing your current list of open
notifications.
You can receive an e-mail summary of notifications if your
notification preference is set to Plain text summary mail in the
User Preferences web page and your workflow administrator sets
up the Notification Mailer to run.
To respond to individual notifications listed in the summary, you
must use the Notification Details Web page.
How often you receive e-mail summaries depends on how
frequently the Notification Mailer that handles e-mail summaries is
set to run.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 16
Automatic Notification Processing
Copyright Oracle Corporation, 2000. All rights reserved.

Automatic Notification Processing


Automatic Notification Processing
You can automatically forward or respond to
incoming notifications during a planned absence.
You can define automatic notification processing
rules using a set of Web pages.
A rule applies to a message or messages
belonging to a specific role.
A rule can result in one of three actions:
Reassign the notification to another role
Respond to or close the notification
Deliver to the original recipient with no further
action
You can automatically forward or respond to
incoming notifications during a planned absence.
You can define automatic notification processing
rules using a set of Web pages.
A rule applies to a message or messages
belonging to a specific role.
A rule can result in one of three actions:
Reassign the notification to another role
Respond to or close the notification
Deliver to the original recipient with no further
action
Automatic Notification Processing Rules
Oracle Workflow checks each notification against the list of the
intended role of automatic processing rules for the best match
according to the following order of criteria:
ROLE = <role> and:
1. ITEM_TYPE = <type> and MESSAGE_NAME = <name>
2. ITEM_TYPE = <type> and MESSAGE_NAME is null
3. ITEM_TYPE is null and MESSAGE_NAME is null
If a rule reassigns a notification, Oracle Workflow again performs
rule matching against the list of rules of the new recipient role.
A count of the number of times a notification gets
forwarded helps detect perpetual forwarding cycles.
If a notification is automatically forwarded more than ten
times, Oracle Workflow assumes a forwarding cycle has
occurred and ceases all further automatic forwarding and
marks the notification as being in error.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 17
Listing Notification Processing Rules
Copyright Oracle Corporation, 2000. All rights reserved.

Listing Notification Processing Rules


Listing Notification Processing Rules
Defining Automatic Notification Processing Rules
1. Use one of the following URLs to find the automatic notification
processing rules for a role.
<webagent>/wf_route.find
Enter User ID.
Choose Find to display the list of rules.
<webagent>/wf_route.list
<webagent>/wfa_html.home
Choose Notification Rules link.
Enter User ID.
Choose Find to display the list of rules.
2. The Notification Rules page displays the existing rules for the role. The
following information is listed for each rule:
Item Type
Notification name or <ALL>, for all notifications of that item type
Action that the rule takes
Active status
3. Click on the link in the Result of Applying Rule column to edit a rule.
4. Choose X in the Delete Rule column to delete a rule.
5. Choose Create Rule to define a new rule.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 18
Creating a New Notification Processing Rule
Copyright Oracle Corporation, 2000. All rights reserved.

Creating a New Notification Processing


Rule
Creating a New Notification Processing
Rule
Defining the Criteria for an Automatic Notification Processing Rule
1. Specify the item type you want the rule to apply to, then choose Next.
Rules apply to notification messages, and all messages are associated
with a specific item type.
Choose <ALL> if you want the rule to apply to all item types.
2. Specify the name of the notification message you wish to apply the rule to,
then choose Next.
The message is shown by subject name.
Specify <ALL> if you want the rule to apply to all messages.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 19
Creating a New Notification Processing Rule
(continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Creating a New Notification Processing


Rule (continued)
Creating a New Notification Processing
Rule (continued)
Defining an Automatic Notification Processing Rule
1. Specify the period that you want the rule to be active by entering a start
and end date and time.
Use the default date format of your database.
Use the time format HH24:MI:SS.
Blank Start Date means the rule is effective immediately.
Blank End Date means the rule is effective indefinitely.
Note: As you can define multiple rules for the same notifications, make sure
your rules for the same notifications do not overlap in their effective dates.
2. Use the Comments to include in notification field to specify text that
you want to append to the notification in the Prior comments when the rule is
applied.
3. Check the appropriate radio button to assign an action for the rule.
Reassign to: Forward the notification to the role specified. Must also
select either to Delegate Authority for Responding to
Notifications or to Transfer Ownership of Notifications.
Respond: Respond to the message from the set of specified response
values.
Copyright Oracle Corporation, 2000. All rights reserved.
Completing Workflow Notification Activities
Chapter 11 - Page 20
Deliver Notifications to me, regardless of any general rules: Leave the
notification in your inbox and do nothing. Use this action to exclude
a subset of notifications from a more encompassing rule.
4. Click OK to save the rule.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 1
Monitoring Workflow
Processes
Chapter 12
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 2
Monitoring Workflow Processes
Copyright Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Monitoring Workflow Processes
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Check the progress of a workflow using the Java-
based Workflow Monitor
After this lesson, you should be able to:
Check the progress of a workflow using the Java-
based Workflow Monitor
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 4
Workflow Monitor
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Monitor
Workflow Monitor
Workflow Monitor Features
The Workflow Monitor is a Java-based tool that lets you view and
administer the progress of a workflow process instance. The workflow
monitor features include:
A point-and-click interface.
A display for detailed status information for individual activities as
well as for the whole process.
An ability to run in USER mode or ADMIN mode, which provides
additional details and functionality pertinent only to a workflow
administrator.
User Interface Components
User Interface components include:
Process title
Process diagram window
Detail tab window
Administration buttons
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 5
Process Title
Copyright Oracle Corporation, 2000. All rights reserved.

Process Title
Process Title
Process Title Features
The process title displays the process name, followed by the item type and
user key (or item key) that uniquely identifies the process instance. If you
drill down to a subprocess in the process diagram window, the process
title shows the name of the subprocess.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 6
Process Diagram Window
Copyright Oracle Corporation, 2000. All rights reserved.

Process Diagram Window


Process Diagram Window
Process Diagram Window Features
The process diagram window is a noneditable window that displays the
process diagram you created in Oracle Workflow Builder. It provides
visual cues about the status of the process and its activities.
An activity can be highlighted with a colored box to indicate a
distinctive state:
Red: Activity is in an error state.
Green: Activity is active or in progress.
Yellow: Activity is suspended.
A transition arrow can have a thick green line to indicate that it has
been traversed, or it can have a thin black line to indicate that it
hasnt been traversed.
Click on an activity to display information about it in the detail tab
window.
Click on any empty space in the diagram to clear a selected activity
and display information about the process as a whole in the detail
tab window.
Double-click on a subprocess activity to drill down and display the
diagram of the subprocess and its information in the detail tab
window. Or select the subprocess activity, then choose Zoom In.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 7
Detail Tab Window
Copyright Oracle Corporation, 2000. All rights reserved.

Detail Tab Window


Detail Tab Window
Detail Tab Window Features
The detail tab window displays detailed information about the selected
activity or process. Additional information may appear in these tabs if you
are accessing the Workflow Monitor in ADMIN mode. Select from the
following tabs:
Definition: Displays the properties of the activity or process.
Usage: Displays the properties for the activity as a node in the
process.
Status: Displays status and result information about the activity.
Also shows error information if the activity status is ERROR.
Notification: Displays notification details for the selected
notification activity.
Item: Displays item type and item type attribute information.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 8
Administration Buttons
Copyright Oracle Corporation, 2000. All rights reserved.

Administration Buttons
Administration Buttons
Features of the Administration Buttons
The administration buttons appear only when you run the Workflow
Monitor in ADMIN mode. The buttons and their behavior are as follows:
Abort Process: Calls WF_ENGINE.AbortProcess to abort the
selected process and cancel any outstanding notifications. Prompts
for a result to assign to the aborted process.
Suspend Process: Calls WF_ENGINE.SuspendProcess to suspend
the selected process.
Resume Process: Calls WF_ENGINE.ResumeProcess to resume
the selected suspended process to normal execution status.
Reassign: Calls WF_ENGINE.AssignActivity to reassign the
selected notification activity to a different performer. Prompts for a
role name.
Expedite: Calls WF_ENGINE.HandleError to alter the state of an
errored activity, or to undo the selected activity and all other
activities following it to rollback part of the process. Prompts you
to select one of two values:
Skip, to skip the activity and assign it a specified result.
Retry, to reexecute the activity.
Attribute: Lets you change the value of an item attribute.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 9
Application-Controlled Access to the Workflow Monitor
Copyright Oracle Corporation, 2000. All rights reserved.

Application-Controlled Access to the


Workflow Monitor
Application-Controlled Access to the
Workflow Monitor
Calling application may launch a Web browser and
pass a Workflow Monitor URL.
From a form in Oracle Applications, use
FND_UTILITIES.OPEN_URL( ) to launch a
browser and pass a Workflow Monitor URL.
Monitor a Specific Item Type and Key through:
Process Diagram URL
Notifications List URL
Activities List URL
Calling application may launch a Web browser and
pass a Workflow Monitor URL.
From a form in Oracle Applications, use
FND_UTILITIES.OPEN_URL( ) to launch a
browser and pass a Workflow Monitor URL.
Monitor a Specific Item Type and Key through:
Process Diagram URL
Notifications List URL
Activities List URL
Web Browser
The Workflow Monitor requires a Web browser that supports Java 1.1.4
and AWT.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 10
Application-Controlled Access to the Workflow Monitor
(Continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Application-Controlled Access to the


Workflow Monitor (Continued)
Application-Controlled Access to the
Workflow Monitor (Continued)
Call functions to generate Monitor URL strings for:
Process Diagram
WF_MONITOR.GetDiagramURL( )
Notifications List
WF_MONITOR.GetEnvelopeURL( )
Activities List
WF_MONITOR.GetAdvancedEnvelopeURL( )
Calling application must supply the Web agent
string, item type, and item key and specify whether
to run the monitor in ADMIN or USER mode.
Call functions to generate Monitor URL strings for:
Process Diagram
WF_MONITOR.GetDiagramURL( )
Notifications List
WF_MONITOR.GetEnvelopeURL( )
Activities List
WF_MONITOR.GetAdvancedEnvelopeURL( )
Calling application must supply the Web agent
string, item type, and item key and specify whether
to run the monitor in ADMIN or USER mode.
Workflow Web Agent String
Use function wf_core.Translate(WF_WEB_AGENT) to retrieve the
<webagent> string used in creating the Find Processes and Monitor URLs.
Workflow Monitor URLs
The Workflow Monitor Process Diagram URL looks something like:
<webagent>wf_monitor.html?x_item_type=<item_type>
&x_item_key=<item_key>&x_admin_mode=<YES_or_NO>
&x_access_key=<access_key>
The Notifications List and Activities List will look similar.
User Authentication
The Monitor functions for direct access to the Process Diagram,
Notifications List, and Activities List all return a hidden password in the
URL string that provides the user access to the pages in either ADMIN or
USER mode.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 11
Direct Access to the Workflow Monitor
Copyright Oracle Corporation, 2000. All rights reserved.

Direct Access to the Workflow Monitor


Direct Access to the Workflow Monitor
If yes, then you can search for and monitor any
workflow process instance in ADMIN mode.
If no, then you can only search for and monitor
processes in ADMIN mode that you own.
If yes, then you can search for and monitor any
workflow process instance in ADMIN mode.
If no, then you can only search for and monitor
processes in ADMIN mode that you own.
Find Processes Web page is a secured Web page that Find Processes Web page is a secured Web page that
requires user authentication. requires user authentication.
Do you have Workflow Administrator privileges? Do you have Workflow Administrator privileges?
Find Processes Web Page
Use a Web browser that supports Java 1.1.4 and AWT.
Connect to the following URL:
<webagent>/wf_monitor.find_instance
Or, connect to the Oracle Workflow home page and select the Find
Processes link:
<webagent>/wfa_html.home
Workflow Administrator Privileges
Users have workflow administrator privileges if they belong to the Oracle
Workflow administration role, which is defined in the directory service
and the wfcfg.msg file.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 12
Find Processes Web Page
Copyright Oracle Corporation, 2000. All rights reserved.

Find Processes Web Page


Find Processes Web Page
Find Processes Web Page
The Find Process Web page lets you specify search criteria to
locate workflow process instances by:
Process Status
Item Type
Item Key
User Key
Process Name
Process Owner (if you have Workflow Administrator
privileges, otherwise you can only search for process
instances that you own.)
You can also locate workflow process instances with activities
that:
Have any status, are suspended, or in error.
Are waiting for a response from a specified role.
Have no progress in a specified number of days.
Choose Find to locate the process instances that meet your
specified criteria
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 13
Reviewing the Process List
Copyright Oracle Corporation, 2000. All rights reserved.

Reviewing the Process List


Reviewing the Process List
Reviewing the Process List
The Process List provides a summary of all process instances that
match your Find Processes search criteria.
Process instances are listed in ascending order first by item type,
then item key.
The process List summarizes the status of each process instance.
Choose a Process Name link to display the list of notification
activities that have been initiated for that process instance.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 14
Reviewing the Notifications List
Copyright Oracle Corporation, 2000. All rights reserved.

Reviewing the Notifications List


Reviewing the Notifications List
Notifications List
Displays all the current notifications that have been sent that
require a Result response.
Summarizes what each notification activity is, who it is assigned
to, when it was sent, whether it has been completed, how many
days have passed before completion and what the result is.
Note: If the process instance is in an error state and the cause of the error
was from a notification, you can click on the link in the Result column, if
any, to display the cause of the error.
Choose a user link in the Who column to send an email to the user
that a notification has been assigned to.
Choose a notification activity link in the Activity column if you
want to view the full definition of a notification activity.
If a notification is still open and requires a response, an icon will
appear after the notification activity name. You can click on this
icon and you will go to the Notification Details page where you
can respond to the notification if you are logged in as the
notification recipient, or if you are logged in with administrator
privileges.
Choose Advanced Options to go to the Activities List Web page
where you can specify advanced criteria to search and display
specific activities of interest for the process.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 15
Choose View Diagram to display the selected process instance in
the Workflow Monitor for a graphical representation of the process
status. When connected to the current session with Workflow
Administrator privileges, the Monitor displays the process in
ADMIN mode, otherwise it is displayed in USER mode.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 16
Filtering Activities in the Activities List
Copyright Oracle Corporation, 2000. All rights reserved.

Filtering Activities in the Activities List


Filtering Activities in the Activities List
Activities List
The Activities List lets you use different criteria to filter for
specific activities of interest in the current process instance.
Activity Status Options:
Active (includes Notified, Deferred, and Waiting states)
Complete
Error
Suspended
Activity Types:
Response Notifications
FYI Notifications
Functions
Standard Workflow Items
Choose Filter Activities to display the activities that match your
criteria.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 17
Filtering Activities in the Activities List (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Filtering Activities in the Activities List


(continued)
Filtering Activities in the Activities List
(continued)
Activities List (continued)
You can sort the Activities List based on any column by clicking
on the column heading:
An asterisk (*) to the left of the sort column title indicates
an ascending sort order.
An asterisk (*) to the right of the sort column title indicates
a descending sort order.
Choose a user link in the Who column to send an e-mail to the user
to whom a notification has been assigned.
Choose an activity link in the Activity column if you want to view
the full definition of an activity.
If a notification activity is still open and requires a response, an
icon will appear after the notification activity name. You can click
on this icon and you will go to the Notification Details page where
you can respond to the notification if you are logged in as the
notification recipient or if you are logged in with administrator
privileges.
Choose View Diagram to display the selected process instance in
the Workflow Monitor for a graphical representation of the process
status. When connected to the current session with Workflow
Administrator privileges, the Monitor displays the process in
ADMIN mode, otherwise it is displayed in USER mode.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 18
Child/Parent Instances
Copyright Oracle Corporation, 2000. All rights reserved.

Child/Parent Instances
Child/Parent Instances
Link to Parent/Child Instances
If the selected process is a member of a parent/child process, a
parent/child hierarchy list appears on the left-hand side. The hierarchy list
shows links to corresponding parent and child instances of the current
process. The links invoke the Notifications List on the selected parent or
child instance.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 19
Practice Les 12-1 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 12-1 Overview


Practice Les 12-1 Overview
This practice covers the following topics:
Testing PL/SQL functions in a Workflow Process
Responding to Notifications
Monitoring the results of a Work Item
This practice covers the following topics:
Testing PL/SQL functions in a Workflow Process
Responding to Notifications
Monitoring the results of a Work Item
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 20
Practice Les 12-1 Overview Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 12-1 Overview Continued


Practice Les 12-1 Overview Continued
Using the Vacation Proposal process created in
practice Les 9-1:
Initiate a work item
Monitor the status of your work item using the
Monitor Activities List and Diagram
Timeout the Vacation Proposal notification
Exercise the Schedule Update function activity
logic
Exercise Vacation Proposal post-notification
function logic, if implemented
Debug any PL/SQL errors encountered
Using the Vacation Proposal process created in
practice Les 9-1:
Initiate a work item
Monitor the status of your work item using the
Monitor Activities List and Diagram
Timeout the Vacation Proposal notification
Exercise the Schedule Update function activity
logic
Exercise Vacation Proposal post-notification
function logic, if implemented
Debug any PL/SQL errors encountered
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 21
Guided Practice Les 12-1 Initiating a Work Item
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 12-1


Initiating a Work Item
Guided Practice Les 12-1
Initiating a Work Item
1. Connect to the Oracle Workflow home page. Log
on as any user with Administrator privileges.
a. Select the Launch Processes link
b. Select your Item Type link from the list
c. On the Initiate Workflow page enter:
an item key and user key to uniquely
identify your work item
a requestor and approver using the role list-
of-values
a from and to date (DD-MON-RR)
d. Click on OK
1. Connect to the Oracle Workflow home page. Log
on as any user with Administrator privileges.
a. Select the Launch Processes link
b. Select your Item Type link from the list
c. On the Initiate Workflow page enter:
an item key and user key to uniquely
identify your work item
a requestor and approver using the role list-
of-values
a from and to date (DD-MON-RR)
d. Click on OK
Note:
If the Launch Processes menu option does not appear, you are not logged in as a
user with administrator privileges. Close the browser and log in again as a
different user.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 22
Guided Practice Les 12-1: Monitoring the Results
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 12-1:


Monitoring the Results
Guided Practice Les 12-1:
Monitoring the Results
2. Display the Activities List and Diagram for your
work item. Evaluate the current status of your
work item. If an error occurred in your process,
use the Result Exception link in the Activities List
to determine the cause.
2. Display the Activities List and Diagram for your
work item. Evaluate the current status of your
work item. If an error occurred in your process,
use the Result Exception link in the Activities List
to determine the cause.
Note:
After starting a process from the Initiate Workflow web page, control is passed to
the Monitor Activities List web page.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 23
Guided Practice Les 12-1 Timing out Vacation Proposal
notification
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 12-1


Timing out Vacation Proposal notification
Guided Practice Les 12-1
Timing out Vacation Proposal notification
3. To take the <Timeout> transition implemented in
practice Les 9-1:
a. Wait until the Vacation Proposal due date has
expired
b. Run the Background Engine from SQL*PLUS
3. To take the <Timeout> transition implemented in
practice Les 9-1:
a. Wait until the Vacation Proposal due date has
expired
b. Run the Background Engine from SQL*PLUS
EXEC wf_engine.background(<itemtype>);
EXEC wf_engine.background(<itemtype>);
c. Filter process activities in the Monitor
Activities List to verify the Timeout result
c. Filter process activities in the Monitor
Activities List to verify the Timeout result
Note:
The notification due date (including hours, minutes, seconds) is found on the
Notification Details web page in the notification header region.
From the Activities List, you can open the Notification Details for your Vacation
Proposal notification by selecting the response notification icon next to the
Vacation Proposal notification activity link.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 24
Guided Practice Les 12-1 Testing Schedule Vacation
Function
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 12-1


Testing Schedule Vacation Function
Guided Practice Les 12-1
Testing Schedule Vacation Function
4. To test your RUN mode Schedule Vacation logic:
a. Accept the Vacation Proposal
b. Display the Activities List and Diagram for
your work item. Evaluate the current status of
your work item. If an error occurred in your
Schedule Vacation function, use the Result
Exception link in the Activities List to
determine the cause.
c. Query and verify the contents of your Vacation
Schedule table:
4. To test your RUN mode Schedule Vacation logic:
a. Accept the Vacation Proposal
b. Display the Activities List and Diagram for
your work item. Evaluate the current status of
your work item. If an error occurred in your
Schedule Vacation function, use the Result
Exception link in the Activities List to
determine the cause.
c. Query and verify the contents of your Vacation
Schedule table:
Select * from
WFVACXX_Vacation_Schedule;
Select * from
WFVACXX_Vacation_Schedule;
Note:
Your Vacation Schedule table and WFVACXX package must be successfully
loaded into the workflow account of your test database.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 25
Guided Practice Les 12-1 Testing Schedule Vacation
Function Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 12-1


Testing Schedule Vacation Function
Continued
Guided Practice Les 12-1
Testing Schedule Vacation Function
Continued
5. To test your CANCEL mode Schedule Vacation
logic:
a. Display your completed work item in the
Monitor Diagram. Rewind your work item to
the Start node using the Diagram Expedite
feature.
select the Start node and click on the
Expedite button
select Retry and click on the OK button
b. Query and verify the contents of your Vacation
Schedule table. The Schedule Vacation
function should have removed the appropriate
vacation schedule row.
5. To test your CANCEL mode Schedule Vacation
logic:
a. Display your completed work item in the
Monitor Diagram. Rewind your work item to
the Start node using the Diagram Expedite
feature.
select the Start node and click on the
Expedite button
select Retry and click on the OK button
b. Query and verify the contents of your Vacation
Schedule table. The Schedule Vacation
function should have removed the appropriate
vacation schedule row.
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 26
Guided Practice Les 12-1 Testing Post-Notification
Function
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 12-1


Testing Post-Notification Function
Guided Practice Les 12-1
Testing Post-Notification Function
6. To exercise your post-notification function logic:
a. Reassign the Vacation Proposal to a new role
Transfer should raise an exception
Delegate should be successful
b. Reject the Vacation Proposal without entering
alternate vacation dates
any missing dates on reject should raise an
exception
c. Reject the Vacation Proposal with an alternate
from date prior to the alternate to date
invalid date ranges should raise an
exception
6. To exercise your post-notification function logic:
a. Reassign the Vacation Proposal to a new role
Transfer should raise an exception
Delegate should be successful
b. Reject the Vacation Proposal without entering
alternate vacation dates
any missing dates on reject should raise an
exception
c. Reject the Vacation Proposal with an alternate
from date prior to the alternate to date
invalid date ranges should raise an
exception
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 27
Guided Practice Les 12-1 Testing Post-Notification
Function Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 12-1


Testing Post-Notification Function
Continued
Guided Practice Les 12-1
Testing Post-Notification Function
Continued
d. Reject the Vacation Proposal, including valid
alternate dates and comment
response should be successful
e. Accept the Vacation Proposal
response should be successful
d. Reject the Vacation Proposal, including valid
alternate dates and comment
response should be successful
e. Accept the Vacation Proposal
response should be successful
Copyright Oracle Corporation, 2000. All rights reserved.
Monitoring Workflow Processes
Chapter 12 - Page 28
Les 12-1 Summary
Copyright Oracle Corporation, 2000. All rights reserved.

Les 12-1 Summary


Les 12-1 Summary
In this practice, you should have learned how to:
Implement and test a notification activity Timeout
Implement and test function activity logic
Implement and test post-notification function
response logic
In this practice, you should have learned how to:
Implement and test a notification activity Timeout
Implement and test function activity logic
Implement and test post-notification function
response logic
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 1
PL/SQL Documents
Chapter 13
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 2
PL/SQL Documents
Copyright Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
PL/SQL Documents
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Integrate PL/SQL documents into a Workflow
process
Define a procedure to generate a PL/SQL
document
Attach PL/SQL documents
After this lesson, you should be able to:
Integrate PL/SQL documents into a Workflow
process
Define a procedure to generate a PL/SQL
document
Attach PL/SQL documents
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 4
Integrating PL/SQL Documents in Workflow Processes
Copyright Oracle Corporation, 2000. All rights reserved.

Integrating PL/SQL Documents in


Workflow Processes
Integrating PL/SQL Documents in
Workflow Processes
Use a PL/SQL document when the format or
content of the document may vary.
You integrate a PL/SQL document into a workflow
process by defining an attribute of type document
for an item type or message.
The document-type attribute value tells Oracle
Workflow how to construct the dynamic call to a
PL/SQL procedure which generates the document.
You embed a PL/SQL document-type message
attribute in a message body to display the
document in a notification.
Use a PL/SQL document when the format or
content of the document may vary.
You integrate a PL/SQL document into a workflow
process by defining an attribute of type document
for an item type or message.
The document-type attribute value tells Oracle
Workflow how to construct the dynamic call to a
PL/SQL procedure which generates the document.
You embed a PL/SQL document-type message
attribute in a message body to display the
document in a notification.
Setting the Document Attribute Value
A PL/SQL document-type attribute should take a value of the form:
PLSQL:<procedure>/<document_identifier>
<procedure> should be replaced with the PL/SQL package and procedure name
in the form package.procedure.
<document_identifier> should be replaced with the PL/SQL argument string that
you want to pass directly to the procedure. The argument string should identify
the document e.g. plsql:po_wf.show_req/2034.
If you wish to generate the PL/SQL argument string dynamically , create another
item attribute and specify &item_attribute in place of the PL/SQL argument
string. Before any activity that references this other item attribute gets executed,
call the WF_ENGINE.SetItemAttribute API to dynamically set the Pl/SQL
argument string value e.g. plsql:po_wf.show_req/&POREQ_NUMBER.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 5
Defining Procedures to Generate a PL/SQL Document
Copyright Oracle Corporation, 2000. All rights reserved.

Defining Procedures to Generate a


PL/SQL Document
Defining Procedures to Generate a
PL/SQL Document
procedure <procedure name>
(document_id in varchar2,
display_type in varchar2,
document in out varchar2,
document_type in out varchar2)
procedure <procedure name>
(document_id in varchar2,
display_type in varchar2,
document in out varchar2,
document_type in out varchar2)
Standard API for a PL/SQL Document
The procedure for generating a PL/SQL document must follow a standard API
format. The aspects of the procedure are as follows:
document_id: A string that uniquely identifies a document. Equivalent to the
document identifier string you specify in the document-type attribute value
(PLSQL:<procedure>/<document_identifier>).
display_type: Represents how the document is displayed in the notification (also
referred to as the content type or requested type):
text/plain: Document is embedded inside plain text representation of
notification as viewed from an e-mail message. Entire mail message must
be less than or equal to 32K.
text/html: Document is embedded inside HTML representation of notification
as viewed from the Notification Web page or the HTML attachment to an
e-mail message. Entire HTML representation of document must be less
than or equal to 32K and should not include top level HTML tags like
<HTML> or <BODY> as the HTML page that the document is being
inserted into already contains these tags. If the tags are included, Oracle
Workflow removes them for you when the document attribute is
referenced in a message body. The procedure can alternatively generate a
plain text document as the notification system can automatically surround
plain text with the appropriate HTML tags to preserve formatting.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 6
: The document is presented as a separate attachment to the notification.
Any content type may be returned.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 7
Defining Procedures to Generate a PL/SQL Document
(continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Defining Procedures to Generate a


PL/SQL Document (continued)
Defining Procedures to Generate a
PL/SQL Document (continued)
procedure <procedure name>
(document_id in varchar2,
display_type in varchar2,
document in out varchar2,
document_type in out varchar2)
procedure <procedure name>
(document_id in varchar2,
display_type in varchar2,
document in out varchar2,
document_type in out varchar2)
Standard API for a PL/SQL Document (continued)
document: Outbound text buffer where up to 32K of document text is returned.
document_type: Outbound text buffer where the document content type is
returned. Also referred to as the returned type. If no type is supplied, then
text/plain is assumed.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 8
PL/SQL Document Attachments
Copyright Oracle Corporation, 2000. All rights reserved.

PL/SQL Document Attachments


PL/SQL Document Attachments
Attach Document
Content to
Notification Message
Attach PL/SQL Document
When defining a message attribute in the Oracle Workflow Builder, if your
message attribute is a Send attribute and is of type Document, you can check
Attach Content to attach the content of the attribute to the notification message.
When you view your notification from the Notification Details web page, you see
a document icon following the notification message body that displays the
contents of the attached message attribute when you click on it. If you view your
notification from E-mail, the presentation of the attachment will vary depending
on what your E-mail notification preference setting is.
Note: You can attach, as well as embed (by token substitution) PL/SQL
Document attributes in the notification message and are not limited to one or the
other.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 9
Practice Les 13-1 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 13-1 Overview


Practice Les 13-1 Overview
This practice covers the following topics:
Creating a PL/SQL Document procedure
for the vacation proposal requestor,
report the scheduled vacation as stored in
your WFVACXX_Vacation_Schedule table
Using a PL/SQL Document attribute in a message
create an attribute, message, and notification
to send the scheduled vacation report to the
requestor when the vacation proposal is
approved
Setting the value of a PL/SQL Document attribute
Testing a PL/SQL Document
This practice covers the following topics:
Creating a PL/SQL Document procedure
for the vacation proposal requestor,
report the scheduled vacation as stored in
your WFVACXX_Vacation_Schedule table
Using a PL/SQL Document attribute in a message
create an attribute, message, and notification
to send the scheduled vacation report to the
requestor when the vacation proposal is
approved
Setting the value of a PL/SQL Document attribute
Testing a PL/SQL Document
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 10
Guided Practice Les 13-1 Creating a PL/SQL
Document Procedure
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-1


Creating a PL/SQL Document Procedure
Guided Practice Les 13-1
Creating a PL/SQL Document Procedure
1. Use the standard PL/SQL Document API format for
your PL/SQL specification and body.
1. Use the standard PL/SQL Document API format for
your PL/SQL specification and body.
procedure <procedure name>
(document_id in varchar2,
display_type in varchar2,
document in out varchar2,
document_type in out varchar2)
procedure <procedure name>
(document_id in varchar2,
display_type in varchar2,
document in out varchar2,
document_type in out varchar2)
a. Add to your package WFVACXX created in
practice Les 8-1.
b. Give your procedure a descriptive name, such
as VACATION_SCHEDULED.
a. Add to your package WFVACXX created in
practice Les 8-1.
b. Give your procedure a descriptive name, such
as VACATION_SCHEDULED.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 11
Guided Practice Les 13-1 Creating a PL/SQL
Document Procedure
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-1


Creating a PL/SQL Document Procedure
Guided Practice Les 13-1
Creating a PL/SQL Document Procedure
c. Code requestor username as the value of the
document_id to create a document displaying
the vacation scheduled for the current
requestor.
d. Create a cursor to select all vacation schedule
rows for the requestor.
c. Code requestor username as the value of the
document_id to create a document displaying
the vacation scheduled for the current
requestor.
d. Create a cursor to select all vacation schedule
rows for the requestor.
Cursor vacation_schedule
(xrequestor in varchar2) is
Select approver_username,from_date, to_date
from WFVACXX_Vacation_Schedule
where requestor_username = xrequestor
order by from_date, to_date;
Cursor vacation_schedule
(xrequestor in varchar2) is
Select approver_username,from_date, to_date
from WFVACXX_Vacation_Schedule
where requestor_username = xrequestor
order by from_date, to_date;
Note:
Include SQL date formatting on the from_date and to_date to improve the
appearance of the date fields in your document.
Use Workflow API WF_Directory.GetRoleDisplayName to display the approver
display name instead of the approver username in your document.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 12
Guided Practice Les 13-1 Creating a PL/SQL
Document Procedure
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-1


Creating a PL/SQL Document Procedure
Guided Practice Les 13-1
Creating a PL/SQL Document Procedure
e. Build a document text buffer. You can choose
to create a document specific to the
display_type (text/html, text/plain, or null) or
choose to always create an html or plain text
document.
f. Set the document_type based on the document
you created, text/html or text/plain.
e. Build a document text buffer. You can choose
to create a document specific to the
display_type (text/html, text/plain, or null) or
choose to always create an html or plain text
document.
f. Set the document_type based on the document
you created, text/html or text/plain.
Display Type
text/html: the document is embedded in an HTML version of the notification
viewed from the Notification Details web page, or an HTML attachment to an
email message.
Do not include top level HTML tags like <HTML> or <BODY>.
text/plain: the document is embedded in a plain text version of the notification as
viewed in an email message.
or null: the document is presented as a separate attachment to the notification;
any content type can be returned.
Sample Solutions
Refer to PL/SQL package specification and body definition files wfvacxxs.sql and
wfvacxxb.sql for sample solution.
The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample procedures
used throughout the lesson practices. The procedure specific to Practice 13-1 is
WFVACXX.VACATION_SCHEDULED.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 13
Guided Practice Les 13-1 Using a PL/SQL Document
Attribute
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-1


Using a PL/SQL Document Attribute
Guided Practice Les 13-1
Using a PL/SQL Document Attribute
2. In the Workflow Builder Navigator open your
WFVACXX item type:
a. Create an item attribute of type Document with
descriptive internal and display names.
For example, VACATION_SCHEDULE_DOC and
Vacation Schedule Document, respectively.
b. Create a Vacation Schedule message.
To embed the Document contents in the message,
include a token &<VACATION_SCHEDULE_DOC>
in the text and/or HTML message bodies.
c. Drag and drop the Document item attribute,
(along with any other attributes you need) to your
Vacation Schedule message.
2. In the Workflow Builder Navigator open your
WFVACXX item type:
a. Create an item attribute of type Document with
descriptive internal and display names.
For example, VACATION_SCHEDULE_DOC and
Vacation Schedule Document, respectively.
b. Create a Vacation Schedule message.
To embed the Document contents in the message,
include a token &<VACATION_SCHEDULE_DOC>
in the text and/or HTML message bodies.
c. Drag and drop the Document item attribute,
(along with any other attributes you need) to your
Vacation Schedule message.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 14
Guided Practice Les 13-1 Using a PL/SQL Document
Attribute
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-1


Using a PL/SQL Document Attribute
Guided Practice Les 13-1
Using a PL/SQL Document Attribute
d. To attach the content of the PL/SQL Document
to a message, open your Document message
attribute Properties, select a Frame Target and
check the Attach Content checkbox.
e. Create a Notification activity that sends the
Vacation Schedule message.
f. Drag and drop the Notification activity from the
Builder Navigator to the Vacation Proposal
process diagram. Replace the transition from
Update Vacation Schedule to End (Approve) with
transitions from Update Vacation Schedule to the
Vacation Schedule notification, and Vacation
Schedule notification to End (Approve).
d. To attach the content of the PL/SQL Document
to a message, open your Document message
attribute Properties, select a Frame Target and
check the Attach Content checkbox.
e. Create a Notification activity that sends the
Vacation Schedule message.
f. Drag and drop the Notification activity from the
Builder Navigator to the Vacation Proposal
process diagram. Replace the transition from
Update Vacation Schedule to End (Approve) with
transitions from Update Vacation Schedule to the
Vacation Schedule notification, and Vacation
Schedule notification to End (Approve).
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 15
Guided Practice Les 13-1 Using a PL/SQL Document
Attribute
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-1


Using a PL/SQL Document Attribute
Guided Practice Les 13-1
Using a PL/SQL Document Attribute
g. Assign item attribute Requestor as the
performer on the Vacation Schedule notification
node.
g. Assign item attribute Requestor as the
performer on the Vacation Schedule notification
node.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 16
Guided Practice Les 13-1 Setting a Document Attribute
Value
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-1


Setting a Document Attribute Value
Guided Practice Les 13-1
Setting a Document Attribute Value
3. The Document attribute value should be set to:
PLSQL:<package.procedure>/<Document ID>
For example,
PLSQL:WFVACXX.VACATION_SCHEDULED/&REQUESTOR
In the message attribute Properties set the value
of your Document message attribute:
a. To a corresponding Document item attribute.
Set the item attribute value as a Constant in the
item attribute Properties Default Value or at
runtime in the Initiate Workflow web page.
b. To a Constant value.
3. The Document attribute value should be set to:
PLSQL:<package.procedure>/<Document ID>
For example,
PLSQL:WFVACXX.VACATION_SCHEDULED/&REQUESTOR
In the message attribute Properties set the value
of your Document message attribute:
a. To a corresponding Document item attribute.
Set the item attribute value as a Constant in the
item attribute Properties Default Value or at
runtime in the Initiate Workflow web page.
b. To a Constant value.
Note:
You can also set the value of the Document item attribute in a PL/SQL procedure.
The PL/SQL procedure can be executed by a function activity as part of the
workflow process itself or it can be a PL/SQL procedure that issues Workflow
API calls to:
create the process
set item attribute values to support the process
start the process.
Token Replacement
The &REQUESTOR portion of sample value
PLSQL:WFVACXX.VACATION_SCHEDULED/&REQUESTOR specifies
that item attribute REQUESTOR will be token replaced with the runtime value
of this item attribute.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 17
Guided Practice Les 13-1 Testing a PL/SQL Document
(HTML)
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-1


Testing a PL/SQL Document (HTML)
Guided Practice Les 13-1
Testing a PL/SQL Document (HTML)
4. A PL/SQL Document is generated with display type
of text/html when the message is viewed through
the Notification Details web page.
a. Launch a Vacation Proposal work item and
approve the proposal.
b. Open the Vacation Schedule notification from
the Worklist and review your document.
c. Correct any formatting or processing errors
needed in your PL/SQL procedure. Use the
browser Reload option to display the updated
version of the Vacation Schedule notification
details.
4. A PL/SQL Document is generated with display type
of text/html when the message is viewed through
the Notification Details web page.
a. Launch a Vacation Proposal work item and
approve the proposal.
b. Open the Vacation Schedule notification from
the Worklist and review your document.
c. Correct any formatting or processing errors
needed in your PL/SQL procedure. Use the
browser Reload option to display the updated
version of the Vacation Schedule notification
details.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 18
Les 13-1 Summary
Copyright Oracle Corporation, 2000. All rights reserved.

Les 13-1 Summary


Les 13-1 Summary
In this practice, you should have learned how to:
Write a PL/SQL procedure to create a document
based on application data
Embed a PL/SQL Document in a message
Attach a PL/SQL Document to a message
Set the value of a PL/SQL Document attribute
In this practice, you should have learned how to:
Write a PL/SQL procedure to create a document
based on application data
Embed a PL/SQL Document in a message
Attach a PL/SQL Document to a message
Set the value of a PL/SQL Document attribute
Sample Solutions
Refer to PL/SQL package specification and body definition files wfvacxxs.sql and
wfvacxxb.sql and workflow definition file wfvacxx_131.wft for sample solutions.
The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample procedures
used throughout the lesson practices. The procedure specific to Practice 13-1 is
WFVACXX.VACATION_SCHEDULED.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 19
Practice Les 13-2 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 13-2 Overview


Practice Les 13-2 Overview
This practice covers the following topics:
Creating a function activity with a result type
write a supporting PL/SQL procedure to check
for Requestor equal to Approver
return result of Y or N
Branching on a function activity result
if function returns Yes, reject proposal
if function returns No, continue process
This practice covers the following topics:
Creating a function activity with a result type
write a supporting PL/SQL procedure to check
for Requestor equal to Approver
return result of Y or N
Branching on a function activity result
if function returns Yes, reject proposal
if function returns No, continue process
Note:
Return lookup codes Y and N defined in Standard lookup type Yes/No as the
possible results returned by your PL/SQL procedure.
Assign Result Type Yes/No to the function activity that executes your PL/SQL
procedure. Branch on the lookup display names Yes and No.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 20
Guided Practice Les 13-2 Creating a PL/SQL
Procedure with Result
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-2


Creating a PL/SQL Procedure with Result
Guided Practice Les 13-2
Creating a PL/SQL Procedure with Result
1. Use the standard API format for your PL/SQL
specification and body.
1. Use the standard API format for your PL/SQL
specification and body.
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2)
a. Add to your package WFVACXX created in
practice Les 8-1.
b. Give your procedure a descriptive name, such
as CHECK_APPROVER.
a. Add to your package WFVACXX created in
practice Les 8-1.
b. Give your procedure a descriptive name, such
as CHECK_APPROVER.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 21
Guided Practice Les 13-2 RUN processing
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-2


RUN processing
Guided Practice Les 13-2
RUN processing
c. In your PL/SQL procedure include logic for
RUN funcmode:
retrieve the values for requestor and
approver using API calls to
wf_engine.GetItemAttrText
if requestor <> approver set resultout to
wf_engine.eng_completed||:||N
if requestor = approver set resultout to
wf_engine.eng_completed||:||Y
c. In your PL/SQL procedure include logic for
RUN funcmode:
retrieve the values for requestor and
approver using API calls to
wf_engine.GetItemAttrText
if requestor <> approver set resultout to
wf_engine.eng_completed||:||N
if requestor = approver set resultout to
wf_engine.eng_completed||:||Y
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 22
Guided Practice Les 13-2 CANCEL processing
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-2


CANCEL processing
Guided Practice Les 13-2
CANCEL processing
d. Specific logic is not necessary for CANCEL
funcmode, set resultout to
wf_engine.eng_completed||:||
wf_engine.eng_null
d. Specific logic is not necessary for CANCEL
funcmode, set resultout to
wf_engine.eng_completed||:||
wf_engine.eng_null
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 23
Guided Practice Les 13-2 Adding a Function Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-2


Adding a Function Activity
Guided Practice Les 13-2
Adding a Function Activity
2. In the Workflow Builder Vacation Proposal process
diagram:
a. Delete the transition between the Start and
Vacation Proposal notification nodes.
b. Click on the New Function icon, position the
cross-hairs between the Start and Vacation
Proposal notification nodes, and click again to
open the properties.
c. Enter unique Internal and Display Names (such
as CHECK_APPROVER and Approver same as
Requestor?), select an icon , and enter a
Function Name using format
<package.procedure> for the PL/SQL
procedure you just created.
2. In the Workflow Builder Vacation Proposal process
diagram:
a. Delete the transition between the Start and
Vacation Proposal notification nodes.
b. Click on the New Function icon, position the
cross-hairs between the Start and Vacation
Proposal notification nodes, and click again to
open the properties.
c. Enter unique Internal and Display Names (such
as CHECK_APPROVER and Approver same as
Requestor?), select an icon , and enter a
Function Name using format
<package.procedure> for the PL/SQL
procedure you just created.
Function Activity Internal Name
As a workflow development standard, use the procedure name as the
corresponding function activity internal name wherever possible.
Function Value
<package.procedure> value should look like WFVACXX.CHECK_APPROVER,
where XX is the unique number assigned to your work station.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 24
Guided Practice Les 13-2 Adding a Function Activity
Continued
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 13-2


Adding a Function Activity Continued
Guided Practice Les 13-2
Adding a Function Activity Continued
d. Draw a transition from Start to Approver same
as Requestor? node.
e. Draw a transition from Approver same as
Requestor? to Vacation Proposal notification
node, select No from Results menu.
f. Drag and drop an additional End node from the
Standard item type into your diagram. On the
Node properties tab, set the Result to Reject.
g. Draw a transition from Approver same as
Requestor? to new End (Reject) node, select
Yes or <Default> from Results menu.
d. Draw a transition from Start to Approver same
as Requestor? node.
e. Draw a transition from Approver same as
Requestor? to Vacation Proposal notification
node, select No from Results menu.
f. Drag and drop an additional End node from the
Standard item type into your diagram. On the
Node properties tab, set the Result to Reject.
g. Draw a transition from Approver same as
Requestor? to new End (Reject) node, select
Yes or <Default> from Results menu.
Additional End (Reject) Node
Use more than one End node to simplify your diagram and to uniquely identify
which End activity is executed when more than one path through the process can
terminate with the same result. Set each End node label to a descriptive value.
For example, the Vacation Proposal process can now end with a result of Reject
for two unique reasons:
1. A Vacation Proposal is submitted with the approver equal to the requestor.
2. A Vacation Proposal is rejected by the approver.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 25
Les 13-2 Summary
Copyright Oracle Corporation, 2000. All rights reserved.

Les 13-2 Summary


Les 13-2 Summary
In this practice, you should have learned how to:
Write a PL/SQL procedure that returns a result
Draw a diagram that branches on a result from a
function activity
In this practice, you should have learned how to:
Write a PL/SQL procedure that returns a result
Draw a diagram that branches on a result from a
function activity
Sample Solutions
Refer to PL/SQL package specification and body definition files wfvacxxs.sql and
wfvacxxb.sql and workflow definition file wfvacxx_132.wft for sample solutions.
The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample procedures
used throughout the lesson practices. The procedure specific to Practice 13-2 is
WFVACXX.CHECK_APPROVER.
Copyright Oracle Corporation, 2000. All rights reserved.
PL/SQL Documents
Chapter 13 - Page 26
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 1
Selector Functions
Chapter 14
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 2
Selector Functions
Copyright Oracle Corporation, 2000. All rights reserved.

Selector Functions
Selector Functions
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson you should be able to:
Create a standard API for a selector/callback
function
Define a selector/callback function
Call a selector/callback function
After this lesson you should be able to:
Create a standard API for a selector/callback
function
Define a selector/callback function
Call a selector/callback function
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 4
Item Type Selector Function
Copyright Oracle Corporation, 2000. All rights reserved.

Item Type Selector Function


Item Type Selector Function
An item type can have more than one runnable
process activity associated with it.
PL/SQL selector functions are defined to
determine which process activity to run in a
particular situation.
Selector functions can be extended to be a general
callback function so that item type context
information can be reset as needed if the SQL
session is interrupted.
Associate a Selector Function with an Item Type
through the item type properties.
An item type can have more than one runnable
process activity associated with it.
PL/SQL selector functions are defined to
determine which process activity to run in a
particular situation.
Selector functions can be extended to be a general
callback function so that item type context
information can be reset as needed if the SQL
session is interrupted.
Associate a Selector Function with an Item Type
through the item type properties.
Item Type Selector Function
For example, if an item type had two different requisition approval process
activities, then the process executed by Oracle Workflow may be dependent on
where the requisition originates. A selector function would determine which
process would be appropriate in any given situation.
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 5
Standard API for the Selector/Callback Function
Copyright Oracle Corporation, 2000. All rights reserved.

Standard API for the Selector/Callback


Function
Standard API for the Selector/Callback
Function
You can define one PL/SQL procedure that
includes both selector and callback
functionality by following a standard API.
You can define one PL/SQL procedure that
includes both selector and callback
functionality by following a standard API.
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout out varchar2)
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout out varchar2)
Standard API for Selector/Callback Function
procedure <procedure name>(
itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout out varchar2) is
<local declarations>
begin
if (command = RUN) then
<your RUN executable statements>
resultout:=<Name of process to run>;
return;
endif;
if (command = SET_CTX) then
<your executable statements for establishing context
information>
resultout:= ;
return;
endif;
...
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 6
Standard API for the Selector/Callback Function
(continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Standard API for the Selector/Callback


Function (continued)
Standard API for the Selector/Callback
Function (continued)
You can define one PL/SQL procedure that
includes both selector and callback
functionality by following a standard API.
You can define one PL/SQL procedure that
includes both selector and callback
functionality by following a standard API.
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout out varchar2)
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout out varchar2)
Standard API for Selector/Callback Function (continued)
if (command = TEST_CTX) then
<your executable statements for testing validity of current
context information>
resultout:=<TRUE or FALSE>;
return;
endif;
if (command = <other commands>) then
resultout:= ;
return;
endif;
exception
when others then
WF_CORE.CONTEXT (<package name>,
<procedure name>, <itemtype>, <itemkey>,
to_char(<actid>), <command>);
raise;
end <procedure name>;
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 7
Defining a Selector/Callback Function
Copyright Oracle Corporation, 2000. All rights reserved.

Defining a Selector/Callback Function


Defining a Selector/Callback Function
itemtypethe internal name for the item type.
Defined in the Oracle Workflow Builder.
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.
actidthe ID number of the activity that this
procedure is called from. This parameter is always
null if the procedure is called with the RUN
command to execute the selector function.
itemtypethe internal name for the item type.
Defined in the Oracle Workflow Builder.
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.
actidthe ID number of the activity that this
procedure is called from. This parameter is always
null if the procedure is called with the RUN
command to execute the selector function.
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 8
Defining a Selector/Callback Function (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Defining a Selector/Callback Function


(continued)
Defining a Selector/Callback Function
(continued)
commanddetermines how to execute the
selector/callback function.
resultouta result may be returned depending on
the command used to call the selector/callback
function
commanddetermines how to execute the
selector/callback function.
resultouta result may be returned depending on
the command used to call the selector/callback
function
Return Values from Commands
If the function is called with RUN, the name of the process to run must
be returned through the resultout parameter.
If the function is called with SET_CTX, then no return value is
expected.
If the function is called with TEST_CTX, then the code must return
TRUE if the context is correct or FALSE if the context is incorrect.
If any other value is returned, Oracle Workflow assumes the command is
not implemented by the callback.
Note: Other commands may be added in the future.
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 9
Calling a Selector/Callback Function
Copyright Oracle Corporation, 2000. All rights reserved.

Calling a Selector/Callback Function


Calling a Selector/Callback Function
RUNto select the appropriate process to start
when either of the following conditions occur:
A process is not explicitly passed to
WF_ENGINE.CreateProcess.
A process is implicitly started by
WF_ENGINE.CompleteActivity with no prior
call to WF_ENGINE.CreateProcess.
SET_CTXto establish any context information
that a function activity in an item type needs to
execute, before a new database session begins.
TEST_CTXto determine if the current item type
context is correct before executing a function.
RUNto select the appropriate process to start
when either of the following conditions occur:
A process is not explicitly passed to
WF_ENGINE.CreateProcess.
A process is implicitly started by
WF_ENGINE.CompleteActivity with no prior
call to WF_ENGINE.CreateProcess.
SET_CTXto establish any context information
that a function activity in an item type needs to
execute, before a new database session begins.
TEST_CTXto determine if the current item type
context is correct before executing a function.
Oracle Workflow can call the selector/callback function Oracle Workflow can call the selector/callback function
with the following commands: with the following commands:
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 10
Practice Les 14-1 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Practice Les 14-1 Overview


Practice Les 14-1 Overview
This practice covers the following topics:
Creating additional processes in the WFVACXX
item type
duplicate the Vacation Proposal process, but
implement an alternate Vacation Proposal
notification Timeout
Assigning a Selector function to an Item Type
Creating a Selector function to choose which
process to run based on the item key value
Testing a Selector function
This practice covers the following topics:
Creating additional processes in the WFVACXX
item type
duplicate the Vacation Proposal process, but
implement an alternate Vacation Proposal
notification Timeout
Assigning a Selector function to an Item Type
Creating a Selector function to choose which
process to run based on the item key value
Testing a Selector function
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 11
Guided Practice Les 14-1 Duplicating a Process
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 14-1


Duplicating a Process
Guided Practice Les 14-1
Duplicating a Process
1. In the Workflow Builder Navigator open and expand
the <WFVACXX> item type:
a. Drag and drop the Vacation Proposal process
onto the WFVACXX item type to create a copy.
When the process properties window opens, enter
new internal and display names for the duplicate
process. For example,
WFVACXX_PROCESS_ALTERNATE and Alternate
Vacation Proposal.
b. Open the Alternate Vacation Proposal process
diagram. Replace the Vacation Proposal
notification <Timeout> to a Loop Counter with a
<Timeout> transition back to the Vacation
Proposal notification.
1. In the Workflow Builder Navigator open and expand
the <WFVACXX> item type:
a. Drag and drop the Vacation Proposal process
onto the WFVACXX item type to create a copy.
When the process properties window opens, enter
new internal and display names for the duplicate
process. For example,
WFVACXX_PROCESS_ALTERNATE and Alternate
Vacation Proposal.
b. Open the Alternate Vacation Proposal process
diagram. Replace the Vacation Proposal
notification <Timeout> to a Loop Counter with a
<Timeout> transition back to the Vacation
Proposal notification.
To Create a Self <Timeout> Loop
To create a <Timeout> transition from the Vacation Proposal notification node
back to itself, select the Vacation Proposal notification node and, holding down
your right mouse button, drag your mouse away from the node and back again.
Release your right mouse button. Select <Timeout> from the Results menu.
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 12
Guided Practice Les 14-1 Assigning a Selector
Function
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 14-1


Assigning a Selector Function
Guided Practice Les 14-1
Assigning a Selector Function
2. In the Workflow Builder Navigator open the
properties for the <WFVACXX> item type and enter
a <package.procedure> value in the Selector field.
For example, WFVACXX.SELECTOR.
2. In the Workflow Builder Navigator open the
properties for the <WFVACXX> item type and enter
a <package.procedure> value in the Selector field.
For example, WFVACXX.SELECTOR.
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 13
Guided Practice Les 14-1 Creating a Selector
Procedure
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 14-1


Creating a Selector Procedure
Guided Practice Les 14-1
Creating a Selector Procedure
3. Use the standard API format for your PL/SQL
specification and body.
3. Use the standard API format for your PL/SQL
specification and body.
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout in out varchar2)
procedure <procedure name>
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout in out varchar2)
a. Add to your package WFVACXX created in
practice Les 8-1.
b. Give your procedure the same name assigned
as the item type Selector <procedure> value.
a. Add to your package WFVACXX created in
practice Les 8-1.
b. Give your procedure the same name assigned
as the item type Selector <procedure> value.
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 14
Guided Practice Les 14-1 RUN processing
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 14-1


RUN processing
Guided Practice Les 14-1
RUN processing
4. In your SELECTOR procedure include logic for the
RUN command:
a. Evaluate the value passed in the item key.
If the upper case value of the first four
characters is:
CNTR return the internal name of the
process with the Loop Counter Timeout
implementation
SELF return the internal name of the
process with the Self Loop Timeout
implementation
neither value, either raise an error or return
one of the processes as the default process
4. In your SELECTOR procedure include logic for the
RUN command:
a. Evaluate the value passed in the item key.
If the upper case value of the first four
characters is:
CNTR return the internal name of the
process with the Loop Counter Timeout
implementation
SELF return the internal name of the
process with the Self Loop Timeout
implementation
neither value, either raise an error or return
one of the processes as the default process
Setting Resultout Parameter
Parameter resultout should be set to the internal name of the process that should
be started.
Note:
The selector procedure example given is contrived for class purposes only and
does not reflect a practical implementation of selector function logic. The
selector function is generally expected to use the item key as the primary key to
retrieve supporting applications data. The application data retrieved would then
be used to determine which process is appropriate to run.
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 15
Guided Practice Les 14-1 Testing a Selector Function
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 14-1


Testing a Selector Function
Guided Practice Les 14-1
Testing a Selector Function
5. Connect to the Oracle Workflow home page. Log
on as any user with Administrator privileges.
a. Select the Launch Processes link
b. Select your Item Type link from the list
c. On the Initiate Workflow page enter:
an item key to exercise your Selector logic
(values prefixed with CNTR, SELF, etc.)
a unique user key
a Process Name of None from the poplist
a requestor and approver
a from and to date (DD-MON-RR)
5. Connect to the Oracle Workflow home page. Log
on as any user with Administrator privileges.
a. Select the Launch Processes link
b. Select your Item Type link from the list
c. On the Initiate Workflow page enter:
an item key to exercise your Selector logic
(values prefixed with CNTR, SELF, etc.)
a unique user key
a Process Name of None from the poplist
a requestor and approver
a from and to date (DD-MON-RR)
To Run the Selector Function
The Workflow Engine will run the selector function only if the process parameter
is not passed in the call to create the new process instance. So, when you initiate
a workflow from the Initiate Workflow web page you must select None from the
Process Name poplist.
To initiate a workflow (with sample itemkey value prefixed with CNTR), from
a sql*plus session you would issue the following commands:
1. exec wf_engine.CreateProcess(WFVACXX,CNTR<n>);
2. for each required text item attribute:
exec wf_engine.SetItemAttrText(WFVACXX,CNTR<n>,<attr name>,<attr
value>);
for each required date item attribute:
exec wf_engine.SetItemAttrDate(WFVACXX,CNTR<n>,<attr name>,<attr
value>);
3. exec wf_engine.SetItemUserKey(WFVACXX,CNTR<n>,<userkeyvalue>);
4. exec wf_engine.SetItemOwner(WFVACXX,CNTR<n>,<role name>);
5. exec wf_engine.StartProcess(WFVACXX,CNTR<n>);
6. commit;
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 16
Guided Practice Les 14-1: Monitoring the Results
Copyright Oracle Corporation, 2000. All rights reserved.

Guided Practice Les 14-1:


Monitoring the Results
Guided Practice Les 14-1:
Monitoring the Results
6. Display the Monitor web pages for your work item.
The process run will appear in the:
Monitor Process List, Process Name column
Monitor Activities List, Parent Activity column
Monitor Diagram, Process Title and Diagram
itself
Verify that the expected process was run. If an
error occurred in your process, use the Result
Exception link in the Activities List to determine
the cause.
6. Display the Monitor web pages for your work item.
The process run will appear in the:
Monitor Process List, Process Name column
Monitor Activities List, Parent Activity column
Monitor Diagram, Process Title and Diagram
itself
Verify that the expected process was run. If an
error occurred in your process, use the Result
Exception link in the Activities List to determine
the cause.
Note:
After starting a process from the Initiate Workflow web page, control is passed to
the Monitor Activities List web page.
After starting a process from a sql*plus session, retrieve the process status by
running the developer sql script wfstat.sql <itemtype> <itemkey> or by using the
Find Processes web page.
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 17
Les 14-1 Summary
Copyright Oracle Corporation, 2000. All rights reserved.

Les 14-1 Summary


Les 14-1 Summary
In this practice, you should have learned how to:
Write a PL/SQL procedure to select which process
to run
Assign a Selector function to an item type
Cause the Workflow Engine to run a Selector
function
Verify that your Selector function returns the
process name expected
In this practice, you should have learned how to:
Write a PL/SQL procedure to select which process
to run
Assign a Selector function to an item type
Cause the Workflow Engine to run a Selector
function
Verify that your Selector function returns the
process name expected
Sample Solutions
Refer to PL/SQL package specification and body definition files wfvacxxs.sql and
wfvacxxb.sql and workflow definition file wfvacxx_141.wft for sample solutions.
The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample procedures
used throughout the lesson practices. The procedure specific to Practice 14-1 is
WFVACXX.SELECTOR.
Copyright Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 18
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 1
External System Integration
Chapter 15
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 2
External System Integration
Copyright Oracle Corporation, 2000. All rights reserved.

External System Integration


External System Integration
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson you should be able to:
Understand the options to incorporate external
system processing in a workflow process.
Describe the concept of Advanced Queues.
Describe how to pause and resume a workflow
process.
After this lesson you should be able to:
Understand the options to incorporate external
system processing in a workflow process.
Describe the concept of Advanced Queues.
Describe how to pause and resume a workflow
process.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 4
Oracle Workflow Terms
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Terms


Oracle Workflow Terms
BlockActivity
CompleteActivity
BlockActivity
CompleteActivity
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 5
External Function Activity Support
Copyright Oracle Corporation, 2000. All rights reserved.

Function Function
Activity Activity
External Execution
Agent
Java
CORBA
OS command
Oracle8 Oracle8
Advanced Advanced
Queues Queues
External Function Activity Support
External Function Activity Support
External Function Activity Support
Oracle Workflow supports function activities that are external to the database,
facilitating integration with external products and legacy systems.
The workflow engine:
Leverages Oracle8 advanced queues to support the execution of external
function activities
Inserts messages into the outbound queue that external execution agents
can consume; the external execution agents must support Java, CORBA,
or OS command activities
Expects the external function to return information to the inbound queue
Advanced Queues is also being used to improve the throughput of the background
engine.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 6
Advanced Queues Processing
Copyright Oracle Corporation, 2000. All rights reserved.

Advanced Queues Processing


Advanced Queues Processing
Oracle Workflow queue APIs are called to handle
workflow Advanced Queues Processing.
An outbound and inbound queue is established.
A package of data on the queue is referred to as
an event or a message.
Events are enqueued in the outbound queue for
agents to consume and process.
An agent may enqueue a message to the inbound
queue for the Workflow Engine to consume and
process.
Outbound and inbound queues facilitate the
integration of external activities into the workflow
process.
Oracle Workflow queue APIs are called to handle
workflow Advanced Queues Processing.
An outbound and inbound queue is established.
A package of data on the queue is referred to as
an event or a message.
Events are enqueued in the outbound queue for
agents to consume and process.
An agent may enqueue a message to the inbound
queue for the Workflow Engine to consume and
process.
Outbound and inbound queues facilitate the
integration of external activities into the workflow
process.
Note:
A message in the context of AQ processing is different from the messages
associated with notification activities.
Agents may be any application that is external to the database.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 7
Advanced Queue Integration
Copyright Oracle Corporation, 2000. All rights reserved.

Advanced Queue Integration


Advanced Queue Integration
Workflow
Workflow
Engine
Background
Engine
Advanced Queue
WF Outbound
WF Inbound
WF Deferred
Oracle Server
External Inbound
External Outbound
External Process
External System
Workflow Outbound, Inbound, and Deferred queues are established in the
workflow account.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 8
Advanced Queue Integration
Copyright Oracle Corporation, 2000. All rights reserved.

Advanced Queue Integration


Advanced Queue Integration
Workflow
Workflow
Engine
Background
Engine
Advanced Queue
WF Outbound
WF Inbound
WF Deferred
Oracle Server
External Inbound
External Outbound
External Process
External System
When an external function activity is encountered by the Workflow Engine a
message is written to the outbound queue. The payload of the message will
include any activity attribute name - value pairs.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 9
Advanced Queue Integration
Copyright Oracle Corporation, 2000. All rights reserved.

Advanced Queue Integration


Advanced Queue Integration
Workflow
Workflow
Engine
Background
Engine
Advanced Queue
WF Outbound
WF Inbound
WF Deferred
Oracle Server
External Inbound
External Outbound
External Process
External System
A message on the workflow outbound queue is read by an external agent, possibly
into an external inbound queue.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 10
Advanced Queue Integration
Copyright Oracle Corporation, 2000. All rights reserved.

Advanced Queue Integration


Advanced Queue Integration
Workflow
Workflow
Engine
Background
Engine
Advanced Queue
WF Outbound
WF Inbound
WF Deferred
Oracle Server
External Inbound
External Outbound
External Process
External System
The external system consumes and processes the message and may write it to an
external outbound queue.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 11
Advanced Queue Integration
Copyright Oracle Corporation, 2000. All rights reserved.

Advanced Queue Integration


Advanced Queue Integration
Workflow
Workflow
Engine
Background
Engine
Advanced Queue
WF Outbound
WF Inbound
WF Deferred
Oracle Server
External Inbound
External Outbound
External Process
External System
The external agent enqueues a message in the workflow inbound queue for Oracle
Workflow to consume and process. The workflow inbound queue can be thought
of as the reply to the original workflow outbound queue message. The inbound
queue message payload can include activity attribute name - value pairs with
updated values.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 12
Advanced Queue Integration
Copyright Oracle Corporation, 2000. All rights reserved.

Advanced Queue Integration


Advanced Queue Integration
Workflow
Workflow
Engine
Background
Engine
Advanced Queue
WF Outbound
WF Inbound
WF Deferred
Oracle Server
External Inbound
External Outbound
External Process
External System
The Workflow Background Engine consumes and processes the inbound message
and completes the original function activity.
Advanced Queue Processing APIs
The following WF_QUEUE package APIs support use of external function
activities:
EnqueueInbound()
DequeueOutbound()
DequeueEventDetail()
PurgeEvent()
PurgeItemType()
ProcessInboundQueue()
GetMessageHandle()
Deferred_queue()
Inbound_queue()
Outbound_queue()
ClearMsgStack()
CreateMsg()
WriteMsg()
SetMsgAttr()
SetMsgResult()
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 13
Advanced Queue Integration
Copyright Oracle Corporation, 2000. All rights reserved.

Advanced Queue Integration


Advanced Queue Integration
Workflow
Workflow
Engine
Background
Engine
Advanced Queue
WF Outbound
WF Inbound
WF Deferred
Oracle Server
External Inbound
External Outbound
External Process
External System
The Workflow Engine also integrates with Advanced Queues to carry out
deferred processing. When the Workflow Engine encounters an activity for
deferred processing a message is written to a separate deferred queue. The
Background Engine consumes and processes the deferred queue messages,
executing and completing the deferred activity.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 14
Block Activity
Copyright Oracle Corporation, 2000. All rights reserved.

Block Activity
Block Activity
is a standard function activity alternative to
incorporating external system processing.
lets you pause a process until an external program
or manual step completes.
delays a process until a particular condition is met.
requires a program to issue a call to
WF_ENGINE.CompleteActivity to resume the
process at the Block activity.
is a standard function activity alternative to
incorporating external system processing.
lets you pause a process until an external program
or manual step completes.
delays a process until a particular condition is met.
requires a program to issue a call to
WF_ENGINE.CompleteActivity to resume the
process at the Block activity.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 15
CompleteActivity
Copyright Oracle Corporation, 2000. All rights reserved.

CompleteActivity
CompleteActivity
Notifies the Workflow Engine that the specified
activity for an item has been completed.
Notifies the Workflow Engine that the specified
activity for an item has been completed.
procedure CompleteActivity
(itemtype in varchar2,
itemkey in varchar2,
activity in varchar2,
result_code in varchar2);
procedure CompleteActivity
(itemtype in varchar2,
itemkey in varchar2,
activity in varchar2,
result_code in varchar2);
WF_ENGINE.CompleteActivity API
Call WF_ENGINE.CompleteActivity to indicate an activity is completed. This
procedure requires that the activity currently has a status of 'Notified'. An optional
activity completion result can also be passed. (Result is not applicable for the
standard Block activity.) The result can determine which transition the process
takes next.
Provide the activity node's label name. If the activity node label name does not
uniquely identify the subprocess you can precede the label name with the internal
name of its parent process. For example,
<parent_process_internal_name>:<label_name>.
Copyright Oracle Corporation, 2000. All rights reserved.
External System Integration
Chapter 15 - Page 16
Copyright Oracle Corporation, 2000. All rights reserved.
Forced Synchronous Processing
Chapter 16 - Page 1
Forced Synchronous
Processing
Chapter 16
Copyright Oracle Corporation, 2000. All rights reserved.
Forced Synchronous Processing
Chapter 16 - Page 2
Forced Synchronous Processing
Copyright Oracle Corporation, 2000. All rights reserved.

Forced Synchronous Processing


Forced Synchronous Processing
Copyright Oracle Corporation, 2000. All rights reserved.
Forced Synchronous Processing
Chapter 16 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson, you should be able to:
Describe forced synchronous processing.
Describe process definition restrictions.
After this lesson, you should be able to:
Describe forced synchronous processing.
Describe process definition restrictions.
Copyright Oracle Corporation, 2000. All rights reserved.
Forced Synchronous Processing
Chapter 16 - Page 4
Forced Synchronous Processes
Copyright Oracle Corporation, 2000. All rights reserved.

Forced Synchronous Processes


Forced Synchronous Processes
A synchronous process includes consecutive
function activities in a single thread that are not
deferred to the background engine.
A forced synchronous process completes in a
single SQL session and never inserts or updates
any database tables.
A forced synchronous process, therefore,
generates a result more quickly than a
synchronous process.
A synchronous process includes consecutive
function activities in a single thread that are not
deferred to the background engine.
A forced synchronous process completes in a
single SQL session and never inserts or updates
any database tables.
A forced synchronous process, therefore,
generates a result more quickly than a
synchronous process.
Forced Synchronous Processing
To create a forced synchronous process, you need to set the itemkey of
your process to #SYNCH or wf_engine.eng_synch, which returns the
#SYNCH constant when you call the necessary WF_ENGINE APIs.
Because a forced synchronous process never writes to the database, using
a non-unique itemkey such as #SYNCH is not an issue.
Copyright Oracle Corporation, 2000. All rights reserved.
Forced Synchronous Processing
Chapter 16 - Page 5
Process Definition Restrictions
Copyright Oracle Corporation, 2000. All rights reserved.

Process Definition Restrictions


Process Definition Restrictions
Process definitions must adhere to various
restrictions:
No Notification Activities
Limited Blocking Activity Use
No Error Processing
No Master/Detail Coordination Activities
No Parallel Flows
Process definitions must adhere to various
restrictions:
No Notification Activities
Limited Blocking Activity Use
No Error Processing
No Master/Detail Coordination Activities
No Parallel Flows
Process Definition Restrictions
No notification activities are allowed.
Limited blocking-type activities are allowed. A process can block
and restart with a call to WF_ENGINE.CompleteActivity only if
the blocking and restarting activities:
Occur in the same database session.
Contain no intervening calls to Oracle Workflow.
Contain no intervening commits.
No Error Processes can be assigned to the process or the processs
activities.
Each function activity behaves as if On Revisit is set to Loop, and
is run in non-canceling mode, regardless of its actual On Revisit
setting. Loops are allowed in the process.
No Master/Detail coordination activities are allowed.
No parallel flows are allowed in the process, as transitions from
each activity must have a distinct result. This also means that no
<Any> transitions are allowed because they cause parallel flows.
Copyright Oracle Corporation, 2000. All rights reserved.
Forced Synchronous Processing
Chapter 16 - Page 6
Process Definition Restrictions (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Process Definition Restrictions


(continued)
Process Definition Restrictions
(continued)
Process definitions must adhere to various
restrictions:
Some Standard Activities are Not Supported
No Deferred Processing
No Process Status Information is Saved
Process definitions must adhere to various
restrictions:
Some Standard Activities are Not Supported
No Deferred Processing
No Process Status Information is Saved
Process Definition Restrictions (continued)
None of the following Standard activities are allowed:
And
Block (restricted by the conditions stated in the Limited
Blocking bullet point above.)
Defer Thread
Wait
Continue Flow/Wait for Flow
Role Resolution
Voting
Compare Execution Time
Notify
No use of the background engine; that is, activities are never
deferred.
No data is ever written to the Oracle Workflow tables and as a
result:
The process cannot be viewed from the Workflow Monitor.
No auditing is available for the process.
Copyright Oracle Corporation, 2000. All rights reserved.
Forced Synchronous Processing
Chapter 16 - Page 7
Process Definition Restrictions (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Process Definition Restrictions


(continued)
Process Definition Restrictions
(continued)
Limited WF_ENGINE API calls:
CreateProcess
StartProcess
SetItemAttribute
GetItemAttribute
GetActivityAttribute
CompleteActivity
Limited WF_ENGINE API calls:
CreateProcess
StartProcess
SetItemAttribute
GetItemAttribute
GetActivityAttribute
CompleteActivity
Process Definition Restrictions (continued)
Only the following WF_ENGINE API calls are allowed to be
made, and in all cases, the itemkey supplied to these APIs must be
specified as #SYNCH or wf_engine.eng_synch:
WF_ENGINE.CreateProcess
WF_ENGINE.StartProcess
WF_ENGINE.GetItemAttribute
WF_ENGINE.SetItemAttribute
WF_ENGINE.GetActivityAttribute
WF_ENGINE.CompleteActivity (for the limited usage of
blocking-type activities)
WF_ENGINE API calls for any item, except the item for the
current synchronous item, are not allowed.
Copyright Oracle Corporation, 2000. All rights reserved.
Forced Synchronous Processing
Chapter 16 - Page 8
Copyright Oracle Corporation, 2000. All rights reserved.
Purge
Chapter 17 - Page 1
Purge
Chapter 17
Copyright Oracle Corporation, 2000. All rights reserved.
Purge
Chapter 17 - Page 2
Purge
Copyright Oracle Corporation, 2000. All rights reserved.

Purge
Purge
Copyright Oracle Corporation, 2000. All rights reserved.
Purge
Chapter 17 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson you should be able to:
Purge obsolete Workflow runtime data
After this lesson you should be able to:
Purge obsolete Workflow runtime data
Object Purging
The persistence type of an item type controls when Oracle Workflow purges runtime
status information for instances of a workflow; the persistence values are:
Temporary: Item will be deleted in n days
Permanent: Item will be deleted only when forced
Copyright Oracle Corporation, 2000. All rights reserved.
Purge
Chapter 17 - Page 4
Purging Obsolete Workflow Data
Copyright Oracle Corporation, 2000. All rights reserved.

Purging Obsolete Workflow Data


Purging Obsolete Workflow Data
Purge APIs delete obsolete runtime data and
activity versions no longer in use.
The most commonly used WF_PURGE APIs:
Items purge all runtime data associated with
completed items, their processes, and
notifications sent by them.
Activities purge obsolete versions of
activities that are no longer in use by any item.
Total purge both item data and activity data.
AdHocDirectory - purge users and roles in the
WF_LOCAL_* tables whose expiration date
has elapsed and that are not referenced in any
notification.
Purge APIs delete obsolete runtime data and
activity versions no longer in use.
The most commonly used WF_PURGE APIs:
Items purge all runtime data associated with
completed items, their processes, and
notifications sent by them.
Activities purge obsolete versions of
activities that are no longer in use by any item.
Total purge both item data and activity data.
AdHocDirectory - purge users and roles in the
WF_LOCAL_* tables whose expiration date
has elapsed and that are not referenced in any
notification.
Common WF_PURGE API Parameters
Many of the Purge APIs accept the following parameters:
Item Type - item type associated with the obsolete runtime data you want to
delete. Leave null to delete obsolete data for all item types.
Item Key - string generated from the application objects primary key. The
string uniquely identifies the item within an item type. If null, purges all items in
the specified item type.
Enddate - Specified date to delete up to.
Note: WF_PURGE APIs only purge data associated with Temporary item types, whose
persistence, in days, has expired. A persistence type PL/SQL variable is set to TEMP
(Temporary) by default and should not be changed.
Use API WF_PURGE.TotalPERM to delete all eligible obsolete runtime data associated
with item types of Permanent persistence type.
Copyright Oracle Corporation, 2000. All rights reserved.
Purge
Chapter 17 - Page 5
Purging Obsolete Workflow Data in Oracle Applications
Copyright Oracle Corporation, 2000. All rights reserved.

Purging Obsolete Workflow Data


in Oracle Applications
Purging Obsolete Workflow Data
in Oracle Applications
Use the concurrent program Purge Obsolete
Workflow Runtime Data, short name FNDWFPR.
Systems administrator should add the concurrent
program to the security group for the
responsibility you wish to run this program from.
Navigate to the Submit Request form in Oracle
Applications.
Supply the following parameters:
Item Type
Item Key
Age
Persistence Type
Use the concurrent program Purge Obsolete
Workflow Runtime Data, short name FNDWFPR.
Systems administrator should add the concurrent
program to the security group for the
responsibility you wish to run this program from.
Navigate to the Submit Request form in Oracle
Applications.
Supply the following parameters:
Item Type
Item Key
Age
Persistence Type
Concurrent Program Parameters
Item Type - item type associated with the obsolete runtime data you want to delete. Leave
null to delete obsolete data for all item types.
Item Key - string generated from the application objects primary key. The string
uniquely identifies the item within an item type. If null, purges all items in the specified
item type.
Age - minimum age of data to purge, in days if Persistence Type is set to Temporary.
Default is 0.
Persistence Type - persistence type to be purged, either Temporary or Permanent.
Default is Temporary.
Copyright Oracle Corporation, 2000. All rights reserved.
Purge
Chapter 17 - Page 6
Purging Obsolete Workflow Data in Oracle Applications
(continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Purging Obsolete Workflow Data


in Oracle Applications (continued)
Purging Obsolete Workflow Data
in Oracle Applications (continued)
Copyright Oracle Corporation, 2000. All rights reserved.
Purge
Chapter 17 - Page 7
Demonstration
Copyright Oracle Corporation, 2000. All rights reserved.

Demonstration
Demonstration
Run the WF_PURGE.Total API
Show the effects of purge
Run the WF_PURGE.Total API
Show the effects of purge
In Oracle Workflow we will demonstrate how to: In Oracle Workflow we will demonstrate how to:
Copyright Oracle Corporation, 2000. All rights reserved.
Purge
Chapter 17 - Page 8
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 1
Document Management
Integration
Chapter 18
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 2
Document Management Integration
Copyright Oracle Corporation, 2000. All rights reserved.

Document Management Integration


Document Management Integration
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson you should be able to:
Describe how DM systems integrate with Oracle
Workflow.
After this lesson you should be able to:
Describe how DM systems integrate with Oracle
Workflow.
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 4
Document Management Integration
Copyright Oracle Corporation, 2000. All rights reserved.

Document Management Integration


Document Management Integration
Notification Notification
Activities Activities
Document Document
Management Management
System System
PL/SQL Interface Layer
Document Management Integration
Oracle Workflow is integrated with targeted document management
systems to allow you to incorporate third-party documents and document
management operations in a workflow process.
The new server PL/SQL interface layer (an open API layer) consists of
procedures that let you define standard workflow operations as user
interface actions which can be taken on an item attribute. The standard
document management operations include:
View: Fetch a document for read-only use
Check Out: Retrieve a document for update
Check In/Unlock: Submit a document update
Version History: List all changes to a document
Search: Retrieve a list of documents that match specified search
criteria
Get/Set Document Attribute: Get or set attributes for a document
You complete the document management functions using the document
management system user interface.
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 5
Document Management
Copyright Oracle Corporation, 2000. All rights reserved.

Document Management
Document Management
Attached Document
Document can be
viewed online
Document Management Integration
The Notification Details web page displays document references as
defined by document-type attributes. This provides you direct access to a
specified document through the document management interface layer
using a browser session. This interface layer allows you to attach
documents to notification responses.
For users viewing e-mail notifications, the notification mailer fetches the
document contents and attaches them to the e-mail notification.
The following WF_ENGINE package APIs support document
management integration:
SetItemAttrDocument()
ItemStatus()
GetItemAttrDocument()
Before you can use document management integration, you need to define
a node for the document management system in the Document Nodes
page.
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 6
Defining Document Management Repositories
Copyright Oracle Corporation, 2000. All rights reserved.

Defining Document Management


Repositories
Defining Document Management
Repositories
Seamless open integration
Communications through a web server agent
interface
Seamless open integration
Communications through a web server agent
interface
Defining Document Management Repositories
Oracle Workflow provides seamless open integration with various
third-party document management (DM) systems. These systems
are still to be announced.
Oracle Workflow communicates with these DM systems through a
web server agent interface.
To register the DM system with Oracle Workflow, use the Oracle
Workflow Document Nodes web page to identify the DM system
as a document node.
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 7
Document Management Integration in Notifications
Copyright Oracle Corporation, 2000. All rights reserved.

Document Management Integration in


Notifications
Document Management Integration in
Notifications
To access a referenced DM document in a specific
notification, view it from the Notification Details
web page and select the document link.
To respond to a notification by attaching a
document, select the paper clip icon which
appears next to the field that requires a document
response.
To access a referenced DM document in a specific
notification, view it from the Notification Details
web page and select the document link.
To respond to a notification by attaching a
document, select the paper clip icon which
appears next to the field that requires a document
response.
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 8
Accessing a DM Document Sent by a Notification
Copyright Oracle Corporation, 2000. All rights reserved.

Accessing a DM Document Sent by a


Notification
Accessing a DM Document Sent by a
Notification
When you view a notification from the Notification
Details web page, the body of the message may
include a reference link to a DM document. This
link allows access to the DM system.
Click on the link to display a DM integration screen
in a new browser window.
The screen displays a Launch Document toolbar
and the content of the referenced DM document.
The toolbar buttons are fixed and represent
standard functions regardless of the DM system
you are integrating with.
Click on any of the toolbar buttons to perform any
of the standard functions.
When you view a notification from the Notification
Details web page, the body of the message may
include a reference link to a DM document. This
link allows access to the DM system.
Click on the link to display a DM integration screen
in a new browser window.
The screen displays a Launch Document toolbar
and the content of the referenced DM document.
The toolbar buttons are fixed and represent
standard functions regardless of the DM system
you are integrating with.
Click on any of the toolbar buttons to perform any
of the standard functions.
Standard Functions Associated with the Oracle Workflow DM Toolbar Buttons
Each function is carried out by the integrated DM system, therefore the actual
implementation of these functions may vary between DM vendors.
Document Name: Displays the name of the referenced document
Display: Displays the content of the document in its native format.
Fetch: Fetch the contents of the document to your local file system.
Check Out: Check out the document from your DM system and fetch onto
your local file system.
Check In: Check in a new version of a document into the DM system.
Unlock: Remove a lock on the document without checking in a new version
of the document.
Show History: Display the history of the information about the referenced
document.
Help: Display online help.
Note: For further information on the above functions please see the Oracle
Workflow Guide (Release 2.5), chapter 10 Viewing Notifications and
Processing Responses.
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 9
Responding to a Notification with a DM Document
Copyright Oracle Corporation, 2000. All rights reserved.

Responding to a Notification with a DM


Document
Responding to a Notification with a DM
Document
When you view a notification from the Notification
Details web page, certain response fields may
display paper clip icons. These fields prompt for a
DM document as part of the notification response.
The paper clip icon provides the direct access to
the DM system.
Click on the paper clip icon to display a DM screen
in a new browser window.
The screen displays a Launch Document toolbar
and the default DM systems native search screen.
The toolbar buttons are fixed and represent
standard functions regardless of the DM system
you are integrating with.
Click on any of the toolbar buttons to perform any
of the standard functions.
When you view a notification from the Notification
Details web page, certain response fields may
display paper clip icons. These fields prompt for a
DM document as part of the notification response.
The paper clip icon provides the direct access to
the DM system.
Click on the paper clip icon to display a DM screen
in a new browser window.
The screen displays a Launch Document toolbar
and the default DM systems native search screen.
The toolbar buttons are fixed and represent
standard functions regardless of the DM system
you are integrating with.
Click on any of the toolbar buttons to perform any
of the standard functions.
Standard Functions Associated with the Oracle Workflow DM Toolbar Buttons
Each function is carried out by the integrated DM system, therefore the actual
implementation of these functions may vary between DM vendors.
Change Document home: Displays the Change Document Home web page so
that you can choose a different DM node from which to select your
document.
Node Name: Displays the name of the current DM node.
Search: Search across all authorized documents and optionally across multiple
document versions for a document matching the content or metadata
criteria that you specify.
Create new: Create a new document in the current DM system for a file stored
in your local file system.
Browse: Browse for a document by navigating through the DM system folder
hierarchy.
Help: Display online help.
Note: For further information on the above functions please see the Oracle
Workflow Guide (Release 2.5), chapter 10 Viewing Notifications and
Processing Responses.
Copyright Oracle Corporation, 2000. All rights reserved.
Document Management Integration
Chapter 18 - Page 10
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 1
Setting Up Oracle Workflow
Chapter 19
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 2
Setting Up Oracle Workflow
Copyright Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Setting Up Oracle Workflow
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson you should be able to:
Define the required setup steps of Oracle
Workflow.
Define the optional setup steps of Oracle
Workflow.
Understand the access protection feature of
Oracle Workflow.
Transfer workflow definitions between a database
and flat file.
After this lesson you should be able to:
Define the required setup steps of Oracle
Workflow.
Define the optional setup steps of Oracle
Workflow.
Understand the access protection feature of
Oracle Workflow.
Transfer workflow definitions between a database
and flat file.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 4
Required Set Up Steps
Copyright Oracle Corporation, 2000. All rights reserved.

Required Set Up Steps


Required Set Up Steps
Background
Engines
Step 6
Step 3
WF_LANGUAGES
View
Step 4
Step 1
Global User
Preferences
http_proxy
Environment
Variable
Step 5
Step 2
Directory
Service
WF_RESOURCES
Environment
Variable
Background
Workflow
Engines
Overview of Required Set Up Steps for the Standalone Version of Oracle
Workflow
1. Set up the default Oracle Workflow user preferences using the Global
Preferences Web page.
2. Map Oracle Workflows directory service to the users and roles currently defined
in your organizations directory repository by constructing views based on those tables.
3. Create a view called WF_LANGUAGES that identifies the languages defined in
your Oracle8 installation.
4. Define an environment variable called http_proxy if you plan to use the
Notification Mailer.
5. Define an environment variable called WF_RESOURCES if your Workflow
server is installed on a UNIX platform.
6. Set up background Workflow Engines to control the load and throughput of the
primary Workflow Engine.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 5
Step 1 Setting Global User Preferences
Copyright Oracle Corporation, 2000. All rights reserved.

Step 1
Setting Global User Preferences
Step 1
Setting Global User Preferences
Use the Global Preferences web page to:
define the Workflow administrator role and
Workflow web agent.
set default user preference values for the
entire enterprise.
Entries in User Preferences web page override
those defaults set in the Global Preferences web
page.
Both web pages are accessible from the Oracle
Workflow Home page.
Global Preferences web page only available to the
Workflow administrator role.
Use the Global Preferences web page to:
define the Workflow administrator role and
Workflow web agent.
set default user preference values for the
entire enterprise.
Entries in User Preferences web page override
those defaults set in the Global Preferences web
page.
Both web pages are accessible from the Oracle
Workflow Home page.
Global Preferences web page only available to the
Workflow administrator role.
Note:
The Language, Territory, and Notification preference settings in the Global
Preferences and User Preferences web pages are valid only if your directory
service views map the Language, Territory, and Notification_Preference columns
to the Oracle Workflow preferences table.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 6
Step 2 Setting Up an Oracle Workflow Directory Service
Copyright Oracle Corporation, 2000. All rights reserved.

Step 2
Setting Up an Oracle Workflow Directory
Service
Step 2
Setting Up an Oracle Workflow Directory
Service
offers flexibility in defining who the workflow
users and roles are.
references any directory repository for users and
roles information by creating views based on the
database tables making up that repository.
provides local tables that contain columns similar
to those defined in the views. These tables are
used to store users and roles not included in the
existing directory repository.
provides predefined Directory Service view
definition and verification scripts
offers flexibility in defining who the workflow
users and roles are.
references any directory repository for users and
roles information by creating views based on the
database tables making up that repository.
provides local tables that contain columns similar
to those defined in the views. These tables are
used to store users and roles not included in the
existing directory repository.
provides predefined Directory Service view
definition and verification scripts
Oracle Workflow :
Oracle Workflow Directory Service Views
WF_USERS
WF_ROLES
WF_USER_ROLES
Oracle Workflow Directory Service Local Tables
WF_LOCAL_USERS
WF_LOCAL_ROLES
WF_LOCAL_USER_ROLES
Oracle Workflow Directory Service Scripts
wfdirhrv.sql: maps users and roles over a unified Oracle Applications environment
wfdirouv.sql: maps users and roles onto the native users and roles defined in Oracle 8i
wfdircsv.sql: maps users and roles to the Oracle Workflow Local tables.
If you create your own or modify any of the predefined directory service view
definitions, run the script wfdirchk.sql to verify your directory service model.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 7
Step 3 Verifying the WF_LANGUAGES View
Copyright Oracle Corporation, 2000. All rights reserved.

Step 3
Verifying the WF_LANGUAGES View
Step 3
Verifying the WF_LANGUAGES View
WF_LANGUAGES view is predefined in Oracle
Workflow Directory Services scripts.
Verify that the view definition identifies the
languages defined in your Oracle installation.
Customize the view definition if necessary.
WF_LANGUAGES allows for translation of field
values in the property pages of Oracle Workflow
Builder and workflow notifications.
WF_LANGUAGES view is predefined in Oracle
Workflow Directory Services scripts.
Verify that the view definition identifies the
languages defined in your Oracle installation.
Customize the view definition if necessary.
WF_LANGUAGES allows for translation of field
values in the property pages of Oracle Workflow
Builder and workflow notifications.
Mandatory Columns of the WF_LANGUAGES View
Code - the language code.
Display_Name - the display name of the language.
NLS_Language - the value of the Oracle NLS_LANGUAGE initialization parameter that
specifies the default language-dependent behavior of a session.
NLS_Territory - the value of the Oracle NLS_TERRITORY initialization parameter that
specifies the default territory-dependent date and numeric formatting of a session.
NLS_Codeset - the character set for the language.
Installed_Flag - flag to indicate if the language is installed and available for use.
Note:
A sample WF_LANGUAGES view is included in the script of each of the predefined
directory services that Oracle Workflow provides.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 8
Step 4 Setting the http_proxy Environment Variable
Copyright Oracle Corporation, 2000. All rights reserved.

Step 4
Setting the http_proxy Environment
Variable
Step 4
Setting the http_proxy Environment
Variable
If you are planning to use the Notification Mailer,
set up the http_proxy variable to point to your
proxy server before starting the Oracle Workflow
Database or the Notification Mailer. Only required
if you plan to attach URL content that exists
outside your organization firewall.
For example, in UNIX, use the following command
to set the http_proxy variable:
setenv http_proxy http://www-proxy.
yourcompany.com:80/
If you are planning to use the Notification Mailer,
set up the http_proxy variable to point to your
proxy server before starting the Oracle Workflow
Database or the Notification Mailer. Only required
if you plan to attach URL content that exists
outside your organization firewall.
For example, in UNIX, use the following command
to set the http_proxy variable:
setenv http_proxy http://www-proxy.
yourcompany.com:80/
http_proxy Variable Use
The Notification Mailer can fetch the URL content of a URL attribute, if the attribute has
Attach Content checked in its Attribute property page. If the referenced URL is outside
your organizations firewall, the Notification Mailer must go through your organizations
proxy server to fetch the URL content.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 9
Step 5 Setting the WF_RESOURCES Environment
Variable
Copyright Oracle Corporation, 2000. All rights reserved.

Step 5
Setting the WF_RESOURCES
Environment Variable
Step 5
Setting the WF_RESOURCES
Environment Variable
If you are using the standalone version of Oracle
Workflow and the Workflow server is installed on a
UNIX platform, set the WF_RESOURCES
environment variable.
This environment variable points to the language-
dependent Oracle Workflow resource file
wf<language>.res.
The resource file is generally found in the res
subdirectory of the Oracle Workflow server
directory structure.
If you are using the standalone version of Oracle
Workflow and the Workflow server is installed on a
UNIX platform, set the WF_RESOURCES
environment variable.
This environment variable points to the language-
dependent Oracle Workflow resource file
wf<language>.res.
The resource file is generally found in the res
subdirectory of the Oracle Workflow server
directory structure.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 10
Step 6 Setting Up Background Workflow Engines
Copyright Oracle Corporation, 2000. All rights reserved.

Step 6
Setting Up Background Workflow
Engines
Step 6
Setting Up Background Workflow
Engines
Background engines are set up to handle costly
deferred activities allowing the Workflow Engine
to continue to the next available activity.
Background engines are also set up to handle
timed out notifications.
You can define and start up as many background
engines as you like.
A background engine runs until it completes all
eligible activities.
You should set the background engine up to run
periodically.
Background engines are set up to handle costly
deferred activities allowing the Workflow Engine
to continue to the next available activity.
Background engines are also set up to handle
timed out notifications.
You can define and start up as many background
engines as you like.
A background engine runs until it completes all
eligible activities.
You should set the background engine up to run
periodically.
To Start a Background Engine
If you are using the standalone version of Oracle Workflow, then use the
WF_ENGINE.BACKGROUND( ) API to start up a background engine. Sample scripts
that repeatedly run the background engine are provided with the standalone version of
Oracle Workflow.
If you are using the version of Oracle Workflow embedded in Oracle Applications, start a
background engine by submitting the Background Process concurrent program using the
Submit Requests form.
Note:
Make sure you have a least one background engine that can check for timed out activities
and one that can process deferred activities. At a minimum, you need to set up one
background engine that can handle both timed out and deferred activities.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 11
Optional Setup Steps
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Setup Steps


Optional Setup Steps
Step 4
Step 3
Step 5
Step 2
Notification
Mailer
Message
Templates
Workflow Web
Page Logo
Custom
Icons
Step 1
Document
Management
Repositories
Overview of Optional Generic Setup Steps
1. Define a node for the document management system in the Document Nodes web
page if you will be integrating a certified DM system with Oracle Workflow.
2. Set up the Notification Mailer program if users are to receive notifications by
email.
3. Modify the templates for your electronic mail notifications.
4. Customize the company logo that appears in the Oracle Workflows web pages.
5. Include additional icons in your Oracle Workflow Icons subdirectory to
customize the diagrammatic representation of your workflow processes.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 12
Optional Step 1 Document Management Repositories
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 1
Document Management Repositories
Optional Step 1
Document Management Repositories
Oracle Workflow communicates with specific DM
systems through a web server agent interface. The
syntax for identifying the DM systems web server
is <protocol>://<server:port>/.
If you plan to use DM system integration, you must
register the DM system with Oracle Workflow by
using the Document Nodes web page to identify
the DM system as a document node.
Oracle Workflow uses the document node as the
gateway to a specific DM system and uses the
information defined in the node to construct the
URLs that display the DM system documents.
Oracle Workflow communicates with specific DM
systems through a web server agent interface. The
syntax for identifying the DM systems web server
is <protocol>://<server:port>/.
If you plan to use DM system integration, you must
register the DM system with Oracle Workflow by
using the Document Nodes web page to identify
the DM system as a document node.
Oracle Workflow uses the document node as the
gateway to a specific DM system and uses the
information defined in the node to construct the
URLs that display the DM system documents.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 13
Optional Step 2 Notification Mailer
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 2
Notification Mailer
Optional Step 2
Notification Mailer
Implement the Notification Mailer if users are to
receive notifications by e-mail as well as from the
Notifications Worklist web page.
The Notification Mailer is a program that performs
email send and response processing for the
Oracle Workflow Notification System.
The Notification Mailer also processes responses
by interpreting the text of messages mailed to its
response account and calling the appropriate
Notification API to complete the notification.
Once set up, the Notification Mailer continually
polls for messages to send and checks for
responses to process.
Implement the Notification Mailer if users are to
receive notifications by e-mail as well as from the
Notifications Worklist web page.
The Notification Mailer is a program that performs
email send and response processing for the
Oracle Workflow Notification System.
The Notification Mailer also processes responses
by interpreting the text of messages mailed to its
response account and calling the appropriate
Notification API to complete the notification.
Once set up, the Notification Mailer continually
polls for messages to send and checks for
responses to process.
Full MIME Support
Oracle Workflow fully supports Multi-purpose Internet Mail Extensions (MIME)
encoded messages. This means that the Notification Mailer can exchange messages with
workflow users containing languages with different character sets and multimedia
encoded content.
Notification Preferences
Oracle Workflow allows you to determine how you view notifications by setting a
notification preference in the User Preferences web page.
There are five types of notification preferences:
MAILTEXTplain text mail: The notification message appears as plain text
with no attachments.
MAILHTMLHTML mail: The notification message appears as HTML-
formatted text with at least one other attachment that is a link to the notification
in the Notifications Web page.
MAILATTHplain text mail with HTML attachments: The notification message
appears as plain text with at least two other attachments. One being an HTML-
formatted version of the message, the other being the link to the notification in
the Notifications Web page.
SUMMARYplain text summary mail: The message is a plain text summary of
all open notifications.
QUERYdo not send me mail: The Notification Mailer does not send you email
notifications.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 14
Optional Step 2 Notification Mailer Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 2
Notification Mailer Overview
Optional Step 2
Notification Mailer Overview
Notifications
Oracle server
Advanced Queues
Oracle
Internet
Messaging
SMTP
MAPI
Oracle Workflow
Notification Mailer
HTML
Plain text
Various
Mail
Applications
Netscape
Lotus Notes
MS Exchange
Unix Sendmail
Others
Notification Mailer Features
The Notification Mailer sends e-mail and processes responses for the Oracle Workflow
Notifications System. The Notification Mailer:
Polls the database for messages to send.
Resolves the e-mail address of the recipient role, which itself can be a mail distribution
list.
Switches its database session to be the preferred language of the role and territory
setting.
Selects information from the database as defined by the attributes of the message.
Generates the message using a message template.
Sends the message via UNIX Sendmail, Oracle Internet Messaging, or a MAPI-
compliant mail application.
Processes responses returned and calls the appropriate Notification API to complete the
notification activity.
Notification Mailer remains running unless a database failure occurs or the PL/SQL
package state changes for the session.
Note:
For the standalone version of Oracle Workflow, create and run a perpetual shell script
that restarts the Notification Mailer, should it shutdown. Example: UNIX shell script
wfmail.csh located in the Oracle Workflow server bin subdirectory.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 15
Optional Step 2 continued Notification Mailer
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 2 continued


Notification Mailer
Optional Step 2 continued
Notification Mailer
You can set up the Notification Mailer to run
against UNIX SendMail, Oracle Internet Messaging
4.2, or a MAPI-compliant mail application on
Windows NT.
Set up at least one mail account dedicated to the
Notification Mailer processing in one of these mail
applications.
Define three folders/files in the mail account for
response processing.
Use the sample configuration file, wfmail.cfg, to
create a configuration file of Notification Mailer
input arguments.
You can set up the Notification Mailer to run
against UNIX SendMail, Oracle Internet Messaging
4.2, or a MAPI-compliant mail application on
Windows NT.
Set up at least one mail account dedicated to the
Notification Mailer processing in one of these mail
applications.
Define three folders/files in the mail account for
response processing.
Use the sample configuration file, wfmail.cfg, to
create a configuration file of Notification Mailer
input arguments.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 16
Optional Step 2 continued Running the Notification
Mailer
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 2 continued


Running the Notification Mailer
Optional Step 2 continued
Running the Notification Mailer
For the standalone version of Oracle Workflow, run
the Notification Mailer using one of the following
operating system commands:
Integrating with Oracle Internet Messaging:
wfmail.ofc -f <config_file>
Integrating with UNIX Sendmail:
wfmail.snd -f <config_file>
Integrating with MAPI-compliant applications:
wfmlr20.exe -f <config_file>
Replace <config_file> with the path and name
of the configuration file.
For the standalone version of Oracle Workflow, run
the Notification Mailer using one of the following
operating system commands:
Integrating with Oracle Internet Messaging:
wfmail.ofc -f <config_file>
Integrating with UNIX Sendmail:
wfmail.snd -f <config_file>
Integrating with MAPI-compliant applications:
wfmlr20.exe -f <config_file>
Replace <config_file> with the path and name
of the configuration file.
Location of the Notification Mailer
The Oracle Internet Messaging and UNIX Sendmail Notification Mailer executables
reside on your server in the $ORACLE_HOME/bin subdirectory.
The MAPI-compliant Notification Mailer executable resides on your Windows NT PC in
<drive>:\<ORACLE_HOME>\bin subdirectory.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 17
Optional Step 2 continued Running the Notification
Mailer
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 2 continued


Running the Notification Mailer
Optional Step 2 continued
Running the Notification Mailer
To run the Notification Mailer for Oracle Workflow
embedded in Oracle Applications:
Integrating with UNIX Sendmail or Oracle Internet
Messaging, submit the Notification Mailer
concurrent program from the Submit Request
form. You can also run the concurrent program
from the command line:
WFMAIL apps/pwd 0 Y FILE <config_file>
Integrating with MAPI-compliant mail applications,
install the Notification Mailer on Windows NT and
run:
wfmlr20.exe -f <config_file>
Replace <config_file> with the path and name of
the configuration file.
To run the Notification Mailer for Oracle Workflow
embedded in Oracle Applications:
Integrating with UNIX Sendmail or Oracle Internet
Messaging, submit the Notification Mailer
concurrent program from the Submit Request
form. You can also run the concurrent program
from the command line:
WFMAIL apps/pwd 0 Y FILE <config_file>
Integrating with MAPI-compliant mail applications,
install the Notification Mailer on Windows NT and
run:
wfmlr20.exe -f <config_file>
Replace <config_file> with the path and name of
the configuration file.
Notification Mailer Concurrent Program
By default the concurrent program links to the Sendmail version of the mailer program,
but can be relinked to the Oracle Internet Messaging version.
Your system administrator needs to add the Notification Mailer concurrent program to
a request security group for the responsibility that you want to run the program from.
Notification Mailer Configuration File
In the Submit Requests Parameters window, enter the path and filename of the
configuration file.
The configuration file lists the parameters you want to run with the program and must
have the following format:
#Description
PARAMETER1=value1
#Description
PARAMETER2=value2
. . .
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 18
Optional Step 2 continued Notification Mailer
Arguments
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 2 continued


Notification Mailer Arguments
Optional Step 2 continued
Notification Mailer Arguments
CONNECT (required)
ACCOUNT (required)
NODE (required)
FROM
SUMMARYONLY (required)
DIRECT_RESPONSE
AUTOCLOSE_FYI
ALLOW_FORWARDED_RESPONSE
IDLE
LOG
SHUTDOWN
CONNECT (required)
ACCOUNT (required)
NODE (required)
FROM
SUMMARYONLY (required)
DIRECT_RESPONSE
AUTOCLOSE_FYI
ALLOW_FORWARDED_RESPONSE
IDLE
LOG
SHUTDOWN
Notification Mailer Argument Definitions
CONNECT:<username/password>@<db> to connect to the Workflow database
account.
ACCOUNT: <username/password> to connect to the mail account.
NODE: Identifier for current Notification Mailer.
FROM: Value that appears in the From: field of notifications.
SUMMARYONLY: Y or N to send notification summaries.
DIRECT_RESPONSE: Y or N to implement direct response processing for
notifications sent to roles with MAILTEXT or MAILATTH only.
AUTOCLOSE_FYI: Y or N to automatically close notifications that do not require a
response after sending the notification by e-mail.
ALLOW_FORWARDED_RESPONSE: Y or N to allow a user to respond to an e-mail
notification that has been forwarded (using e-mail) from another role.
IDLE: Seconds to wait between checks.
LOG: Name of log file.
SHUTDOWN: Filename that cues program to shut down.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 19
Optional Step 2 continued Notification Mailer
Arguments
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 2 continued


Notification Mailer Arguments
Optional Step 2 continued
Notification Mailer Arguments
FAILCOMMAND
DEBUG
TEST_ADDRESS
REPLYTO
HTMLAGENT
HTMLDESC
HTMLTYPE
DISCARD
PROCESS
UNPROCESS
TAGFILE
FAILCOMMAND
DEBUG
TEST_ADDRESS
REPLYTO
HTMLAGENT
HTMLDESC
HTMLTYPE
DISCARD
PROCESS
UNPROCESS
TAGFILE
Notification Mailer Argument Definitions (continued)
FAILCOMMAND: Command to run if program encounters error.
DEBUG: Y or N to print debugging information in log.
TEST_ADDRESS: Test e-mail address to send all outgoing e-mail notifications.
REPLYTO: E-mail address to reply to.
HTMLAGENT: Path that identifies the HTML Web agent that handles HTML
responses.
HTMLDESC: Description of the default attachment used by Oracle Internet
Messaging.
HTMLTYPE: HTML attachment type number used by Oracle Internet Messaging.
DISCARD: Name of mail folder/file for discarded incoming mail.
PROCESS: Name of mail folder/file for processed responses.
UNPROCESS: Name of mail folder/file for responses awaiting processing.
TAGFILE: File that lists strings found in unusual messages and the statuses to assign
to those messages. For example, tag file entries might include:
ERROR "-- Unsent message follows --"
UNAVAIL "Returned mail:"
IGNORE "POSTMASTER"
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 20
Optional Step 3 Message Templates
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 3
Message Templates
Optional Step 3
Message Templates
Messages sent by the Notification Mailer are
composed using one of six templates defined in the
System: Mailer item type. This item type is defined in
the wfmail.wft workflow definition file.
Copy wfmail.wft and store in your source
controlled file system.
Open your file copy of the System: Mailer item
type in your Workflow Builder.
Select one of the message templates.
Display the property sheet for the message.
Edit the Subject or Body of the message.
Messages sent by the Notification Mailer are
composed using one of six templates defined in the
System: Mailer item type. This item type is defined in
the wfmail.wft workflow definition file.
Copy wfmail.wft and store in your source
controlled file system.
Open your file copy of the System: Mailer item
type in your Workflow Builder.
Select one of the message templates.
Display the property sheet for the message.
Edit the Subject or Body of the message.
Mail Templates
Open Mail: For notifications that require a response.
Open FYI Mail: For notifications that do not require a response.
Canceled Mail: Informs recipient that a notification is cancelled.
Invalid Mail: Informs recipient that the response to the notification is invalid.
Closed Mail: Informs recipient that a previously sent notification is now closed.
Summary Mail: For notification summaries.
Warning Mail: Informs recipient of unsolicited mail that he/she sent
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 21
Optional Step 3 continued Message Templates
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 3 continued


Message Templates
Optional Step 3 continued
Message Templates
Do not add, delete, or modify any attributes in the
System: Mailer item type.
Verify your edits using File -> Verify and Save.
Source control your edited version of the System:
Mailer item type.
Load your System: Mailer item type to your
database using the Workflow Loader program or
the Workflow Builder Save As menu option.
Test use of your modified templates using the test
account capability of the Notification Mailer.
Do not add, delete, or modify any attributes in the Do not add, delete, or modify any attributes in the
System: Mailer item type. System: Mailer item type.
Verify your edits using File -> Verify and Save. Verify your edits using File -> Verify and Save.
Source control your edited version of the System: Source control your edited version of the System:
Mailer item type. Mailer item type.
Load your System: Mailer item type to your Load your System: Mailer item type to your
database using the Workflow Loader program or database using the Workflow Loader program or
the Workflow Builder Save As menu option. the Workflow Builder Save As menu option.
Test use of your modified templates using the test Test use of your modified templates using the test
account capability of the Notification Mailer. account capability of the Notification Mailer.
Note:
Always use flat file data stores (.wft files) for edits rather than editing directly against a
database datastore. Source control your workflow definitions.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 22
Optional Step 4 Workflow Web Page Logo
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 4
Workflow Web Page Logo
Optional Step 4
Workflow Web Page Logo
Once the web server is installed and set up, you
can customize the company logo that appears on
Oracle Workflows web pages.
Create your company logo file in gif format and
save as filename WFLOGO.gif.
Move WFLOGO.gif to the physical directory
associated with your web servers /OA_MEDIA/
virtual directory.
Once the web server is installed and set up, you
can customize the company logo that appears on
Oracle Workflows web pages.
Create your company logo file in gif format and
save as filename WFLOGO.gif.
Move WFLOGO.gif to the physical directory
associated with your web servers /OA_MEDIA/
virtual directory.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 23
Optional Step 5 Custom Icons
Copyright Oracle Corporation, 2000. All rights reserved.

Optional Step 5
Custom Icons
Optional Step 5
Custom Icons
Oracle Workflow provides a variety of icons that
you can use with your activities and processes.
You can add additional icon files as long as they
are of the appropriate format.
Create custom icon files and convert to gif files.
Oracle Workflow Builder looks for Windows icon
files (.ico) in the Icon subdirectory of the Oracle
Workflow area on your PC.
Oracle Workflow Monitor and web pages look for
gif files (.gif) in
/OA_MEDIA/oracle/apps/fnd/wf/icons
where /OA_MEDIA/ is a virtual directory mapping
defined in your web server.
Oracle Workflow provides a variety of icons that
you can use with your activities and processes.
You can add additional icon files as long as they
are of the appropriate format.
Create custom icon files and convert to gif files.
Oracle Workflow Builder looks for Windows icon
files (.ico) in the Icon subdirectory of the Oracle
Workflow area on your PC.
Oracle Workflow Monitor and web pages look for
gif files (.gif) in
/OA_MEDIA/oracle/apps/fnd/wf/icons
where /OA_MEDIA/ is a virtual directory mapping
defined in your web server.
Adding Custom Icons to Oracle Workflow
Convert the icon files (.ico) to gif format (.gif)
Copy the .gif files to a directory where Workflow Monitor can access them:
/OA_JAVA/oracle/apps/fnd/wf/icons
Note: /OA_JAVA/ is a virtual directory mapping defined in your Web server when
Oracle Workflow is installed.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 24
Oracle Workflow Access Protection
Copyright Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Access Protection


Oracle Workflow Access Protection
Oracle Workflow Access Protection:
Allows a customer of a workflow definition to
modify objects to meet their needs.
Prevents a customer of a workflow definition
from modifying seed data objects.
Preserves legitimate customizations of workflow
objects during a workflow definition upgrade.
Oracle Workflow Access Protection: Oracle Workflow Access Protection:
Allows a customer of a workflow definition to Allows a customer of a workflow definition to
modify objects to meet their needs. modify objects to meet their needs.
Prevents a customer of a workflow definition Prevents a customer of a workflow definition
from modifying seed data objects. from modifying seed data objects.
Preserves legitimate customizations of workflow Preserves legitimate customizations of workflow
objects during a workflow definition upgrade. objects during a workflow definition upgrade.
Access Protection
Use access protection to allow or discourage your customers from modifying your seed
data workflow definitions, yet preserve valid customizations during a workflow
definition upgrade.
All workflow objects except lookup codes, function attributes, and message attributes
contain an Access tab in their property pages. Lookup codes, function attributes, and
message attributes inherit their access settings from their parent lookup type,
function, or message, respectively.
The Access tab lets you define whether:
Future customizations to the object are preserved during a workflow definition
upgrade.
The object can be edited by users operating at a higher access level.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 25
Access Levels
Copyright Oracle Corporation, 2000. All rights reserved.

Access Levels
Access Levels
Each user of Oracle Workflow Builder operates the
system at a certain access level.
The access levels are defined as follows:
0-9reserved for Oracle Workflow
10-19reserved for Oracle Application Object
Library
20-99reserved for Oracle Applications
100-999reserved for customer organizations
1000Public
Each user of Oracle Workflow Builder operates the
system at a certain access level.
The access levels are defined as follows:
0-9reserved for Oracle Workflow
10-19reserved for Oracle Application Object
Library
20-99reserved for Oracle Applications
100-999reserved for customer organizations
1000Public
Protection Level
If you protect an object from customization, you effectively assign the object a protection
level equal to your current access level.
Objects protected against customizations are considered seed data.
Only users operating at an access level equal or lower than the protection level of
the object can modify the object.
Users operating at an access level greater than the protection level of the object
will see a small lock on the icon for the object in the navigator tree indicating that
the object is read-only.
Customization Level
If you set an object to be customizable, its protection level is set to 1000.
The customization level of an object is set to the access level of the initial user
who customizes the object.
A customized object is locked from further modification except from users with
access levels equal to the customization level of the object.
The customization level is relevant only with respect to unprotected workflow
objects.
If an object is protected at a certain level, it shouldnt be modified at all except
by an access level equal to or less than the protected level of the object.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 26
Setting Access Level
Copyright Oracle Corporation, 2000. All rights reserved.

Setting Access Level


Setting Access Level
Access Level defaults to 100 when Oracle Workflow
Builder is installed.
Your access level can be modified from the Help
menu in the About Oracle Workflow Builder dialog
box.
Enter an integer value in the Access Level field and
click OK.
Your access level setting will be maintained by the
Workflow Builder.
Access Level defaults to 100 when Oracle Workflow Access Level defaults to 100 when Oracle Workflow
Builder is installed. Builder is installed.
Your access level can be modified from the Help Your access level can be modified from the Help
menu in the About Oracle Workflow Builder dialog menu in the About Oracle Workflow Builder dialog
box. box.
Enter an integer value in the Access Level field and Enter an integer value in the Access Level field and
click OK. click OK.
Your access level setting will be maintained by the Your access level setting will be maintained by the
Workflow Builder. Workflow Builder.
Oracle Workflow Client Installation
If you previously installed Oracle Workflow Builder on a PC and you change your access
level to a value other than 100, reinstalling Oracle Workflow Builder will not modify the
access level at which you previously operated.
Allow modifications of customized objects Checkbox
Checked: Workflow Builder saves your edits, overwriting protected objects you
have access to modify as well as any previously customized objects (equivalent to
Workflow Definitions Loader Upload mode).
Unchecked: Workflow Builder saves edits only to protected objects that you
have access to change and does not overwrite previously customized objects
(equivalent to Workflow Definitions Loader Upgrade mode).
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 27
Setting Access, Protection, and Customization Levels
Copyright Oracle Corporation, 2000. All rights reserved.

Setting Access, Protection, and


Customization Levels
Setting Access, Protection, and
Customization Levels
Access Properties Page
Select the Access tab to display the Access property page.
Use the Options region to set the protection/customization level of an object.
Preserve Customizations: Prevents customized objects from being
overwritten during a workflow definition upgrade.
Lock at this Access Level: Protects the object at the current access level
and does not allow the object to be customized by higher access levels.
The Levels region shows the Customization, Access, and Protection levels of the
object based on how you set the check boxes in the Options region.
The indicator bar provides a visual range of access levels that can edit the object.
Black vertical line: Current access level
White range: Cannot edit the object
Solid Green: Can edit the object
Cross-hatch Green: Usually cannot modify the object because it has been
customized, but can now do so because Oracle Workflow Builder is set to
Upload mode so that Customized objects can be modified.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 28
Example of Access Protection
Copyright Oracle Corporation, 2000. All rights reserved.

Example of Access Protection


Example of Access Protection
Assume you have an access level of 100. Assume you have an access level of 100.
Resulting Level
Customization = 0
Access = 100
Protection = 1000
Customization = 100
Access = 100
Protection = 1000
Customization = 0
Access = 100
Protection = 100
Customization = 100
Access = 100
Protection = 100
Checkbox
None
Preserve
Customizations
Lock at this
Access Level
Both
Edit Range
0-100
100-1000
0-100
100
Protection and Customization Levels
Assuming an access level of 100, these protection and customization levels result when
the following check boxes are selected in the Options region:
None: Object can be updated at any time by any access level.
Preserve Customizations: Disallows customized objects from being overwritten
during a workflow upgrade.
Object may be updated by access levels 100-1000.
If the Allow modifications of customized objects check box is selected,
customized objects can also be updated by access levels 0-99 during an
upgrade, as represented by red crosshatches in the indicator bar.
Lock at this Access Level: Protects the object at the current access level and does
not allow the object to be customized, except by access levels 0-100.
Both: Object can only be updated by the access level at which the object is
protected.
Object may only be updated by access level 100.
If the Allow modifications of customized objects check box is selected,
customized objects can also be updated by access levels 0-99 during an
upgrade, as represented by red crosshatches in the indicator bar.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 29
Workflow Definitions Loader
Copyright Oracle Corporation, 2000. All rights reserved.

Workflow Definitions Loader


Workflow Definitions Loader
Use the Workflow Definitions Loader to transfer
workflow definitions between a flat file and a
database.
The loader is a server-executable program that is
handy to use when definitions need to be backed
up to a file prior to a database upgrade.
Workflow definition files are identified by the file
extension .wft.
Use the Workflow Definitions Loader to transfer
workflow definitions between a flat file and a
database.
The loader is a server-executable program that is
handy to use when definitions need to be backed
up to a file prior to a database upgrade.
Workflow definition files are identified by the file
extension .wft.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 30
Transferring Workflow Definitions: Oracle Workflow
Standalone
Copyright Oracle Corporation, 2000. All rights reserved.

Transferring Workflow Definitions:


Oracle Workflow Standalone
Transferring Workflow Definitions:
Oracle Workflow Standalone
To upgrade a definition and preserve
customizations using the access level listed in the
input file:
wfload -u <username/password@database>
<input file>
To upload a new version of a definition using the
access level listed in the input file:
wfload -u <username/password@database>
<input file>
To upgrade a definition and preserve To upgrade a definition and preserve
customizations using the access level listed in the customizations using the access level listed in the
input file: input file:
wfload -u <username/password@database>
<input file>
To upload a new version of a definition using the To upload a new version of a definition using the
access level listed in the input file: access level listed in the input file:
wfload -u <username/password@database>
<input file>
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 31
Transferring Workflow Definitions: Oracle Workflow
Standalone
Copyright Oracle Corporation, 2000. All rights reserved.

Transferring Workflow Definitions:


Oracle Workflow Standalone
Transferring Workflow Definitions:
Oracle Workflow Standalone
To force an upload of a definition regardless of an
objects protection level:
wfload -f <username/password@database>
<input file>
To download a definition:
wfload [-d <date>]
<username/password@database> <output file>
<item_type1> <item_type2> <item_typeN>
To force an upload of a definition regardless of an To force an upload of a definition regardless of an
objects protection level: objects protection level:
wfload -f <username/password@database>
<input file>
To download a definition: To download a definition:
wfload [-d <date>]
<username/password@database> <output file>
<item_type1> <item_type2> <item_typeN>
Downloading a Definition
Download one or more item type definitions.
Replace <item_typeN> with an * to download all item types.
Specify the -d option with a date to download definitions that were effective at a
specific date. Use the format YYYY/MM/DD HH24:MI:SS to specify the effective date.
The access level of the resulting output file is set to the value stored in the
WF_ACCESS_LEVEL environment variable.
Copyright Oracle Corporation, 2000. All rights reserved.
Setting Up Oracle Workflow
Chapter 19 - Page 32
Transferring Workflow Definitions: Oracle Workflow
embedded in Oracle Applications
Copyright Oracle Corporation, 2000. All rights reserved.

Transferring Workflow Definitions:


Oracle Workflow embedded in
Oracle Applications
Transferring Workflow Definitions:
Oracle Workflow embedded in
Oracle Applications
Run the Workflow Definitions Loader concurrent
program using one of the following modes:
Upgrade: Upgrade to a definition in an input file,
preserving customizations, using access level in
input file.
Upload: Upload the definition from an input file,
overwriting accidental customizations, using the
default access level.
Force: Upload a definition from an input file
regardless of access level.
Download: Download specified item type
definitions from the database to an output file.
Run the Workflow Definitions Loader concurrent Run the Workflow Definitions Loader concurrent
program using one of the following modes: program using one of the following modes:
Upgrade: Upgrade to a definition in an input file, Upgrade: Upgrade to a definition in an input file,
preserving customizations, using access level in preserving customizations, using access level in
input file. input file.
Upload: Upload the definition from an input file, Upload: Upload the definition from an input file,
overwriting accidental customizations, using the overwriting accidental customizations, using the
default access level. default access level.
Force: Upload a definition from an input file Force: Upload a definition from an input file
regardless of access level. regardless of access level.
Download: Download specified item type Download: Download specified item type
definitions from the database to an output file. definitions from the database to an output file.
Copyright Oracle Corporation, 2000. All rights reserved.
Master/Detail Coordination Activities
Chapter 20 - Page 1
Master/Detail Coordination
Activities
Chapter 20
Copyright Oracle Corporation, 2000. All rights reserved.
Master/Detail Coordination Activities
Chapter 20 - Page 2
Master/Detail Coordination Activities
Copyright Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination Activities


Master/Detail Coordination Activities
Copyright Oracle Corporation, 2000. All rights reserved.
Master/Detail Coordination Activities
Chapter 20 - Page 3
Objectives
Copyright Oracle Corporation, 2000. All rights reserved.

Objectives
Objectives
After this lesson you should be able to:
Describe the concept of Master/Detail coordination
activities.
After this lesson you should be able to:
Describe the concept of Master/Detail coordination
activities.
Copyright Oracle Corporation, 2000. All rights reserved.
Master/Detail Coordination Activities
Chapter 20 - Page 4
Master/Detail Coordination Activities
Copyright Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination Activities


Master/Detail Coordination Activities
Master/Detail coordination activities allow you to
coordinate the flow of master and detail
processes.
Spawning a detail process from a master process,
in effect, creates a separate detail process with its
own unique item type and item key.
Master/Detail coordination activities allow you to
coordinate the flow of master and detail
processes.
Spawning a detail process from a master process,
in effect, creates a separate detail process with its
own unique item type and item key.
Defining the Master/Detail Relationship
The relationship between two processes is defined by making a call to the
Workflow Engine API SetItemParent after you call the
CreateProcess API and before calling the StartProcess API when you
create the detail process.
Two activities are used to coordinate the flow in the master and detail processes.
One activity pauses a process and the other signals the halted process to
continue. One activity is placed in the master process the other in the detail
process.
Each of the activities contains two attributes used to identify the coordinating
activity in the other process.
Wait for Flow Activity
Place this activity in a master or detail process to pause the flow until the other
corresponding detail or master process completes a specified activity. This
activity calls a PL/SQL procedure WF_STANDARD.WAITFORFLOW.
The Wait for Flow activity contains two attributes:
Continuation Flow: Specify whether this activity is waiting for a
corresponding Master or Detail process to complete.
Continuation Activity: Specify the label of the activity node that must
complete in the corresponding process before the current process
continues. Default value is CONTINUEFLOW.
Copyright Oracle Corporation, 2000. All rights reserved.
Master/Detail Coordination Activities
Chapter 20 - Page 5
Master/Detail Coordination Activities (continued)
Copyright Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination Activities


(continued)
Master/Detail Coordination Activities
(continued)
Master/Detail coordination activities allow you to
coordinate the flow of master and detail
processes.
Spawning a detail process from a master process,
in effect, creates a separate detail process with its
own unique item type and item key.
Master/Detail coordination activities allow you to
coordinate the flow of master and detail
processes.
Spawning a detail process from a master process,
in effect, creates a separate detail process with its
own unique item type and item key.
Defining the Master/Detail Relationship (continued)
Continue Flow Activity
Use this activity to mark the position in the corresponding detail or master
process where, upon completion, the halted process is to continue. This
activity calls a PL/SQL procedure WF_STANDARD.CONTINUEFLOW.
The Continue Flow activity contains two attributes:
Waiting Flow: Specify whether the halted process which is waiting
for this activity to complete is a Master or Detail flow.
Waiting Activity: Specify the label of the activity node in the
halted process that is waiting for this activity to complete.
Copyright Oracle Corporation, 2000. All rights reserved.
Master/Detail Coordination Activities
Chapter 20 - Page 6
Example of Master Process
Copyright Oracle Corporation, 2000. All rights reserved.

Example of Master Process


Example of Master Process
Master Process
In the master process above, the Start Detail Flows activity initiates
several detail processes. The master process then completes Activity 1
before it pauses at the Wait for Flow activity. Wait for Flow is defined to
wait for all its detail processes to complete a Continue Flow activity
before allowing the master process to transition to Activity 2.
Copyright Oracle Corporation, 2000. All rights reserved.
Master/Detail Coordination Activities
Chapter 20 - Page 7
Example of Detail Process
Copyright Oracle Corporation, 2000. All rights reserved.

Example of Detail Process


Example of Detail Process
Detail Process
When a detail process begins it completes Activity A, when it reaches the
Continue Flow activity it signals to the Workflow Engine that the master
process can now continue from the Wait for Flow activity. The detail
process itself then transitions to Activity B.
Note: For further information on Master/Detail Coordination Activities
please see the Oracle Workflow Guide (Release 2.5), chapter 6 Predefined
Workflow Activities.
Copyright Oracle Corporation, 2000. All rights reserved.
Master/Detail Coordination Activities
Chapter 20 - Page 8
Copyright Oracle Corporation, 2000. All rights reserved.
Extra Practices
Chapter 21 - Page 1
Extra Practices
Chapter 21
Copyright Oracle Corporation, 2000. All rights reserved.
Extra Practices
Chapter 21 - Page 2
Extra Practices
Copyright Oracle Corporation, 2000. All rights reserved.

Extra Practices
Extra Practices
Copyright Oracle Corporation, 2000. All rights reserved.
Extra Practices
Chapter 21 - Page 3
Extra Practice 1 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Extra Practice 1 Overview


Extra Practice 1 Overview
This practice covers the following topics:
Creating a function or process activity that uses
an activity attribute to control processing
This practice covers the following topics:
Creating a function or process activity that uses
an activity attribute to control processing
Copyright Oracle Corporation, 2000. All rights reserved.
Extra Practices
Chapter 21 - Page 4
Extra Practice 2 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Extra Practice 2 Overview


Extra Practice 2 Overview
This practice covers the following topics:
Changing the Vacation Proposal notification into a
vote and implementing RUN and TIMEOUT
function mode logic in the post-notification
function
check the Expand Roles checkbox on the
notification activity
with the potential for multiple responses to the
Vacation Proposal, how should the result be
determined?
should the SCHEDULE_UPDATE logic be
moved to the post-notification procedure?
This practice covers the following topics:
Changing the Vacation Proposal notification into a
vote and implementing RUN and TIMEOUT
function mode logic in the post-notification
function
check the Expand Roles checkbox on the
notification activity
with the potential for multiple responses to the
Vacation Proposal, how should the result be
determined?
should the SCHEDULE_UPDATE logic be
moved to the post-notification procedure?
Copyright Oracle Corporation, 2000. All rights reserved.
Extra Practices
Chapter 21 - Page 5
Extra Practice 3 Overview
Copyright Oracle Corporation, 2000. All rights reserved.

Extra Practice 3 Overview


Extra Practice 3 Overview
This practice covers the following topics:
Anticipating customization of a process by end
users
build in customization points for
enhancements such as:
allowing users to self-approve vacation
under certain circumstances
hooking the Vacation Proposal process into
communicating with a time reporting
application
featuring Block/Complete Activity or
Advanced Queue integration
This practice covers the following topics:
Anticipating customization of a process by end
users
build in customization points for
enhancements such as:
allowing users to self-approve vacation
under certain circumstances
hooking the Vacation Proposal process into
communicating with a time reporting
application
featuring Block/Complete Activity or
Advanced Queue integration
Copyright Oracle Corporation, 2000. All rights reserved.
Extra Practices
Chapter 21 - Page 6

You might also like