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
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


i
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


ii
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


iii
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


iv
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


v
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


vi
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


vii
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


ix
Related Publications

Oracle Publications

Title Part Number

Oracle Workflow Guide Release 2.5 A75397

Additional Publications

• System release bulletins

• Installation and user’s guides

• read.me files

• Oracle Applications User’s Group (OAUG) articles

• Oracle Magazine

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contents


x
Typographic Conventions

Typographic Conventions in Text

Convention Element Example


Bold italic Glossary term (if The algorithm inserts the new key.
there is a glossary)

Caps and Buttons, Click the Executable button.


lowercase check boxes, Select the Can’t Delete Card check box.
triggers, Assign a When-Validate-Item trigger to the
windows ORD block.
Open the Master Schedule window.

Courier new, Code output, Code output: debug.set (‘I”, 300);


case sensitive directory names, Directory: bin (DOS), $FMHOME (UNIX)
(default is filenames, Filename: Locate the init.ora file.
lowercase) passwords, Password: User tiger as your password.
pathnames, Pathname: Open c:\my_docs\projects
URLs, URL: Go to http://www.oracle.com
user input,
User input: Enter 300
usernames
Username: Log on as scott

Initial cap Graphics labels Customer address (but Oracle Payables)


(unless the term is a
proper noun)

Italic Emphasized words Do not save changes to the database.


and phrases, For further information, see Oracle7 Server
titles of books and SQL Language Reference Manual.
courses, Enter user_id@us.oracle.com,
variables where user_id is the name of the user.
Quotation Interface elements Select “Include a reusable module component”
marks with long names and click Finish.
that have only
initial caps; This subject is covered in Unit II, Lesson 3,
lesson and chapter “Working with Objects.”
titles in cross-
references

Uppercase SQL column Use the SELECT command to view


names, commands, information stored in the LAST_NAME
functions, schemas, column of the EMP table.
table names

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contents


xi
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 Oracle Forms When-Validate-Item
lowercase triggers
Lowercase Column names, SELECT last_name
table names FROM s_emp;

Passwords DROP USER scott


IDENTIFIED BY tiger;
PL/SQL objects OG_ACTIVATE_LAYER
(OG_GET_LAYER
(‘prod_pie_layer’))

Lowercase Syntax variables CREATE ROLE role


italic
Uppercase SQL commands and SELECT userid
functions 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


xii
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


xiii
Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contents


xiv
Oracle Workflow Release 2.5
Introduction
Chapter 1

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 Introduction


Chapter 1 - Page 1
Oracle Workflow Release 2.5

Oracle
Oracle Workflow
Workflow Release
Release 2.5
2.5

Introduction
Introduction

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 Introduction


Chapter 1 - Page 2
Objectives

Objectives
Objectives
After
After this
this course,
course, you
you should
should be
be able
able to:
to:
•• Explain
Explain why
why you
you would
would use
use Workflow
Workflow
•• Design
Design aa workflow
workflow process
process using
using Oracle
Oracle Workflow
Workflow
Builder
Builder
•• Define
Define your
your Oracle
Oracle Workflow
Workflow users
users and
and roles
roles
•• View
View and
and respond
respond to
to notification
notification activities
activities
•• Monitor
Monitor and
and administer
administer the
the status
status of
of aa workflow
workflow
process
process
•• Write
Write custom
custom PL/SQL
PL/SQL procedures
procedures that
that can
can be
be
executed as automated functions in a workflow
executed as automated functions in a workflow
process
process
•• Set
Set up
up Oracle
Oracle Workflow
Workflow for
for your
your site
site
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 Introduction


Chapter 1 - Page 3
Agenda

Agenda
Agenda

•• Overview
Overview of
of Oracle
Oracle Workflow
Workflow
•• Planning
Planning and
and Creating
Creating aa Workflow
Workflow Process
Process
•• Defining
Defining Function
Function and
and Process
Process Activities
Activities
•• Diagramming
Diagramming aa Workflow
Workflow Process
Process
•• Advanced
Advanced Features
Features

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 Introduction


Chapter 1 - Page 4
Overview

Overview
Overview

•• This
This course
course provides
provides detailed
detailed information
information about
about
Oracle
Oracle Workflow
Workflow andand its
its components
components so
so that
that you
you
can use its technology to workflow-enable
can use its technology to workflow-enable anyany
application
application based
based on
on Oracle
Oracle

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 Introduction


Chapter 1 - Page 5
Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 Introduction


Chapter 1 - Page 6
Why Workflow?
Chapter 2

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 1
Why Workflow?

Why
Why Workflow?
Workflow?

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Explain
Explain why
why you
you would
would use
use Workflow
Workflow
•• Explain
Explain and
and describe
describe Workflow
Workflow processes
processes

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 3
All Businesses Must Become E-Businesses

All
All Businesses
Businesses
Must
Must Become
Become E-Businesses
E-Businesses
Streamlined business processes plays a critical role
with the transformation to e-business

The wiring for


Oracle Workflow e-business

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 4
Oracle Workflow

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

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 5
Workflow Driven Business Processes

Workflow
Workflow Driven
Driven Business
Business Processes
Processes
Manage the process, not the transactions

•• Define
Define and
and implement
implement your
your business
business policies
policies
•• Streamline
Streamline the
the entire
entire process
process
•• Capture
Capture exceptions
exceptions and
and take
take action
action
•• Build
Build continuous
continuous improvements
improvements directly
directly into
into the
the
process
process definition
definition
•• Adapt
Adapt your
your processes
processes as
as your
your business
business changes
changes

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 6
Example Workflow Processes

Example
Example Workflow
Workflow Processes
Processes
Order Flow - Generic with Header Level Invoicing

Ente r Bo ok - Orde r, He a de r le ve l Clos e - Ord e r End


Ma nua l Invoice - Orde r

Line Flow - Generic with Header Level Invoicing


Unre s e rve

Ente r - Line S che dule - Line Cre a te S upply - S hip - Line , He a d e r Le ve l Clos e - Line End
Line Ma nua l Invo ice - Line ,
De fe rre d

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 7
Designing Business Processes for Change

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.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 8
Workflow is Essential

Workflow
Workflow is
is Essential
Essential
Workflow enables continuous process improvement
•• Complete
Complete process
process representation
representation
–– Crosses
Crosses organizational,
organizational, company
company boundaries
boundaries
–– Build
Build in
in management
management metrics,
metrics, performance
performance
goals
goals
•• Adaptable
Adaptable workflow
workflow processes
processes
–– Provides
Provides alternatives
alternatives
–– Allow
Allow for
for refinement
refinement
•• Analyze
Analyze time
time and
and costs
costs of
of entire
entire processes
processes with
with
multidimensional
multidimensional analysis
analysis
–– Reducing
Reducing costs
costs and
and time
time
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 9
Expense Report Processing

Expense
Expense Report
Report Processing
Processing
Fast and efficient payment of expense
Goal: reports that conform to corporate
policy
Technique: Workflow enabled Self Service
Expense Reports

•• Accounts
Accounts Payables
Payables professionals
professionals should
should spend
spend
their
their time:
time:
–– Entering
Entering expense
expense reports
reports
–– Responding
Responding to to the
the telephone
telephone queries
queries
regarding
regarding the
the status
status of
of an
an expense
expense report
report
–– Defining
Defining and
and enforcing
enforcing corporate
corporate policy,
policy,
saving
saving the
the company
company money
money
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 10
Common Expense Reports Questions

Common
Common Expense
Expense Reports
Reports Questions
Questions
Workflow empowers the process participants
•• Has
Has my
my expense
expense report
report been
been approved?
approved?
•• Which
Which manager
manager is
is holding
holding up
up my
my expense
expense report?
report?
•• Has
Has the
the Accounts
Accounts Payable
Payable department
department verified
verified my
my
receipts?
receipts?
•• When
When will
will II get
get paid?
paid?
•• Why
Why am
am II always
always short
short paid?
paid?

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 11
Common Expense Reports Questions

Common
Common Expense
Expense Reports
Reports Questions
Questions
Workflow empowers the process participants
•• Has
Has my
my expense
expense report
report been
been approved?
approved?
•• Which
Which manager
manager is
is holding
holding up
up my
my expense?
expense?
•• Has
Has the
the Accounts
Accounts Payable
Payable department
department verified
verified my
my
receipts?
receipts?
•• When
When will
will II get
get paid?
paid?
•• Why
Why am
am II always
always short
short paid?
paid?

Let’s take a look at the process

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 12
Expense Report Processing

Expense
Expense Report
Report Processing
Processing
AP Standard Expense Report Process

AP Approva l
Approve d

Ma na ge r Approva l

S e rve r Va lida tion Approve S ho rtP a y


S ta rt De te rmine S e rve r S id e Ma na ge r AP Approva l S hortpa y End (Approve )
Which P roce s s Va lida tion (S pe nding) P roce s s Unve rifie d
To S ta rt From P roce s s Approva l Re ce ipt Ite ms
P roce s s

Re je ct

Re s ubmit Re port Abort


Re je ction End (Re je ct)
P roce s s

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 13
Expense Report Processing @ Oracle

Expense
Expense Report
Report Processing
Processing @
@ Oracle
Oracle

Ye s No Ye s
S ta rt Any Re ce ipt AP Expe ns e AP Adjus tme nt All Expe ns e Ma rk Expe ns e End (Approve d)
Re quire d For Re port Re vie w Ma de Due To Line s P a s s AP Re port As
Expe ns e Re port Comple te S p e nding P o licy Approva l Approve d
NonComplia nce (Ma nua l)
No
Ye s
No

End (S hortP a y)
Ye s
Any J us tifica tion Re que s t AP To
Re quire d for Re vie w For Ge t Adjus tme nt Inform P re pa re r
Expe ns e Re port complia nce With Te xt Tha t Expe ns e
S p e nding P o licy Re port Ha s
No Be e n Adjus te d

Approve d
(Automa tic)

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 14
New Hire Processing

New
New Hire
Hire Processing
Processing

Goal: Empower managers in the hiring


process and hiring the best people
Technique: Workflow enable Self Service Hiring

•• Hiring
Hiring Managers
Managers should
should spend
spend their
their time:
time:
–– Determining
Determining whose
whose approval
approval is
is required
required
–– Chasing
Chasing the
the HR
HR department
department toto mail
mail offer
offer
letters
letters
–– Interviewing
Interviewing candidates,
candidates, hiring
hiring the
the
best
best people
people

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 15
New Hire Process @ Oracle

New
New Hire
Hire Process
Process @
@ Oracle
Oracle
Enabling e-business at Oracle

Acce p te d

End (Acce p te d)

De cline d
App ro ve d
Initia lize Offe r Obta in Offe r P roce s s Offe r End (De cline d)
P ro ce s s App rova l

Re je cte d

<De fa ult>

End (De cline d)


End (De cline d )

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 16
New Hire Process @ Oracle

New
New Hire
Hire Process
Process @
@ Oracle
Oracle
Enabling e-business at Oracle

End (Acce pte d)

De cline d
Approve d
Initia lize Offe r Obta in Offe r Proce s s Offe r End (De cline d)
Proce s s Approva l

Re je cte d

<De fa ult>

End (De cline d)


End (De cline d)

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 17
New Hire Process @ Oracle

New
New Hire
Hire Process
Process @
@ Oracle
Oracle
Enabling e-business at Oracle

Notify Fa cilitie s End (Acce pte d)


of Ne w Hire

De cline d
Approve d
Initia lize Offe r Obta in Offe r Proce s s Offe r End (De cline d)
P roce s s Approva l

Re je cte d

<De fa ult>

End (De cline d)


End (De cline d)

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 18
New Hire Process @ Oracle

New
New Hire
Hire Process
Process @
@ Oracle
Oracle
Enabling e-business at Oracle

Notify Fa cilitie s End (Acce pte d)


Acce pte d of Ne w Hire

De cline d
Approve d
Initia lize Offe r Obta in Offe r Proce s s Offe r End (De cline d)
Proce s s Approva l

Re je cte d

<De fa ult>

End (De cline d)


End (De cline d)

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 19
Workflow Enabled e-business Suite

Workflow
Workflow Enabled
Enabled e-business
e-business Suite
Suite

Workflow enabled

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 20
Workflow Enabled e-business Suite

Workflow
Workflow Enabled
Enabled e-business
e-business Suite
Suite
Workflow enforces a common set of business rules

Self-Service
Workflow

Professional .

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 21
Workflow

Workflow
Workflow

Workflow
is much more
than approvals

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?
Chapter 2 - Page 22
Overview of Oracle Workflow
Chapter 3

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Chapter 3 - Page 1
Overview of Oracle Workflow

Overview
Overview of
of Oracle
Oracle Workflow
Workflow

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Chapter 3 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Understand
Understand the
the concept
concept of
of aa workflow
workflow process
process
•• Describe
Describe the
the architecture
architecture of
of Oracle
Oracle Workflow
Workflow
•• Describe
Describe Oracle
Oracle Workflow’s
Workflow’s features
features

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Chapter 3 - Page 3
Overview

Overview
Overview

•• Routes
Routes Information
Information
•• Defines
Defines any
any rule
rule
•• Delivers
Delivers electronic
electronic notifications
notifications

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Workflow Architecture

Workflow
Workflow Architecture
Architecture
Directory Services

Users Roles
Web
Notification
Worklist

Notification Services Engine Workflow


Send Execution Builder
Web Oracle
Process Application Respond Definition
Monitor Server
or Forward Administration Workflow
WebDB Loader
Cancel Monitoring
Web
Analysis
Query Query
Tools
Workflow
Definition
Files
Mail Notification
Applications Oracle Workflow Enabled Application
Mailer

End-User Application Workflow


Client Server Oracle Server Development
Client
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
Oracle Workflow Features and Definitions

Oracle
Oracle Workflow
Workflow Features
Features and
and Definitions
Definitions

•• Oracle
Oracle Workflow
Workflow Builder
Builder
•• Workflow
Workflow Engine
Engine
•• Workflow
Workflow Definitions
Definitions Loader
Loader
•• Notification
Notification System
System
•• Notification
Notification Worklist
Worklist
•• Directory
Directory Services
Services
•• Workflow
Workflow Monitor
Monitor

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Chapter 3 - Page 6
Oracle Workflow Builder

Oracle
Oracle Workflow
Workflow Builder
Builder

•• Development
Development tooltool for
for Oracle
Oracle Workflow
Workflow
–– Used
Used to
to graphically
graphically define
define and
and customize
customize the the
workflow definitions
workflow definitions
–– Requires
Requires aa PC PC running
running Windows
Windows 95,95, 98,
98, 2000
2000
or
or Windows
Windows NT NT
•• Workflow
Workflow definitions:
definitions: youyou can
can save
save them
them toto aa
database
database oror aa flat
flat file
file
•• There
There are
are two
two parts
parts to
to the
the Workflow
Workflow Builder:
Builder:
–– Object
Object Navigator
Navigator
–– Process
Process Diagram
Diagram

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Workflow Process Definition

Workflow
Workflow Process
Process Definition
Definition

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Supported Process Constructs

Supported
Supported Process
Process Constructs
Constructs

• Looping
• Results-based
branching

• Parallel flows
• Rendezvous

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
Supported Process Constructs

Supported
Supported Process
Process Constructs
Constructs

• Voting

• Timeouts
– Escalation
– Automatic
forwarding

• Subprocesses
(unlimited
hierarchy)

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Chapter 3 - Page 10
Workflow Engine

Workflow
Workflow Engine
Engine

•• Is
Is embedded
embedded in in the
the Oracle8i
Oracle8i server
server
•• Uses
Uses the
the process
process definition
definition created
created with
with Oracle
Oracle
Workflow
Workflow Builder to coordinate the routing of
Builder to coordinate the routing of
activities
activities for
for the
the process
process
•• Monitors
Monitors the
the state
state ofof each
each activity
activity in
in aa workflow
workflow
process
process
•• Signals
Signals any
any changes
changes in in the
the workflow
workflow state
state to
to the
the
engine
engine using
using calls
calls to
to PL/SQL
PL/SQL oror Java
Java API’s
API’s
•• Guarantees
Guarantees consistency
consistency between
between the
the application
application
and
and the
the workflow
workflow state
state because
because ofof Oracle8i
Oracle8i
transactional
transactional integrity
integrity

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Chapter 3 - Page 11
Workflow Definitions Loader

Workflow
Workflow Definitions
Definitions Loader
Loader

Workflow
Builder
Workflow Workflow
Loader Engine

Workflow
Loader

Proc
ess Oracle 8 or higher
Process
Defin
Definition
itions

Copyright  Oracle Corporation, 2000. All rights reserved.

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 12
Notification System

Notification
Notification System
System

Notification e.g. UNIX Sendmail


Mailer or MAPI compliant
Workflow
Mail System
Engine

Workflow
Worklist
Directory Notification
Services System

Application Oracle
Applications
Screens

Oracle 8 or higher

Copyright  Oracle Corporation, 2000. All rights reserved.

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 13
Notification Worklist Web Page

Notification
Notification Worklist
Worklist Web
Web Page
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 14
Notification Details Web Page

Notification
Notification Details
Details Web
Web Page
Page

Extended HTML
message formats

Research and make a decision


through online inquiry

Copyright  Oracle Corporation, 2000. All rights reserved.

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 15
Email Notifications

Email
Email Notifications
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 16
Email Notifications - Response Template

Email
Email Notifications
Notifications -- Response
Response Template
Template

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Chapter 3 - Page 17
Directory Services

Directory
Directory Services
Services

•• WF_USERS
WF_USERS
–– Contains
Contains information
information on
on the
the user
user names,
names,
display
display names for the users, their notification
names for the users, their notification
preference
preference and
and their
their e-mail
e-mail addresses
addresses
•• WF_USER_ROLES
WF_USER_ROLES
–– Contains
Contains information
information on
on the
the association
association of
of the
the
users
users to
to the
the roles
roles
•• WF_ROLES
WF_ROLES
–– Contains
Contains information
information on
on the
the roles
roles of
of which
which
users
users can
can be
be members
members

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Oracle Workflow Monitor

Oracle
Oracle Workflow
Workflow Monitor
Monitor

Copyright  Oracle Corporation, 2000. All rights reserved.

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 19
Oracle Workflow Monitor

Oracle Workflow Monitor

Copyright  Oracle Corporation, 2000. All rights reserved.

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 20
Oracle Workflow Monitor

Oracle Workflow Monitor

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Chapter 3 - Page 21
Demonstration

Demonstration
Demonstration

Using Oracle Workflow we will demonstrate how to:

•• Start
Start aa Workflow
Workflow process
process
•• Follow
Follow aa Workflow
Workflow process
process through
through to
to completion
completion
•• Make
Make changes
changes to
to aa Workflow
Workflow process
process

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle Workflow


Chapter 3 - Page 22
Planning a Workflow Process
Chapter 4

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 1
Planning a Workflow Process

Planning
Planning aa Workflow
Workflow Process
Process

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Identify
Identify the
the components
components of
of aa workflow
workflow process
process
•• Plan
Plan aa workflow
workflow process
process

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 3
Process Components

Process
Process Components
Components
Item Type

Process

Functions Notifications Subprocesses


Messages,
Lookup Functions,
Lookup
... Types,
Types,
Notifications, ...
Attributes Lookup
Attributes Types

... ...

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Oracle Workflow Builder

Oracle
Oracle Workflow
Workflow Builder
Builder

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 5
Oracle Workflow Builder (continued)

Oracle
Oracle Workflow
Workflow Builder
Builder (continued)
(continued)
•• Is
Is used
used to
to create
create the
the components
components of of the
the process
process
•• Consists
Consists ofof aa navigator
navigator tree
tree which
which lists
lists all
all process
process
components
components
•• Groups
Groups all
all components
components intointo an
an Item
Item Type
Type
•• Each
Each Item
Item Type
Type includes
includes the
the following
following branches
branches
–– Attributes
Attributes
–– Processes
Processes (Subprocesses)
(Subprocesses)
–– Notifications
Notifications
–– Functions
Functions
–– Messages
Messages
–– Lookup
Lookup Types
Types
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 6
Planning a Workflow Process

Planning
Planning aa Workflow
Workflow Process
Process

1.
1. Identify
Identify your
your business
business needs
needs
2.
2. Identify
Identify the
the activities
activities that
that will
will accomplish
accomplish thosethose
needs.
needs. For
For example:
example:
a.
a. What
What is is the
the activity’s
activity’s type:
type: Function,
Function,
Notification, or Process?
Notification, or Process?
b.
b. Will
Will an
an activity’s
activity’s result
result affect
affect the
the transition
transition that
that
the
the Workflow
Workflow Engine
Engine takes?
takes? IfIf so,
so, define
define the
the
activity’s
activity’s possible
possible results
results asas lookup
lookup codes
codes in
in aa
lookup
lookup type
type

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 7
Planning a Workflow Process (continued)

Planning
Planning aa Workflow
Workflow Process
Process (continued)
(continued)

3.
3. Identify
Identify how
how the
the process
process will
will be
be initiated.
initiated. For
For
example:
example:
a.
a. What
What condition
condition initiates
initiates the
the process?
process? Is Is itit aa
completed transaction, a database
completed transaction, a database exception,exception,
aa button
button onon aa form,
form, or
or some
some otherother condition?
condition?
b.
b. Will
Will there
there be
be an
an interface
interface toto initiate
initiate the
the
process?
process? ForFor example,
example, the
the Web
Web Requisition
Requisition
Approvals
Approvals process
process in in Oracle
Oracle WebWeb Employees
Employees
4.
4. Identify
Identify the
the possible
possible results
results of
of the
the process.
process. Define
Define
the possible results as lookup codes
the possible results as lookup codes in a lookupin a lookup
type
type

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 8
Activities and Lookup Types

Activities
Activities and
and Lookup
Lookup Types
Types

}
T
E Result A
Process: F
N
Y
S E Result B

Function: PL/SQL code


returns Result
Result T

Result F } Result Type =


Lookup Type

FYI ‘Send’ Attributes

}
Notification: Message Result Y
Response ‘Send’ and RESULT
Required ‘Respond’ Attributes Result N
Resp 1
Resp 2
...

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
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 10
Creating a New Process from Bottom Up

Creating
Creating aa New
New Process
Process from
from Bottom
Bottom Up
Up

1.
1. Define
Define the
the item
item type
type of
of the
the process.
process.
2.
2. Define
Define the
the item
item type
type attributes
attributes for
for the
the process.
process.
3.
3. Define
Define lookup
lookup types
types and
and lookup
lookup codes.
codes.
4.
4. Define
Define messages.
messages.
5.
5. Define
Define message
message attributes.
attributes.
6.
6. Define
Define the
the activities
activities in
in the
the process
process asas Function,
Function,
Notification, or Process.
Notification, or Process.
7.
7. Diagram
Diagram the
the relationship
relationship of of the
the activities.
activities.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 11
Creating a New Process from Top Down

Creating
Creating aa New
New Process
Process from
from Top
Top Down
Down

1.
1. Use
Use the
the QuickStart
QuickStart Wizard
Wizard to
to create
create the
the process
process
framework.
framework.
2.
2. Define
Define activities
activities without
without underlying
underlying dependencies.
dependencies.
3.
3. Diagram
Diagram thethe relationship
relationship ofof the
the activities.
activities.
4.
4. Define
Define item
item type
type attributes
attributes for
for the
the process.
process.
5.
5. Define
Define lookup
lookup types
types and
and lookup
lookup codes.
codes.
6.
6. Define
Define messages.
messages.
7.
7. Define
Define message
message attributes.
attributes.
8.
8. Update
Update processes,
processes, functions,
functions, and
and notifications
notifications
with
with underlying
underlying components.
components.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 12
Demonstration

Demonstration
Demonstration

In Oracle Workflow we will show :

•• Samples
Samples of
of Oracle
Oracle Applications
Applications R11i
R11i workflow
workflow
processes
processes

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 13
Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow Process


Chapter 4 - Page 14
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 1
Defining Item Types, Item Attributes, and Lookup Types

Defining
Defining Item
Item Types,
Types, Item
Item Attributes,
Attributes, and
and
Lookup Types
Lookup Types

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup Types


Chapter 5 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Create
Create anan item
item type
type
•• Create
Create an
an item
item type
type selector/callback
selector/callback function
function
•• Create
Create item
item type
type attributes
attributes
•• Create
Create lookup
lookup types
types

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup Types


Chapter 5 - Page 3
Create a New Workflow Process Definition

Create
Create aa New
New Workflow
Workflow Process
Process
Definition
Definition

To create a new workflow process:


• Define the item type of the process
• Define item type attributes for the process
• Define lookup types and lookup codes
• Define messages
• Define message attributes
• Define the activities in the process as Function,
Notification, or Process
• Diagram the relationship of the activities

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup Types


Chapter 5 - Page 4
Top-Down Design

Top-Down
Top-Down Design
Design

•• Draw
Draw the
the process
process diagram
diagram first
first and
and then
then define
define the
the
underlying
underlying components.
components.
•• Create
Create new
new activities
activities while
while drawing
drawing aa process
process
diagram.
diagram.
•• View
View activity
activity and
and process
process activity
activity property
property pages
pages
from
from one
one dialogue.
dialogue.
•• Property
Property page
page includes
includes all
all tabs
tabs for
for base
base activity
activity of
of
the node and the usage of the individual
the node and the usage of the individual node. node.
•• Save
Save aa partially
partially completed
completed or or errored
errored process
process and
and
complete
complete oror correct
correct later.
later.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup Types


Chapter 5 - Page 5
Quick Start Wizard

Quick
Quick Start
Start Wizard
Wizard

The steps listed on the earlier slide were the required


steps for previous versions of Oracle Workflow.
While these steps are still valid for Release 2.5 they
are no longer required. A new Workflow Builder menu
option guides you through building a workflow
process.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Quick Start Wizard (Continued)

Quick
Quick Start
Start Wizard
Wizard (Continued)
(Continued)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Quick Start Wizard (Continued)

Quick
Quick Start
Start Wizard
Wizard (Continued)
(Continued)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Define an Item Type

Define
Define an
an Item
Item Type
Type

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
Item Type Selector/Callback Function

Item
Item Type
Type Selector/Callback
Selector/Callback Function
Function

•• The
The Workflow
Workflow Engine
Engine can
can call
call the
the selector/callback
selector/callback
function
function with
with one
one of
of three
three commands:
commands:
–– RUN:
RUN: selects
selects the
the appropriate
appropriate process
process to
to start
start
–– SET_CTX:
SET_CTX: setssets any
any item
item type
type context
context
information
information needed
needed forfor aa function
function activity,
activity,
prior
prior to
to executing
executing the
the function
function activity
activity in
in aa new
new
database
database session
session
–– TEST_CTX:
TEST_CTX: determines
determines whether
whether aa form
form can
can bebe
launched with the current item type
launched with the current item type contextcontext
information
information just
just before
before thethe Notification
Notification Detail
Detail
Web
Web page launches a reference form
page launches a reference form

Copyright  Oracle Corporation, 2000. All rights reserved.

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 10
Define Item Type Attributes

Define
Define Item
Item Type
Type Attributes
Attributes

•• What
What should
should bebe considered
considered an an item
item type
type attribute?
attribute?
–– Information
Information required
required by by notification
notification messages,
messages,
such
such as the display format of a currency value
as the display format of a currency value
–– Information
Information required
required by by function
function activities,
activities,
such
such as
as values
values that
that link
link back
back to to applications
applications
data
data like
like aa person_ID
person_ID
–– Information
Information maintained
maintained by by aa workflow
workflow activity,
activity,
such
such as
as activities
activities that
that identify
identify whowho to
to forward
forward
information
information toto and
and from
from in in aa loop
loop construct
construct

Copyright  Oracle Corporation, 2000. All rights reserved.

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 11
Define Item Type Attributes (continued)

Define
Define Item
Item Type
Type Attributes
Attributes (continued)
(continued)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 attribute’s 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 12
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 13
Form Attributes

Form
Form Attributes
Attributes

Click on form icon to launch


Oracle Applications form

Copyright  Oracle Corporation, 2000. All rights reserved.

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 14
Document Attributes

Document
Document Attributes
Attributes
You can specify the following types of documents in
the default value field:

•• PL/SQL
PL/SQL document:
document: aa document
document representing
representing data
data
from
from the
the database,
database, generated
generated from
from aa PL/SQL
PL/SQL
procedure.
procedure.
–– Ideal
Ideal for
for use
use when
when document
document content
content varies
varies
–– For
For example,
example, purchase
purchase orders
orders with
with variable
variable
number
number of lines or sales orders with
of lines or sales orders with variable
variable
lines,
lines, discounts,
discounts, and
and shipping
shipping addresses
addresses
•• DM
DM document:
document: aa document
document managed
managed byby an
an
external
external document
document management
management system
system

Copyright  Oracle Corporation, 2000. All rights reserved.

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 15
URL Attributes

URL
URL Attributes
Attributes

Copyright  Oracle Corporation, 2000. All rights reserved.

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 16
Activities and Lookup Types

Activities
Activities and
and Lookup
Lookup Types
Types

}
T
E Result A
Process: F
N
Y
S E Result B

Function: PL/SQL code


returns Result
Result T

Result F } Result Type =


Lookup Type

FYI ‘Send’ Attributes

}
Notification: Message Result Y
Response ‘Send’ and RESULT
Required ‘Respond’ Attributes Result N
Resp 1
Resp 2
...

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Define Lookup Types

Define
Define Lookup
Lookup Types
Types

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Define Lookup Codes

Define
Define Lookup
Lookup Codes
Codes

Copyright  Oracle Corporation, 2000. All rights reserved.

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 19
Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup Types


Chapter 5 - Page 20
Defining a Notification
Activity
Chapter 6

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 1
Defining a Notification Activity

Defining
Defining aa Notification
Notification Activity
Activity

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Define
Define aa message
message
•• Define
Define aa message
message attribute
attribute
•• Define
Define aa notification
notification activity
activity

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 3
Workflow Terms

Workflow
Workflow Terms
Terms

•• Notification
Notification Activity
Activity
–– A
A task
task that
that requires
requires human
human intervention.
intervention. AA
notification
notification activity sends a message to a user
activity sends a message to a user
containing
containing the
the information
information needed
needed to
to complete
complete
the
the work.
work.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 4
Create a New Workflow Process Definition

Create
Create aa New
New Workflow
Workflow Process
Process
Definition
Definition

To create a new workflow process:


• Define the item type of the process
• Define item type attributes for the process
• Define lookup types and lookup codes
• Define messages
• Define message attributes
• Define the activities in the process as Function,
Notification, or Process
• Diagram the relationship of the activities

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 5
Define a Message

Define
Define aa Message
Message

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Define a Message (Continued)

Define
Define aa Message
Message (Continued)
(Continued)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Define a Message Attribute

Define
Define aa Message
Message Attribute
Attribute

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Define a Respond Attribute

Define
Define aa Respond
Respond Attribute
Attribute

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
Respond Attributes in an E-mail Notification

Respond
Respond Attributes
Attributes in
in an
an E-mail
E-mail
Notification
Notification

Copyright  Oracle Corporation, 2000. All rights reserved.

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 attribute’s 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 10
Respond Attributes in the Notifications Web Page

Respond
Respond Attributes
Attributes in
in the
the Notifications
Notifications
Web
Web Page
Page

Copyright  Oracle Corporation, 2000. All rights reserved.

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 11
Define a Notification Activity

Define
Define aa Notification
Notification Activity
Activity

Copyright  Oracle Corporation, 2000. All rights reserved.

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 12
Standard PL/SQL API for Calling Functions

Standard
Standard PL/SQL
PL/SQL API
API for
for Calling
Calling
Functions
Functions

•• All
All PL/SQL
PL/SQL stored
stored procedures
procedures called
called by
by
notification
notification activities
activities in
in an
an Oracle
Oracle Workflow
Workflow
process
process should
should follow
follow the
the standard
standard API
API format
format so
so
that
that the Workflow Engine can properly execute the
the Workflow Engine can properly execute the
activity.
activity.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 13
Execution Modes

Execution
Execution Modes
Modes

•• Notification
Notification activity
activity with
with aa post-notification
post-notification
function
function modes
modes are:
are:
–– RESPOND
RESPOND
–– FORWARD
FORWARD
–– TRANSFER
TRANSFER
–– RUN
RUN
–– TIMEOUT
TIMEOUT

Copyright  Oracle Corporation, 2000. All rights reserved.

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 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 a Notification Activity


Chapter 6 - Page 15
Standard Voting Activity

Standard
Standard Voting
Voting Activity
Activity

Copyright  Oracle Corporation, 2000. All rights reserved.

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 16
Define Notification Activity Details

Define
Define Notification
Notification Activity
Activity Details
Details

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Define a Dynamic Priority for a Notification

Define
Define aa Dynamic
Dynamic Priority
Priority for
for aa
Notification
Notification

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Practice Les 6-1 Overview

Practice
Practice Les
Les 6-1
6-1 Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Planning
Planning aa Notification
Notification Only
Only Process
Process
•• Using
Using the
the QuickStart
QuickStart Wizard
Wizard
•• Designing
Designing aa Process
Process Top
Top Down
Down
•• Creating
Creating Item
Item Attributes
Attributes and
and Messages
Messages
•• Setting
Setting Node
Node Properties
Properties
(message,
(message, performer,
performer, Start/End)
Start/End)
•• Saving
Saving aa Process
Process

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 19
Practice Les 6-1 Overview Continued

Practice
Practice Les
Les 6-1
6-1 Overview
Overview Continued
Continued

Create
Create aa process
process that:
that:
•• Starts.
Starts.
•• Sends
Sends aa vacation
vacation proposal
proposal from
from an
an employee
employee to to
his
his manager
manager prompting
prompting the
the manager
manager to to approve
approve oror
reject.
reject. Allows
Allows the
the manager
manager toto respond
respond with
with
alternate
alternate vacation
vacation dates
dates and
and comments.
comments.
•• IfIf the
the proposal
proposal is
is approved,
approved, sends
sends aa notification
notification to
to
the
the requestor
requestor reporting
reporting the
the vacation
vacation is
is approved.
approved.
•• IfIf the
the proposal
proposal is
is rejected,
rejected, gives
gives the
the requestor
requestor thethe
option
option to to resubmit
resubmit another
another vacation
vacation proposal
proposal toto
the
the same
same manager.
manager.
•• Ends.
Ends.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 20
Guided Practice Les 6-1: Planning a Notification Only
Process

Guided
Guided Practice
Practice Les
Les 6-1:
6-1:
Planning
Planning aa Notification
Notification Only
Only Process
Process

1.
1. Start
Start with
with aa rough
rough sketch
sketch of
of aa process
process that:
that:
a.
a. sends
sends aa vacation
vacation proposal
proposal from
from an
an employee
employee
to
to his
his manager
manager andand prompts
prompts himhim to
to approve
approve or
or
reject
reject
b.
b. on
on manager
manager approval,
approval, sends
sends aa notification
notification to
to
the
the requestor reporting the vacation proposal
requestor reporting the vacation proposal
is
is rejected
rejected
c.
c. on
on manager
manager reject,
reject, gives
gives the
the requestor
requestor the
the
option
option toto resubmit
resubmit another
another vacation
vacation proposal
proposal
to
to the
the same
same manager
manager
d.
d. has
has two
two end
end points
points reflecting
reflecting the
the approve
approve and
and
reject paths through the process
reject paths through the process
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 21
Guided Practice Les 6-1: Using the Quick Start Wizard

Guided
Guided Practice
Practice Les
Les 6-1:
6-1:
Using
Using the
the Quick
Quick Start
Start Wizard
Wizard

2.
2. Create
Create aa new
new Item
Item Type
Type with
with an
an internal
internal name
name ofof
“WFVACXX”
“WFVACXX” where where XX XX is
is the
the unique
unique number
number
assigned
assigned toto your
your station.
station. The
The display
display name
name
should
should also include “XX” to make itit easy
also include “XX” to make easy for
for you
you
to identify your Item Type. For example,
to identify your Item Type. For example, the the
internal
internal name
name maymay be be “WFVAC02”
“WFVAC02” and and the
the display
display
name
name may
may be
be “02
“02 Vacation
Vacation Proposal”.
Proposal”.

Hint:
Hint: Use
Use menu
menu option
option File
File ->
-> Quick
Quick Start
Start Wizard
Wizard

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 22
Guided Practice Les 6-1: Designing a Process Top
Down

Guided
Guided Practice
Practice Les
Les 6-1:
6-1:
Designing
Designing aa Process
Process Top
Top Down
Down

3.
3. In
In the
the Builder
Builder Navigator,
Navigator, use
use Edit
Edit ->
-> Find
Find to
to locate
locate
the
the ‘End’
‘End’ function
function in
in the
the Standard
Standard item
item type.
type. Drag
Drag
and
and drop
drop this
this function
function into
into your
your process
process diagram
diagram
to
to create
create an
an additional
additional End
End node.
node.

In
In the
the Builder
Builder Process
Process diagram,
diagram, use
use the
the New
New
Notification
Notification tool
tool bar
bar icon
icon to
to create
create notification
notification
activity
activity nodes.
nodes. Draw
Draw transitions
transitions between
between nodes
nodes
according
according toto your
your process
process sketch.
sketch.
–– Hint:
Hint: Make
Make use
use of
of the
the Approval
Approval and
and Yes/No
Yes/No
lookup
lookup types
types provided
provided in in the
the Standard
Standard item
item
type.
type.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 23
Guided Practice Les 6-1: Creating Supporting Item
Attributes

Guided
Guided Practice
Practice Les
Les 6-1:
6-1:
Creating
Creating Supporting
Supporting Item
Item Attributes
Attributes

4.
4. In
In the
the Builder
Builder Navigator,
Navigator, create
create the
the item
item attributes
attributes
to
to support
support your
your process.
process.
–– Hint:
Hint: Create
Create Role
Role type
type item
item attributes
attributes for
for the
the
Vacation
Vacation Requestor
Requestor and and Vacation
Vacation Approver.
Approver.
Create
Create Date
Date type
type item
item attributes
attributes for
for the
the
Vacation Start and End dates.
Vacation Start and End dates.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 24
Guided Practice Les 6-1: Creating Supporting
Messages

Guided
Guided Practice
Practice Les
Les 6-1:
6-1:
Creating
Creating Supporting
Supporting Messages
Messages

5.
5. In
In the
the Builder
Builder Navigator,
Navigator, create
create the
the messages
messages to to
support
support youryour process.
process.
a.
a. Create
Create aa proposal
proposal message
message that
that includes
includes the
the
name
name of of the
the requestor
requestor andand the
the start
start and
and end
end
dates
dates ofof the
the proposed
proposed vacation.
vacation. AsAs well
well as
as the
the
Approve/Reject result, the message
Approve/Reject result, the message should should
include
include respond
respond attributes
attributes for
for comments
comments and and
allow
allow the manager to suggest an alternate
the manager to suggest an alternate
vacation
vacation datedate window.
window.
–– Hint:
Hint: Drag
Drag and
and drop
drop the
the appropriate
appropriate item
item
attributes
attributes toto the
the message
message to to create
create
message
message attributes.
attributes.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 25
Guided Practice Les 6-1: Creating Supporting
Messages Continued

Guided
Guided Practice
Practice Les
Les 6-1:
6-1:
Creating
Creating Supporting
Supporting Messages
Messages Continued
Continued

b.
b. Create
Create aa proposal
proposal rejected
rejected message
message that
that
allows
allows the
the vacation
vacation requestor
requestor to
to resubmit
resubmit the
the
vacation
vacation proposal
proposal toto the
the same
same manager
manager with
with
the
the original
original or
or modified
modified date
date window.
window.
–– Hint:
Hint: Use
Use the
the Yes/No
Yes/No lookup
lookup type
type provided
provided
in the Standard item type.
in the Standard item type.
–– Hint:
Hint: Make
Make from
from date
date and
and to
to date
date respond
respond
message
message attributes.
attributes.
c.
c. Create
Create aa proposal
proposal accepted
accepted FYI
FYI message.
message.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 26
Guided Practice Les 6-1: Setting Selected Node
Properties

Guided
Guided Practice
Practice Les
Les 6-1:
6-1:
Setting
Setting Selected
Selected Node
Node Properties
Properties

6.
6. In
In the
the Builder
Builder Process
Process Diagram,
Diagram, set
set Properties
Properties to
to
complete
complete your
your process.
process.
a.
a. Assign
Assign aa Message
Message to
to each
each Notification
Notification Node.
Node.
b.
b. Set
Set the
the Performer
Performer for
for each
each Notification
Notification Node
Node
–– the
the Vacation Proposal recipient should be
Vacation Proposal recipient should be
the
the manager
manager
–– the
the Proposal
Proposal Rejected
Rejected and
and Proposal
Proposal
Approved
Approved recipients
recipients should
should be
be the
the vacation
vacation
requestor
requestor
c.
c. Set
Set the
the Start/End
Start/End on
on each
each End
End Node.
Node.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 27
Guided Practice Les 6-1: Saving Your Process

Guided
Guided Practice
Practice Les
Les 6-1:
6-1:
Saving
Saving Your
Your Process
Process

7.
7. In
In the
the Builder
Builder Navigator,
Navigator,
a.
a. Verify
Verify the
the definition
definition using
using File
File ->
-> Verify.
Verify.
b.
b. Save
Save your
your new
new data
data store
store and
and Item
Item Type
Type toto aa
workflow
workflow definition
definition file.
file.
c.
c. Save
Save your
your Item
Item Type
Type and
and process
process definition
definition toto
aa test
test database.
database.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 28
Les 6-1 Summary

Les
Les 6-1
6-1 Summary
Summary

In
In this
this practice,
practice, you
you should
should have
have learned
learned how
how to:
to:
•• plan
plan aa simple
simple notification
notification only
only approval
approval process
process
•• use
use the
the Quick
Quick Start
Start Wizard
Wizard toto create
create an
an Item
Item Type
Type
and
and Process
Process
•• find,
find, drag
drag and
and drop
drop activities
activities into
into aa process
process
•• design
design aa process
process top
top down
down within
within the
the Process
Process
Window
Window
•• create
create item
item attributes
attributes and
and messages
messages
•• set
set node
node properties
properties
•• save
save aa process
process to
to aa workflow
workflow definition
definition file
file and
and to
to
aa database
database
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 29
Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification Activity


Chapter 6 - Page 30
Overview of the Workflow
Directory Service
Chapter 7

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory Service


Chapter 7 - Page 1
Overview of the Workflow Directory Service

Overview
Overview of
of the
the
Workflow
Workflow Directory Service
Directory Service

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory Service


Chapter 7 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Explain
Explain howhow Oracle
Oracle Workflow
Workflow receives
receives information
information
about a role
about a role
•• Map
Map Oracle
Oracle Workflow
Workflow to
to your
your directory
directory repository
repository

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory Service


Chapter 7 - Page 3
Terms

Terms
Terms

•• Role
Role
•• Directory
Directory Repository
Repository

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Directory Service Views

Directory
Directory Service
Service Views
Views

•• WF_USERS
WF_USERS
•• WF_ROLES
WF_ROLES
•• WF_USER_ROLES
WF_USER_ROLES

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
WF_USERS View

WF_USERS
WF_USERS View
View
Columns in WF_USERS contain the following
information:
•• Name:
Name: Internal
Internal name
name of
of aa user
user
•• Display
Display Name:
Name: Display
Display name
name ofof aa user
user
•• Description:
Description: Description
Description of
of aa user
user
•• Notification
Notification Preference:
Preference: AA value
value of
of MAILTEXT,
MAILTEXT,
MAILATTH,
MAILATTH, MAILHTML,
MAILHTML, QUERY
QUERYor or SUMMARY
SUMMARY to to
indicate
indicate how
how user
user prefers
prefers to
to receive
receive notifications
notifications
•• Language:
Language: NLS_LANGUAGE
NLS_LANGUAGE initialization
initialization
parameter
parameter that specifies
that specifies the
the default
default language-
language-
dependent
dependent behavior
behavior
•• Territory:
Territory: NLS_TERRITORY
NLS_TERRITORY initialization
initialization parameter
parameter
that
that specifies
specifies the
the default
default language-dependent
language-dependent date date
and
and numeric
numeric formatting
formatting used
used
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory Service


Chapter 7 - Page 6
WF_USERS View (continued)

WF_USERS
WF_USERS View
View (continued)
(continued)

•• Email_Address:
Email_Address: Valid
Valid email
email address
address for
for the
the user
user or
or
mail
mail distribution
distribution list
list
•• Fax:
Fax: A
A fax
fax number
number for
for the
the user
user
•• Orig_System:
Orig_System: NameName identifying
identifying the
the base
base tables
tables of
of
this
this view
view
•• Orig_System_ID:
Orig_System_ID: Primary
Primary key
key that
that identifies
identifies this
this
user
user in
in the
the base
base tables
tables
•• Status:
Status: ACTIVE,
ACTIVE, EXTLEAVE,
EXTLEAVE, INACTIVE,
INACTIVE,
TMPLEAVE
TMPLEAVE are the status
are the status choices
choices
•• Expiration_date:
Expiration_date: DateDate at
at which
which the
the user
user is
is no
no
longer
longer valid
valid in
in the
the directory
directory service
service
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
WF_ROLES View

WF_ROLES
WF_ROLES View
View
Workflow roles can be roles, positions or
responsibilities referenced in a directory repository.
The columns in WF_ROLES are similar to those in
WF_USERS view:

•• Name
Name
•• Display
Display Name
Name
•• Description
Description
•• Notification
Notification Preference
Preference
•• Language
Language

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory Service


Chapter 7 - Page 8
WF_ROLES View (continued)

WF_ROLES
WF_ROLES View
View (continued)
(continued)

•• Territory
Territory
•• Email_Address
Email_Address
•• Fax
Fax
•• Orig_System
Orig_System
•• Orig_System_ID
Orig_System_ID
•• Expiration_date
Expiration_date

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
WF_USER_ROLES View

WF_USER_ROLES
WF_USER_ROLES View
View

WF_USER_ROLES is an intersection of the users and


roles in WF_USER and WF_ROLES.

•• User_Name:
User_Name: Internal
Internal name
name of
of the
the user
user asas listed
listed in
in
WF_USERS
WF_USERS view view
•• User_Orig_System:
User_Orig_System: Name Name assigned
assigned to to the
the
directory
directory repository that WF_USERSis
repository that WF_USERS is based
based onon
•• User_Orig_System_ID:
User_Orig_System_ID: Primary
Primary key
key that
that identifies
identifies
this
this user
user in
in the
the user
user directory
directory repository
repository

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory Service


Chapter 7 - Page 10
WF_USER_ROLES View (continued)

WF_USER_ROLES
WF_USER_ROLES View
View (continued)
(continued)

•• Role_Name:
Role_Name: Internal
Internal name
name of
of the
the user
user as
as listed
listed in
in
WF_ROLES
WF_ROLES view view
•• Role_Orig_System:
Role_Orig_System: Name Name assigned
assigned to to the
the
directory
directory repository that WF_ROLES is
repository that WF_ROLES is based
based on
on
•• Role_Orig_System_ID:
Role_Orig_System_ID: PrimaryPrimary key
key that
that identifies
identifies
this
this role
role in
in the
the role
role directory
directory repository
repository

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory Service


Chapter 7 - Page 11
Oracle Workflow Local Tables

Oracle
Oracle Workflow
Workflow Local
Local Tables
Tables

•• WF_LOCAL_USERS
WF_LOCAL_USERS
•• WF_LOCAL_ROLES
WF_LOCAL_ROLES
•• WF_LOCAL_USER_ROLES
WF_LOCAL_USER_ROLES

Copyright  Oracle Corporation, 2000. All rights reserved.

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 12
Implementing Global User Preferences

Implementing
Implementing Global
Global User
User Preferences
Preferences

•• Interaction
Interaction with
with Oracle
Oracle Workflow
Workflow
•• Access
Access toto the
the Global
Global Preferences
Preferences Web
Web page
page
•• Override
Override aa default
default user
user preference
preference

Copyright  Oracle Corporation, 2000. All rights reserved.

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 13
User Preference Information

User
User Preference
Preference Information
Information

Copyright  Oracle Corporation, 2000. All rights reserved.

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 14
Ad Hoc Users/Roles

Ad
Ad Hoc
Hoc Users/Roles
Users/Roles

•• You
You can
can create
create and
and manage
manage ad ad hoc
hoc users
users and
and
roles
roles in
in aa workflow
workflow process.
process.
•• Use
Use server
server PL/SQL
PL/SQL APIs
APIs toto dynamically
dynamically create
create new
new
user
user and role definitions in the directory service.
and role definitions in the directory service.
The
The new
new APIs
APIs store
store the
the information
information inin the
the
WF_LOCAL_*
WF_LOCAL_* tables.
tables.
•• The
The WF_USERS
WF_USERS and and WF_ROLES
WF_ROLES views views use
use the
the
EXPIRATION_DATE.
EXPIRATION_DATE.
•• WF_LOCAL_USER_ROLES
WF_LOCAL_USER_ROLES keeps keeps track
track of
of the
the
originating system of the users and
originating system of the users and roles.roles.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 15
Directory Service for Oracle Applications

Directory
Directory Service
Service for
for Oracle Applications
Applications

•• Oracle
Oracle Workflow
Workflow ships
ships aa unified
unified directory
directory service
service
for
for Oracle
Oracle Applications—wfdirhrv.sql.
Applications—wfdirhrv.sql. The The unified
unified
directory service maps:
directory service maps:
–– WF_USERS
WF_USERS to to Oracle
Oracle HRMS
HRMS employees,
employees,
Oracle
Oracle Application/Oracle Self-Service
Application/Oracle Self-Service
Application
Application users,
users, Oracle
Oracle Receivables
Receivables
customer
customer contacts
contacts and
and WF_LOCAL_USERS.
WF_LOCAL_USERS.
–– WF_ROLES
WF_ROLES to to users
users in
in WF_USERS,
WF_USERS, Oracle
Oracle
HRMS positions, Oracle Federal HR
HRMS positions, Oracle Federal HR group group
boxes,
boxes, Oracle
Oracle Applications
Applications responsibilities,
responsibilities,
Oracle
Oracle Engineering approval
Engineering approval lists,
lists, and
and
WF_LOCAL_ROLES.
WF_LOCAL_ROLES.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory Service


Chapter 7 - Page 16
Directory Services for Oracle Workflow Standalone
Version

Directory
Directory Services
Services for
for Oracle
Oracle Workflow
Workflow
Standalone
Standalone Version
Version

•• Two
Two sample
sample Directory
Directory Services
Services scripts
scripts are
are located
located
in
in the
the Oracle
Oracle Workflow
Workflow sqlsql subdirectory:
subdirectory:
–– wfdirouv.sql
wfdirouv.sql maps
maps workflow
workflow users
users and
and roles
roles to
to
the
the native
native users
users and
and roles
roles defined
defined in
in the
the
Oracle
Oracle RDBMS.
RDBMS.
–– wfdircsv.sql
wfdircsv.sql maps
maps workflow
workflow users
users and
and roles
roles to
to
the
the users
users and
and roles
roles stored
stored in
in the
the Oracle
Oracle
Workflow
Workflow local
local tables.
tables.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory Service


Chapter 7 - Page 18
Defining Function and
Process Activities
Chapter 8

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 1
Defining Function and Process Activities

Defining
Defining Function
Function and
and Process
Process Activities
Activities

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Define
Define aa function
function activity
activity
•• Define
Define anan activity
activity attribute
attribute
•• Apply
Apply the
the Workflow
Workflow Engine
Engine APIs
APIs to
to your
your function
function
activities
activities
•• Define
Define aa process
process activity
activity

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 3
Create a New Workflow Process Definition

Create
Create aa New
New Workflow
Workflow Process
Process
Definition
Definition

To create a new workflow process:


• Define the item type of the process
• Define item type attributes for the process
• Define lookup types and lookup codes
• Define messages
• Define message attributes
• Define the activities in the process as Function,
Notification, or Process
• Diagram the relationship of the activities

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 4
Define a Function Activity

Define
Define aa Function
Function Activity
Activity

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
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 6
Assigning a Cost to a Function Activity

Assigning
Assigning aa Cost
Cost to
to aa Function
Function Activity
Activity

•• Cost
Cost is is entered
entered inin seconds
seconds andand converted
converted to to
hundredths
hundredths of of aa second
second when
when stored
stored inin the
the
database.
database.
•• Assign
Assign aa highhigh cost
cost to
to function
function activities
activities that
that
require
require a large amount of processing to
a large amount of processing to complete.
complete.
•• IfIf the
the cost
cost of
of an
an activity
activity exceeds
exceeds the
the threshold
threshold
cost
cost of of the
the Workflow
Workflow Engine,
Engine, the
the activity
activity gets
gets
deferred
deferred by by the
the Workflow
Workflow Engine.
Engine.
•• A
A background
background engine
engine set
set up
up to
to poll
poll for
for deferred
deferred
activities
activities can execute the deferred activity at
can execute the deferred activity at aa
later time.
later time.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Standard PL/SQL API for Calling Functions

Standard
Standard PL/SQL
PL/SQL API
API for
for Calling
Calling
Functions
Functions
•• All
All PL/SQL
PL/SQL stored
stored procedures
procedures called
called by
by function
function
activities
activities in
in an
an Oracle
Oracle Workflow
Workflow process
process should
should
follow
follow the
the standard
standard API
API format
format so
so that
that the
the
Workflow
Workflow Engine
Engine can
can properly
properly execute
execute thethe activity.
activity.

procedure
procedure <procedure
<procedure name>
name>
(itemtype
(itemtype inin varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
actid
actid in
in number,
number,
funcmode
funcmode in
in varchar2,
varchar2,
resultout
resultout out
out varchar2)
varchar2)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Execution Modes

Execution
Execution Modes
Modes
•• Function
Function activity
activity modes:
modes:
–– RUN
RUN
–– Activities
Activities that
that are
are executed
executed for
for the
the first
first time
time
–– Follows
Follows CANCEL
CANCEL mode
mode on
on aa loop
loop reset
reset
–– CANCEL
CANCEL
–– Activities
Activities revisited
revisited asas part
part ofof aa loop
loop reset
reset
–– Activities
Activities that
that are
are part
part of
of aa process
process that
that has
has
been canceled by a call
been canceled by a call to to
WF_ENGINE.AbortProcess
WF_ENGINE.AbortProcess
–– Activities
Activities that
that are
are part
part of
of the
the process
process
stream
stream being
being undone
undone by by aa call
call to
to
WF_ENGINE.HandleError
WF_ENGINE.HandleError
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 9
Notification Activities Revisited

Notification
Notification Activities
Activities Revisited
Revisited
•• All
All PL/SQL
PL/SQL stored
stored procedures
procedures referenced
referenced by
by
notification
notification activities
activities in
in an
an Oracle
Oracle Workflow
Workflow
process
process should
should follow
follow the
the standard
standard API
API format
format so
so
that
that the
the Workflow
Workflow Engine
Engine can
can properly
properly execute
execute the
the
activity.
activity.

procedure
procedure <procedure
<procedure name>
name>
(itemtype in
(itemtype in varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
actid
actid in
in number,
number,
funcmode
funcmode in
in varchar2,
varchar2,
resultout
resultout out
out varchar2)
varchar2)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 10
resultout:=‘COMPLETE’;
return;
endif;
...

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 11
Notification Activities Revisited

Notification
Notification Activities
Activities Revisited
Revisited
•• All
All PL/SQL
PL/SQL stored
stored procedures
procedures referenced
referenced by
by
notification
notification activities
activities in
in an
an Oracle
Oracle Workflow
Workflow
process
process should
should follow
follow the
the standard
standard API
API format
format so
so
that
that the
the Workflow
Workflow Engine
Engine can
can properly
properly execute
execute the
the
activity.
activity.

procedure
procedure <procedure
<procedure name>
name>
(itemtype in
(itemtype in varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
actid
actid in
in number,
number,
funcmode
funcmode in
in varchar2,
varchar2,
resultout
resultout out
out varchar2)
varchar2)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 12
Execution Modes

Execution
Execution Modes
Modes

•• Notification
Notification activity
activity with
with aa post-notification
post-notification
function
function modes
modes are:
are:
–– RESPOND
RESPOND
–– FORWARD
FORWARD
–– TRANSFER
TRANSFER
–– RUN
RUN
–– TIMEOUT
TIMEOUT

Copyright  Oracle Corporation, 2000. All rights reserved.

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 13
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 14
Post-Notification Function

Post-Notification
Post-Notification Function
Function

•• Reference
Reference Global
Global WF_ENGINE
WF_ENGINE variables
variables in
in PL/SQL
PL/SQL
•• Global
Global Context
Context Information
Information set:
set:
–– WF_ENGINE.context_nid
WF_ENGINE.context_nid == notification_ID
notification_ID
–– WF_ENGINE.context_text
WF_ENGINE.context_text == new
new recipient_role
recipient_role
available
available in
in TRANSFER
TRANSFER or
or FORWARD
FORWARD mode mode
–– WF_ENGINE.context_text
WF_ENGINE.context_text == responder
responder
available in RESPOND mode
available in RESPOND mode

Copyright  Oracle Corporation, 2000. All rights reserved.

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 15
Exception Handling

Exception
Exception Handling
Handling

Debugging Function Activities

•• Use WF_CORE APIs


Use WF_CORE APIs to
to raise
raise and
and catch
catch errors
errors in
in
your
your PL/SQL
PL/SQL procedures
procedures
•• Engine
Engine sets
sets function
function activity
activity status
status “ERROR”
“ERROR” if: if:
–– PL/SQL
PL/SQL procedure
procedure raises
raises an
an unhandled
unhandled
exception
exception
–– PL/SQL
PL/SQL procedure
procedure returns
returns aa result
result beginning
beginning
with
with “ERROR:”
“ERROR:”

Copyright  Oracle Corporation, 2000. All rights reserved.

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 16
Exception Handling Example

Exception
Exception Handling
Handling Example
Example

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

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Defining a Function Activity Attribute

Defining
Defining aa Function
Function Activity
Activity Attribute
Attribute

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Defining a Process Activity

Defining
Defining aa Process
Process Activity
Activity

Copyright  Oracle Corporation, 2000. All rights reserved.

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 19
Defining Activity Details

Defining
Defining Activity
Activity Details
Details

Copyright  Oracle Corporation, 2000. All rights reserved.

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 20
Looping

Looping
Looping

•• Looping
Looping occurs
occurs when
when the
the completion
completion of of an
an activity
activity
causes
causes a transition to another activity that has
a transition to another activity that has
already
already been
been completed.
completed.
•• The
The first
first activity
activity detected
detected as
as aa revisited
revisited activity
activity is
is
also
also called
called aa loop
loop point
point or
or pivot
pivot activity.
activity.
•• The
The Workflow
Workflow Engine
Engine can
can handle
handle aa revisited
revisited
activity in one of three ways:
activity in one of three ways:
–– Ignore
Ignore
–– Reset
Reset
–– Re-execute
Re-execute

Copyright  Oracle Corporation, 2000. All rights reserved.

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 21
Looping

Looping
Looping

•• Non-canceling
Non-canceling Loop
Loop can
can improve
improve performance
performance by
by
preventing
preventing the
the rerun
rerun of
of functions
functions in
in CANCEL
CANCEL
mode.
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.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 22
Self-Looping Transitions

Self-Looping
Self-Looping Transitions
Transitions

Approve Or Approve End (Approve )

<Time out>
<Time out>
Sta rt Notify Re minde r-Approva l
Re quis ition Ne e de d
Approva l Activity loops
Re je ct
Re quire d Re je ct back to
Or End (Re je ct) itself
on Timeout

Copyright  Oracle Corporation, 2000. All rights reserved.

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 23
Default Error Process

Default
Default Error
Error Process
Process

The ‘System:Error’ Item Type contains the following


components:

•• Two
Two process
process activities
activities called
called Default
Default Error
Error
Process
Process and
and Retry-only
Retry-only
•• Four
Four function
function activities
activities called
called Abort,
Abort, Error
Error Still
Still
Active, Initialize Error, and Retry
Active, Initialize Error, and Retry
•• Two
Two Notification
Notification activities
activities called
called Notify
Notify
Administrator
Administrator andand NTF
NTF with
with RETRY
RETRY only
only

Copyright  Oracle Corporation, 2000. All rights reserved.

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 24
Error Handling

Error
Error Handling
Handling

•• Notify
Notify System
System Administrator
Administrator or or aa user
user of
of your
your
choice
choice ifif an
an unexpected
unexpected error
error occurs
occurs
•• Option
Option toto retry,
retry, abort
abort or
or ignore
ignore from
from the
the
notification
notification
•• Link
Link to
to directly
directly access
access administrator
administrator toolkit
toolkit on
on the
the
monitor
monitor forfor more
more complex
complex processing
processing
•• Automatically
Automatically terminates
terminates when
when error
error is
is no
no longer
longer
active
active

Copyright  Oracle Corporation, 2000. All rights reserved.

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 25
Error Handling (Continued)

Error
Error Handling
Handling (Continued)
(Continued)

Fa ls e
Error S till Active End

True <Time out>

Re try True
S ta rt Initia lize Error Notify Error S till Active Re try End
Adminis tra tor Fa ls e

Fa ls e End

Abort
True
Error S till Active Abort End

Re s olve d

End

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 26
Practice Les 8-1 Overview

Practice
Practice Les
Les 8-1
8-1 Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Creating
Creating aa PL/SQL
PL/SQL procedure
procedure forfor aa function
function
activity
activity
•• Creating
Creating aa Function
Function Activity
Activity
Note:
Note: You
You will
will have
have an an opportunity
opportunity to to test
test these
these
changes
changes inin aa later
later Practice.
Practice. The
The primary
primary goal
goal in
in
this
this practice
practice isis to
to get
get aa clean
clean compilation
compilation of of
your
your PL/SQL
PL/SQL procedure.
procedure.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 27
Practice Les 8-1 Overview Continued

Practice
Practice Les
Les 8-1
8-1 Overview
Overview Continued
Continued

•• Create
Create an an Employee
Employee Vacation
Vacation Schedule
Schedule Update
Update
PL/SQL
PL/SQL procedure
procedure thatthat includes
includes thethe following
following
logic
logic to to record
record an an approved
approved vacation
vacation proposal:
proposal:
–– ifif the
the function activity is called by the
function activity is called by the workflow
workflow
engine in RUN mode, insert the
engine in RUN mode, insert the requestor, requestor,
approver,
approver, and and vacation
vacation dates
dates into
into aa vacation
vacation
schedule
schedule table table (of
(of your
your own
own design)
design)
–– ifif the
the function
function activity
activity isis called
called inin CANCEL
CANCEL
mode, delete the appropriate
mode, delete the appropriate requestor, requestor,
approver,
approver, and and vacation
vacation date
date row
row from
from the
the
vacation schedule
vacation schedule table table
•• Create
Create aa function
function activity
activity to
to execute
execute thethe Employee
Employee
Vacation
Vacation Schedule
Schedule Update
Update PL/SQL
PL/SQL procedure
procedure ®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 28
Guided Practice Les 8-1 Creating a Vacation Schedule
Table

Guided
Guided Practice
Practice Les
Les 8-1
8-1
Creating
Creating aa Vacation
Vacation Schedule
Schedule Table
Table
1.
1. Create
Create aa Vacation
Vacation Schedule
Schedule Table
Table named
named
“WFVACXX_VACATION_SCHEDULE”
“WFVACXX_VACATION_SCHEDULE” where where XXXX is
is
the
the unique number assigned to your station, with
unique number assigned to your station, with
the
the following
following columns:
columns:
–– requestor
requestor varchar2(30)
varchar2(30)
–– approver
approver varchar2(30)
varchar2(30)
–– from_date
from_date date
date
–– to_date
to_date date
date

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 29
Guided Practice Les 8-1 Creating a PL/SQL Procedure

Guided
Guided Practice
Practice Les
Les 8-1
8-1
Creating
Creating aa PL/SQL
PL/SQL Procedure
Procedure
2.
2. Use
Use the
the standard
standard API
API format
format for
for your
your PL/SQL
PL/SQL
specification
specification and
and body.
body.
procedure
procedure <procedure
<procedure name>
name>
(itemtype
(itemtype inin varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
actid
actid in
in number,
number,
funcmode
funcmode in
in varchar2,
varchar2,
resultout
resultout out
out varchar2)
varchar2)
a.
a. Name
Name your
your package
package “WFVACXX”
“WFVACXX” where
where XX
XX is
is
the
the unique
unique number
number assigned
assigned to
to your
your station.
station.
b.
b. Give
Give your
your procedure
procedure aa descriptive
descriptive name
name such
such
as SCHEDULE_ UPDATE.
as SCHEDULE_ UPDATE.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 30
Guided Practice Les 8-1 RUN processing

Guided
Guided Practice
Practice Les
Les 8-1
8-1
RUN
RUN processing
processing

3.
3. In
In your
your PL/SQL
PL/SQL procedure
procedure include
include logic
logic for
for RUN
RUN
funcmode:
funcmode:
a.
a. retrieve
retrieve the
the values
values for
for requestor,
requestor, approver,
approver,
vacation
vacation from date, and vacation
from date, and vacation to
to date
date using
using
API
API calls to wf_engine.GetItemAttrText and
calls to wf_engine.GetItemAttrText and
wf_engine.GetItemAttrDate
wf_engine.GetItemAttrDate
b.
b. insert
insert aa row
row into
into your
your Vacation
Vacation Schedule
Schedule table
table
using
using the
the appropriate
appropriate item
item attribute
attribute values
values
c.
c. set
set resultout
resultout toto
wf_engine.eng_completed||’:’||wf_engine.eng_
wf_engine.eng_completed||’:’||wf_engine.eng_
null
null
d.
d. return
return
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 31
Guided Practice Les 8-1 CANCEL processing

Guided
Guided Practice
Practice Les
Les 8-1
8-1
CANCEL
CANCEL processing
processing
4.
4. In
In your
your PL/SQL
PL/SQL procedure
procedure include
include logic
logic for
for
CANCEL
CANCEL funcmode:
funcmode:
a.
a. retrieve
retrieve the
the values
values for
for requestor,
requestor, approver,
approver,
vacation
vacation from date, and vacation
from date, and vacation to
to date
date using
using
API
API calls to wf_engine.GetItemAttrText and
calls to wf_engine.GetItemAttrText and
wf_engine.GetItemAttrDate
wf_engine.GetItemAttrDate
b.
b. delete
delete the
the row
row from
from your
your Vacation
Vacation Schedule
Schedule
table
table based
based onon requestor,
requestor, approver,
approver, from
from and
and
to
to dates
dates
c.
c. set
set resultout
resultout to
to
wf_engine.eng_completed||’:’||wf_engine.eng_
wf_engine.eng_completed||’:’||wf_engine.eng_
null
null
d.
d. return
return ®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 32
Guided Practice Les 8-1 Adding a Function Activity

Guided
Guided Practice
Practice Les
Les 8-1
8-1
Adding
Adding aa Function
Function Activity
Activity
5.
5. Using
Using the
the Vacation
Vacation Proposal
Proposal process
process created
created in
in
practice
practice Les
Les 7-2,
7-2, open
open the
the Vacation
Vacation Proposal
Proposal
process
process diagram:
diagram:
a.
a. Delete
Delete the
the transition
transition between
between thethe Vacation
Vacation
Approved and End
Approved and End nodesnodes
b.
b. Click on
Click on the
the New
New Function
Function icon,
icon, position
position the
the
cross-hairs
cross-hairs between the Vacation Approved
between the Vacation Approved
and
and End
End nodes,
nodes, and
and click
click again
again to
to open
open the
the
properties
properties
c.
c. Enter
Enter unique
unique Internal
Internal and
and Display
Display Names,
Names,
select
select an appropriate icon ,, enter
an appropriate icon enter aa Function
Function
Name
Name with
with format
format <package.procedure>
<package.procedure> for for the
the
PL/SQL
PL/SQL procedure
procedure youyou just
just created
created
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 33
Guided Practice Les 8-1 Adding a Function Activity
Continued

Guided
Guided Practice
Practice Les
Les 8-1
8-1
Adding
Adding aa Function
Function Activity
Activity Continued
Continued
d.
d. Draw
Draw transitions
transitions from
from Vacation
Vacation Approved
Approved to
to
Update Schedule, Update Schedule to End
Update Schedule, Update Schedule to End

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 34
Les 8-1 Summary

Les
Les 8-1
8-1 Summary
Summary

In
In this
this practice,
practice, you
you should
should have
have learned
learned how
how to:
to:
•• Create
Create aa PL/SQL
PL/SQL procedure
procedure using
using the
the standard
standard API
API
format for function activities
format for function activities
•• Use
Use the
the Workflow
Workflow APIs
APIs to
to retrieve
retrieve item
item attribute
attribute
values
values
•• Write
Write logic
logic to
to allow
allow aa function
function activity
activity to
to run
run more
more
than
than once
once
•• Create
Create aa new
new function
function activity
activity and
and node
node

Copyright  Oracle Corporation, 2000. All rights reserved.

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 35
Practice Les 8-2 Overview Optional

Practice
Practice Les
Les 8-2
8-2 Overview
Overview
Optional
Optional

This
This optional
optional practice
practice covers
covers the
the following
following topics:
topics:
•• Creating
Creating aa PL/SQL
PL/SQL procedure
procedure to to perform
perform post-
post-
notification response processing
notification response processing
•• Adding
Adding Post-notification
Post-notification Response
Response processing
processing to to
aa Notification
Notification Activity
Activity
Note:
Note: YouYou will
will have
have an an opportunity
opportunity toto test
test these
these
changes
changes in in aa later
later Practice.
Practice. The
The primary
primary goal
goal
in
in this
this practice
practice is is to
to get
get aa clean
clean compilation
compilation of of
your PL/SQL procedure.
your PL/SQL procedure.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 36
Practice Les 8-2 Overview Continued

Practice
Practice Les
Les 8-2
8-2 Overview
Overview Continued
Continued

•• Create
Create aa PL/SQL
PL/SQL procedure
procedure that
that includes
includes the
the
following
following logiclogic to
to validate
validate action
action taken
taken on
on the
the
Vacation Proposal notification:
Vacation Proposal notification:
–– ifif the
the approver
approver rejects
rejects the
the Vacation
Vacation Proposal
Proposal
–– alternate
alternate vacation
vacation dates
dates must
must bebe provided
provided
–– alternate
alternate from
from date
date must
must be
be prior
prior to
to
alternate
alternate to
to date
date
–– the
the approver
approver is
is allowed
allowed to
to delegate
delegate (forward)
(forward)
the
the notification response to another
notification response to another role
role
–– the
the approver
approver is
is not
not allowed
allowed toto transfer
transfer the
the
notification
notification to
to another
another role
role
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 37
Practice Les 8-2 Overview Continued

Practice
Practice Les
Les 8-2
8-2 Overview
Overview Continued
Continued

•• Associate
Associate aa post-notification
post-notification function
function with
with the
the
Vacation
Vacation Proposal
Proposal notification
notification

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 38
Guided Practice Les 8-2 Creating a PL/SQL Procedure

Guided
Guided Practice
Practice Les
Les 8-2
8-2
Creating
Creating aa PL/SQL
PL/SQL Procedure
Procedure
1.
1. Use
Use the
the standard
standard API
API format
format for
for your
your PL/SQL
PL/SQL
specification
specification and
and body.
body.
procedure
procedure <procedure
<procedure name>
name>
(itemtype
(itemtype inin varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
actid
actid in
in number,
number,
funcmode
funcmode in
in varchar2,
varchar2,
resultout
resultout out
out varchar2)
varchar2)

a.
a. Add
Add toto your
your package
package “WFVACXX”
“WFVACXX” createdcreated in
in
practice
practice Les
Les 8-1.
8-1.
b.
b. Give
Give your
your procedure
procedure thethe same
same name
name as as the
the
internal
internal name
name ofof the
the notification
notification itit validates.
validates. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 39
Guided Practice Les 8-2 RESPOND processing

Guided
Guided Practice
Practice Les
Les 8-2
8-2
RESPOND
RESPOND processing
processing

2.
2. In
In your
your PL/SQL
PL/SQL procedure
procedure include
include logic
logic for
for
RESPOND
RESPOND funcmode:
funcmode:
a.
a. get
get the
the notification
notification id
id (nid)
(nid) from
from the
the engine
engine
context variable wf_engine.context_nid
context variable wf_engine.context_nid
b.
b. retrieve
retrieve the
the response
response result
result using
using API
API call
call
wf_notification.GetAttrText(nid,’RESULT’)
wf_notification.GetAttrText(nid,’RESULT’)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 40
Guided Practice Les 8-2 RESPOND processing
continued

Guided
Guided Practice
Practice Les
Les 8-2
8-2
RESPOND
RESPOND processing
processing continued
continued

3.
3. IfIf response
response is is APPROVED,
APPROVED, no
no further
further response
response
validation
validation is is needed
needed
a.
a. set
set the
the resultout
resultout to
to
wf_engine.eng_completed||’:’||<ntf
wf_engine.eng_completed||’:’||<ntf result
result
retrieved>
retrieved>
b.
b. return
return

Copyright  Oracle Corporation, 2000. All rights reserved.

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

Guided
Guided Practice
Practice Les
Les 8-2
8-2
RESPOND
RESPOND processing
processing continued
continued

4.
4. If
If response
response is is REJECTED,
REJECTED, retrieve
retrieve the
the alternate
alternate
from
from andand to
to dates
dates using
using API
API call
call
wf_notification.GetAttrDate(nid,<attribute_
wf_notification.GetAttrDate(nid,<attribute_ name>) name>)
a.
a. if
if the
the alternate
alternate dates
dates are
are valid,
valid, set
set resultout
resultout to
to
wf_engine.eng_completed||’:’||<ntf
wf_engine.eng_completed||’:’||<ntf result result
retrieved>
retrieved>
b.
b. ifif the
the alternate
alternate dates
dates are
are in
in error,
error, raise
raise an
an
exception
exception using
using API
API call
call wf_core.Raise(<your
wf_core.Raise(<your
message>)
message>) and and set
set resultout
resultout toto
wf_engine.eng_error||’:’||wf_engine.eng_null
wf_engine.eng_error||’:’||wf_engine.eng_null

Copyright  Oracle Corporation, 2000. All rights reserved.

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 FORWARD processing

Guided
Guided Practice
Practice Les
Les 8-2
8-2
FORWARD
FORWARD processing
processing

5.
5. In
In your
your PL/SQL
PL/SQL procedure
procedure include
include logic
logic for
for
TRANSFER
TRANSFER funcmode:
funcmode:
a.
a. raise
raise an
an exception
exception using
using API
API call
call
wf_core.Raise(<your
wf_core.Raise(<your message>) and
message>) and set
set
resultout to
resultout to
wf_engine.eng_error||’:’||wf_engine.eng_null
wf_engine.eng_error||’:’||wf_engine.eng_null

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 43
Guided Practice Les 8-2 FORWARD, RUN, TIMEOUT
processing

Guided
Guided Practice
Practice Les
Les 8-2
8-2
FORWARD,
FORWARD, RUN,
RUN, TIMEOUT
TIMEOUT processing
processing

6.
6. In
In your
your PL/SQL
PL/SQL procedure
procedure do
do not
not implement
implement logic
logic
for
for FORWARD,
FORWARD, RUN,
RUN, or
or TIMEOUT
TIMEOUT funcmodes:
funcmodes:
a.
a. no
no special
special logic
logic needed
needed
b.
b. set
set parameter
parameter resultout
resultout to
to wf_engine.eng_null
wf_engine.eng_null
to
to indicate the funcmode is
indicate the funcmode is not
not implemented
implemented

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process Activities


Chapter 8 - Page 44
Guided Practice Les 8-2 Adding a Post-Notification
Function

Guided
Guided Practice
Practice Les
Les 8-2
8-2
Adding
Adding aa Post-Notification
Post-Notification Function
Function
7.
7. In
In the
the Workflow
Workflow Builder
Builder Vacation
Vacation Proposal
Proposal process
process
diagram:
diagram:
a.
a. Open
Open thethe Properties
Properties for
for the
the Vacation
Vacation Proposal
Proposal
notification
notification node
node and
and enter
enter aa Function
Function Name
Name
with
with format
format <package.procedure>
<package.procedure> for for the
the
PL/SQL
PL/SQL procedure
procedure you
you just
just created.
created.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 45
Les 8-2 Summary

Les
Les 8-2
8-2 Summary
Summary

In
In this
this practice,
practice, youyou should
should have
have learned
learned how
how to:
to:
•• Create
Create aa PL/SQL
PL/SQL procedure
procedure using
using the
the standard
standard API
API
format for notification activity functions
format for notification activity functions
•• Write
Write post-notification
post-notification processing
processing to to validate
validate and
and
reject
reject aa notification
notification response
response
•• Write
Write post-notification
post-notification processing
processing to to prevent
prevent
transfer
transfer ofof aa notification
notification
•• Write
Write post-notification
post-notification processing
processing to to allow
allow aa
notification to be delegated
notification to be delegated
•• Assign
Assign aa function
function to to aa notification
notification activity
activity

Copyright  Oracle Corporation, 2000. All rights reserved.

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.

Defining Function and Process Activities


Chapter 8 - Page 46
Diagramming a Workflow
Process
Chapter 9

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 1
Diagramming a Workflow Process

Diagramming
Diagramming aa Workflow
Workflow Process
Process

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson
lesson you
you should
should be
be able
able to:
to:
•• Diagram
Diagram aa workflow
workflow process
process
•• Incorporate
Incorporate standard
standard activities
activities in
in aa process
process
•• Review
Review the
the process
process definition
definition for
for the
the item
item type
type

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 3
Create a New Workflow Process Definition

Create
Create aa New
New Workflow
Workflow Process
Process
Definition
Definition

To create a new workflow process:


• Define the item type of the process
• Define item type attributes for the process
• Define lookup types and lookup codes
• Define messages
• Define message attributes
• Define the activities in the process as Function,
Notification, or Process
• Diagram the relationship of the activities

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 4
Loading Roles

Loading
Loading Roles
Roles

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
Diagramming a Process

Diagramming
Diagramming aa Process
Process
Each process diagram must have one or more Start
activities and one or more End activities.
1.
1. To
To begin
begin drawing
drawing aa process
process diagram,
diagram, you
you must
must
display
display the
the process
process window.
window. This
This can
can be
be done
done in in
several
several ways:
ways:
a.
a. Double-click
Double-click on
on the
the process
process activity
activity on
on the
the
navigator tree.
navigator tree.
b.
b. Select
Select the
the process
process activity
activity and
and press
press Ctrl
Ctrl ++ E.
E.
c.
c. Select
Select the
the process
process activity
activity and
and choose
choose Process
Process
Details
Details from
from the
the Edit
Edit menu.
menu.
d.
d. Use
Use the
the Quick
Quick Start
Start Wizard
Wizard toto create
create aa process
process
activity
activity and initial diagram with Start
and initial diagram with Start and
and End
End
nodes.
nodes.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 6
Quick Start Wizard

Quick
Quick Start
Start Wizard
Wizard

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Diagramming a Process (continued)

Diagramming
Diagramming aa Process
Process (continued)
(continued)

2.
2. Create
Create aa new
new node
node inin the
the process
process byby using
using one
one of
of
the
the following
following methods:
methods:
a.
a. Select
Select an
an activity
activity (process,
(process, function
function or or
notification)
notification) from
from the
the navigator
navigator tree
tree and
and drag
drag itit
to the process window
to the process window
b.
b. Choose from
Choose from the
the New
New
Function/Process/Notification
Function/Process/Notification toolbar
toolbar button
button
c.
c. Choose
Choose Create
Create Activity
Activity from
from the
the right
right mouse
mouse
button
button menu
menu while
while your
your cursor
cursor is
is in
in the
the
process
process window
window

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Show Label in Designer Menu Option

Show
Show Label
Label in
in Designer
Designer Menu
Menu Option
Option

Copyright  Oracle Corporation, 2000. All rights reserved.

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 activity’s performer as the label for each
activity node
Comment: Uses the activity’s comment as the label for each
activity node

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 9
Display Modes

Display
Display Modes
Modes

Standard icons
used for display

Object Internal names


®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 10
Diagramming a Process (continued)

Diagramming
Diagramming aa Process
Process (continued)
(continued)

3.
3. Create
Create aa transition
transition (arrow)
(arrow) between
between two
two nodes
nodes byby
holding
holding down
down thethe right
right mouse
mouse button
button and
and
dragging
dragging thethe cursor
cursor from
from the
the source
source activity
activity to
to the
the
destination activity.
destination activity.
4.
4. Choose
Choose aa result
result from
from thethe list
list of
of possible
possible result
result
codes
codes that
that appear
appear ifif the
the source
source activity
activity has
has aa
result
result type
type defined.
defined.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 doesn’t 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 11
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 12
Self-Looping Transitions

Self-Looping
Self-Looping Transitions
Transitions

Activity loops
back to itself
on Timeout

Copyright  Oracle Corporation, 2000. All rights reserved.

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 13
<Any> Transitions

<Any>
<Any> Transitions
Transitions
Approve

Docume nt End (Approve )


Approve d

S ta rt Re vie w
Docume nt
Ye s
Re je ct
No
Docume nt End (Re je ct)
Re je cte d
<Any>

Log Re vie w
Automatic parallel branching
with the
<Any> transition
®

Copyright  Oracle Corporation, 2000. All rights reserved.

<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 14
Top Down Design

Top
Top Down
Down Design
Design
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.

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 15
Top Down Design

Palette permits Top


Top Down
Down Design
Design
creating processes,
notifications or
functions without
underlying
dependencies

No need to
specify function
at this point

Functions can be created


while designing
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 16
Validation Performed by the Verify Command

Validation
Validation Performed
Performed by
by the
the Verify
Verify
Command
Command

•• At
At least
least one
one Start
Start and
and one
one End
End activity
activity exists.
exists.
•• A
A process
process does
does not
not contain
contain itself
itself as
as aa process
process
activity.
activity.
•• The
The same
same subprocess
subprocess is is not
not being
being used
used twice
twice in
in aa
process.
process.
•• All
All possible
possible activity
activity results
results are
are modeled
modeled as as
outgoing
outgoing transitions.
transitions.
•• All
All activity
activity nodes
nodes marked
marked as as END
END nodes
nodes dodo not
not
have any outgoing transitions.
have any outgoing transitions.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Validation Performed by the Verify Command
(continued)

Validation
Validation Performed
Performed by
by the
the Verify
Verify
Command
Command (continued)
(continued)

•• Each
Each notification
notification activity's
activity's result
result type
type matches
matches the
the
lookup
lookup type
type defined
defined for
for the
the message's
message's RESULT
RESULT
message
message attribute.
attribute.
•• All
All message
message attributes
attributes referenced
referenced in in aa message
message
body
body for
for token
token substitution
substitution exist
exist in
in the
the message
message
definition.
definition.
•• All
All processes
processes thatthat reference
reference objects
objects from
from another
another
item
item type
type verify
verify the
the existence
existence ofof requisite
requisite item
item
attributes
attributes associated
associated with
with that
that referenced
referenced item.
item.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Editing a Transition

Editing
Editing aa Transition
Transition
1.
1. Select
Select the
the transition
transition youyou want
want to
to edit.
edit.
2.
2. Click
Click on the right mouse button to edit
on the right mouse button to edit the
the
transition
transition
–– Delete
Delete transition:
transition: deletes
deletes the
the selected
selected
transition
transition
–– Locked:
Locked: toggles
toggles between
between locking
locking andand
unlocking
unlocking the transition from further
the transition from further edits
edits
–– Hidden
Hidden label:
label: toggles
toggles between
between displaying
displaying and
and
hiding
hiding the
the transition
transition label
label
–– Straighten:
Straighten: straightens
straightens the
the transition
transition byby
removing
removing extra vertex points causing the
extra vertex points causing the bend
bend
–– Results:
Results: allows
allows changing
changing of of result
result label
label
already
already assigned
assigned
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 19
Editing a Transition (continued)

Editing
Editing aa Transition
Transition (continued)
(continued)
3.
3. Repositioning
Repositioning aa transition
transition label:
label: select
select the
the label
label
with
with the
the mouse
mouse and and drag
drag to
to the
the new
new position
position
4.
4. Bending
Bending aa transition:
transition: select
select the
the transition
transition and
and drag
drag
by
by holding
holding down
down thethe left
left mouse
mouse button
button toto create
create aa
vertex
vertex point.
point.
5.
5. Creating
Creating aa self-looping
self-looping transition:
transition: one
one of
of two
two ways
ways
–– Hold
Hold down
down right
right mouse
mouse button
button andand drag
drag
mouse
mouse from
from source
source activity
activity back
back to
to itself
itself
–– Draw
Draw aa transition
transition to to some
some other
other activity,
activity, add
add aa
vertex
vertex point to the transition, then select the
point to the transition, then select the
arrowhead
arrowhead with
with left
left mouse
mouse button
button and
and drag
drag
back
back to
to originating
originating activity
activity
6.
6. Removing
Removing vertex
vertex point:
point: select
select the
the vertex
vertex and
and drag
drag
over
over another
another toto combine
combine the the two
two points
points
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 20
Customizing a Process Node

Customizing
Customizing aa Process
Process Node
Node

Copyright  Oracle Corporation, 2000. All rights reserved.

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 21
Setting Activity Attribute Values

Setting
Setting Activity
Activity Attribute
Attribute Values
Values

Copyright  Oracle Corporation, 2000. All rights reserved.

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 22
Deleting Item Attributes

Deleting
Deleting Item
Item Attributes
Attributes

•• You
You use
use workflow
workflow builder
builder to
to delete
delete item
item attributes
attributes
from
from aa workflow
workflow definition
definition inin aa database
database
•• To
To actually
actually delete
delete an
an attribute
attribute fromfrom the
the database
database
you
you must be connected to that database. Deleting
must be connected to that database. Deleting
from
from aa flat
flat file
file and
and uploading
uploading it it will
will not
not delete
delete the
the
attribute
attribute from
from the
the database
database

Copyright  Oracle Corporation, 2000. All rights reserved.

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 23
Standard Activities

Standard
Standard Activities
Activities

Copyright  Oracle Corporation, 2000. All rights reserved.

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 24
Saving the Process Definition

Saving
Saving the
the Process
Process Definition
Definition

•• Always
Always savesave the the process
process definition
definition to
to aa flat
flat file
file for
for
source
source control.
control.
•• Before
Before saving
saving the the process
process definition
definition to
to the
the
production database, save to
production database, save to a developmenta development
database
database for for testing.
testing.
•• The
The Workflow
Workflow Loader Loader isis aa utility
utility program
program thatthat
moves
moves workflow
workflow definitions
definitions between
between database
database and and
flat
flat files.
files. ItIt is
is used
used to to move
move definitions
definitions between
between
development
development and and production
production databases,
databases, or or to
to
apply upgrades to existing definitions.
apply upgrades to existing definitions.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 25
Reviewing the Process Definition

Reviewing
Reviewing the
the Process
Process Definition
Definition

Copyright  Oracle Corporation, 2000. All rights reserved.

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 26
Version Compatibility

Version
Version Compatibility
Compatibility

•• All
All Oracle
Oracle Workflow
Workflow client
client modules
modules automatically
automatically
verify
verify that
that the
the module
module is is compatible
compatible with
with the
the
version
version of the Oracle Workflow server that itit is
of the Oracle Workflow server that is
operating
operating against.
against.
•• To
To determine
determine which
which version
version ofof the
the Oracle
Oracle
Workflow
Workflow server
server is
is running,
running, connect
connect to
to the
the
Workflow
Workflow server
server account
account using
using SQL/PLUS
SQL/PLUS and and
execute
execute the
the script
script wfver.sql
wfver.sql

Copyright  Oracle Corporation, 2000. All rights reserved.

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 27
Display Name Conflicts

Display
Display Name
Name Conflicts
Conflicts

•• IfIf aa nonunique
nonunique display
display name
name is is encountered
encountered during
during
upload/upgrade,
upload/upgrade, the the Workflow
Workflow Definition
Definition Loader
Loader
automatically
automatically resolves
resolves the
the display
display name
name conflict
conflict
by
by adding a “@” character to the beginning of
adding a “@” character to the beginning of
conflicting
conflicting display
display names.
names.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 28
Practice Les 9-1 Overview

Practice
Practice Les
Les 9-1
9-1 Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Creating
Creating aa Notification
Notification Timeout
Timeout
•• Adding
Adding aa Result
Result Type
Type to
to aa process
process
•• Adding
Adding an
an Error
Error Process
Process toto aa process
process
Note:
Note: You
You will
will have
have anan opportunity
opportunity to
to test
test these
these
changes
changes in
in aa later
later Practice.
Practice.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 29
Practice Les 9-1 Overview Continued

Practice
Practice Les
Les 9-1
9-1 Overview
Overview Continued
Continued

Using
Using the
the Vacation
Vacation Proposal
Proposal process
process created
created in
in
Practice Les 8-1 or 8-2:
Practice Les 8-1 or 8-2:
•• Add
Add aa Timeout
Timeout to
to the
the Vacation
Vacation Proposal
Proposal
notification
notification
•• Implement
Implement oneone of
of the
the following:
following:
–– On
On timeout,
timeout, transition
transition back
back to to the
the same
same
notification
notification until a response is received
until a response is received
–– On
On timeout,
timeout, transition
transition to
to aa loop
loop counter
counter and
and
back
back toto the
the Vacation
Vacation Proposal
Proposal 22 times,
times, on
on the
the
3rd
3rd loop
loop exit
exit to
to approve
approve the
the proposal
proposal
–– On
On timeout,
timeout, transition
transition to
to aa reminder
reminder
notification
notification
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 30
Practice Les 9-1 Overview Continued

Practice
Practice Les
Les 9-1
9-1 Overview
Overview Continued
Continued

•• Modify
Modify the
the Vacation
Vacation Proposal
Proposal process
process properties:
properties:
–– assign
assign Result
Result Type
Type ‘Approval’
‘Approval’
–– assign
assign Error
Error Process
Process DEFAULT_ERROR
DEFAULT_ERROR from
from
Error
Error Item
Item Type
Type WFERROR
WFERROR
•• Label
Label the
the two
two process
process End
End points
points with
with the
the
appropriate
appropriate result
result

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 31
Guided Practice Les 9-1 Adding a Timeout

Guided
Guided Practice
Practice Les
Les 9-1
9-1
Adding
Adding aa Timeout
Timeout
1.
1. In
In the
the Workflow
Workflow Builder
Builder open
open the
the Vacation
Vacation
Proposal
Proposal process diagram created in
process diagram created in Practice
Practice Les
Les
8-1 or 8-2:
8-1 or 8-2:
a.
a. Open
Open thethe Properties
Properties for
for the
the Vacation
Vacation Proposal
Proposal
notification
notification node.
node. Select
Select the
the Node
Node tab
tab and
and set
set
the
the Timeout.
Timeout.
–– Hint:
Hint: simplest
simplest method
method forfor testing
testing is
is to
to set
set
the Timeout Type to Relative Time
the Timeout Type to Relative Time and theand the
Value
Value to
to aa short
short duration
duration such
such asas 55 Minutes
Minutes

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 32
Guided Practice Les 9-1 Adding a Self-Timeout
Transition

Guided
Guided Practice
Practice Les
Les 9-1
9-1
Adding
Adding aa Self-Timeout
Self-Timeout Transition
Transition
2.
2. In
In the
the Workflow
Workflow Builder
Builder Vacation
Vacation Proposal
Proposal process
process
diagram:
diagram:
a.
a. Select
Select the
the Vacation
Vacation Proposal
Proposal notification
notification node,
node,
hold
hold down
down your
your right
right mouse
mouse button
button and
and drag
drag
away
away and
and back
back to
to the
the Vacation
Vacation Proposal
Proposal node.
node.
Let
Let go
go of
of the
the right
right mouse
mouse button.
button.
b.
b. Choose
Choose <Timeout>
<Timeout> from
from the
the transition
transition results.
results.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 33
Guided Practice Les 9-1 Adding a Loop Counter
Function Activity

Guided
Guided Practice
Practice Les
Les 9-1
9-1
Adding
Adding aa Loop
Loop Counter
Counter Function
Function Activity
Activity
3.
3. In
In the
the Workflow
Workflow Builder
Builder WFVACXX
WFVACXX item
item type:
type:
a.
a. Open
Open the
the Vacation
Vacation Proposal
Proposal process
process diagram
diagram
b.
b. Locate
Locate the
the Loop
Loop Counter
Counter function
function activity
activity in
in
the Standard item
the Standard item typetype
c.
c. Drag
Drag and
and drop
drop thethe Loop
Loop Counter
Counter activity
activity into
into
the
the Vacation
Vacation Proposal
Proposal process
process diagram
diagram
positioning
positioning it it above
above the
the Vacation
Vacation Proposal
Proposal
notification
notification node
node
d.
d. Open
Open the
the Loop
Loop Counter
Counter node
node Properties
Properties and
and
go
go to the Node Attributes tab to set
to the Node Attributes tab to set the
the
number
number of of times
times toto loop
loop

Copyright  Oracle Corporation, 2000. All rights reserved.

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 34
Guided Practice Les 9-1 Adding a Loop Counter
Function Activity Continued

Guided
Guided Practice
Practice Les
Les 9-1
9-1
Adding
Adding aa Loop
Loop Counter
Counter Function
Function Activity
Activity
Continued
Continued
e.
e. Select
Select attribute
attribute Loop
Loop Limit
Limit and
and set
set itit to
to aa
Constant
Constant Type
Type with
with aa Value
Value of
of 22

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 35
Guided Practice Les 9-1 Adding a Timeout transition to
Loop Counter

Guided
Guided Practice
Practice Les
Les 9-1
9-1
Adding
Adding aa Timeout
Timeout transition
transition to
to Loop
Loop
Counter
Counter
4.
4. In
In the
the Workflow
Workflow Builder
Builder Vacation
Vacation Proposal
Proposal process
process
diagram:
diagram:
a.
a. Select
Select the
the Vacation
Vacation Proposal
Proposal notification
notification node,
node,
draw
draw aa transition
transition to
to the
the Loop
Loop Counter
Counter node
node
choosing
choosing <Timeout>
<Timeout> fromfrom the
the Results
Results menu
menu
b.
b. Create
Create aa vertex
vertex in
in the
the transition
transition line
line between
between
the
the nodes
nodes
c.
c. Select
Select the
the Loop
Loop Counter
Counter node,
node, draw
draw aa
transition
transition to
to the
the Vacation
Vacation Proposal
Proposal notification
notification
node
node choosing
choosing Loop
Loop from
from the
the transition
transition
results
results
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 Continued

Guided
Guided Practice
Practice Les
Les 9-1
9-1
Adding
Adding aa Timeout
Timeout transition
transition to
to Loop
Loop
Counter
Counter Continued
Continued
d.
d. Select
Select the
the Loop
Loop Counter
Counter node,
node, draw
draw aa
transition
transition to the Vacation Approved node
to the Vacation Approved node
choosing
choosing Exit
Exit from
from the
the transition
transition results
results

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 37
Guided Practice Les 9-1 Assigning a Process Result
and Error Process

Guided
Guided Practice
Practice Les
Les 9-1
9-1
Assigning
Assigning aa Process
Process Result
Result
and
and Error
Error Process
Process
5.
5. In
In the
the Workflow
Workflow Builder
Builder Navigator
Navigator open
open the
the
Properties for the Vacation Proposal process:
Properties for the Vacation Proposal process:
a.
a. Select
Select Approval
Approval from
from the
the Result
Result Type
Type poplist
poplist
b.
b. Select
Select the
the Details
Details tab
tab and
and enter:
enter:
Error
Error Item
Item Type
Type WFERROR
WFERROR
Error Process DEFAULT_ERROR
Error Process DEFAULT_ERROR

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow Process


Chapter 9 - Page 38
Guided Practice Les 9-1 Labeling End nodes with
Result

Guided
Guided Practice
Practice Les
Les 9-1
9-1
Labeling
Labeling End
End nodes
nodes with
with Result
Result
6.
6. In
In the
the Workflow
Workflow Builder
Builder Vacation
Vacation Proposal
Proposal process
process
diagram:
diagram:
a.
a. Open
Open the
the Properties
Properties for
for each
each End
End node
node and
and
select
select the
the Node
Node tab
tab
b.
b. Select
Select aa value
value from
from the
the Result
Result poplist
poplist
–– Approve
Approve for
for the
the End
End node
node associated
associated with
with
the
the vacation
vacation proposal
proposal approved
approved path
path
through the process
through the process
–– Reject
Reject for
for the
the End
End node
node associated
associated with
with the
the
vacation
vacation proposal
proposal rejected
rejected path
path through
through the
the
process
process

Copyright  Oracle Corporation, 2000. All rights reserved.

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 39
Les 9-1 Summary

Les
Les 9-1
9-1 Summary
Summary

In
In this
this practice,
practice, you
you should
should have
have learned
learned how
how to:
to:
•• Set
Set aa Timeout
Timeout property
property and
and create
create aa <Timeout>
<Timeout>
transition for a notification activity
transition for a notification activity
•• Modify
Modify Process
Process properties
properties
•• Assign
Assign aa result
result to
to aa process
process End
End node
node

Copyright  Oracle Corporation, 2000. All rights reserved.

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.

Diagramming a Workflow Process


Chapter 9 - Page 40
Overview of the Workflow
Engine
Chapter 10

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Engine


Chapter 10 - Page 1
Overview of the Workflow Engine

Overview
Overview of
of the
the Workflow
Workflow Engine
Engine

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Engine


Chapter 10 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Give
Give aa general
general description
description of
of how
how the
the Workflow
Workflow
Engine manages a process
Engine manages a process
•• Apply
Apply the
the Workflow
Workflow Engine
Engine APIs
APIs to
to your
your function
function
activities
activities

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Engine


Chapter 10 - Page 3
Overview of the Workflow Engine

Overview
Overview of
of the
the Workflow
Workflow Engine
Engine

The Oracle Workflow Engine:

•• Is
Is implemented
implemented in in server-side
server-side PL/SQL.
PL/SQL.
•• Is
Is activated
activated whenever
whenever aa call
call to
to one
one ofof its
its PL/SQL
PL/SQL
procedures or functions is
procedures or functions is made.made.
•• Manages
Manages thethe state
state of
of activities
activities for
for each
each process
process
instance.
instance.
•• Determines
Determines the
the next
next activity
activity once
once aa prerequisite
prerequisite
activity
activity completes.
completes.
•• Executes
Executes function
function activities
activities automatically.
automatically.
•• Calls
Calls the
the Notification
Notification System
System to
to send
send notification
notification
messages.
messages.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Overview of the Workflow Engine (continued)

Overview
Overview of
of the
the Workflow
Workflow Engine
Engine
(continued)
(continued)

•• Supports
Supports results-based
results-based branches,
branches, parallel
parallel
branches,
branches, rendezvous,
rendezvous, loops
loops and
and subprocesses.
subprocesses.
•• Can
Can execute
execute activities
activities from
from non-savepoint
non-savepoint
environments
environments such as database triggers
such as database triggers and
and
distributed
distributed transactions. It automatically traps
transactions. It automatically traps
savepoint-not-allowed
savepoint-not-allowed errors.
errors.
•• Can
Can defer
defer activities
activities too
too costly
costly to
to execute
execute in
in real
real
time
time to
to background
background engines
engines forfor processing.
processing.
•• Maintains
Maintains aa history
history of
of completed
completed activities.
activities.
•• Detects
Detects error
error conditions
conditions and
and executes
executes error
error
processes.
processes.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Engine


Chapter 10 - Page 5
Workflow Engine Features

Workflow
Workflow Engine
Engine Features
Features

The Workflow Engine supports the following features:

•• Managing
Managing process
process state
state
•• Coordinating
Coordinating execution
execution of
of activities
activities
•• Sophisticated
Sophisticated rules
rules including
including looping,
looping, results-
results-
based branching, parallel flows, and subprocesses
based branching, parallel flows, and subprocesses
•• Deferred
Deferred processing
processing
•• Detecting
Detecting error
error conditions
conditions and
and running
running error
error
processes
processes

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Initiating a Workflow Process

Initiating
Initiating aa Workflow
Workflow Process
Process

To start a workflow process:

•• Your
Your application
application must
must execute
execute aa procedure
procedure that
that
calls
calls the
the following
following Workflow
Workflow Engine
Engine APIs:
APIs:
–– WF_ENGINE.CreateProcess
WF_ENGINE.CreateProcess
–– WF_ENGINE.StartProcess
WF_ENGINE.StartProcess
or
or
–– WF_ENGINE.LaunchProcess
WF_ENGINE.LaunchProcess
•• The
The procedure
procedure must
must identify
identify the
the value
value of
of the
the
process
process item
item type
type and
and item
item key
key for
for these
these APIs
APIs

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Workflow Engine Processing

Workflow
Workflow Engine
Engine Processing
Processing

Upon
Upon starting
starting aa process,
process, the
the Workflow
Workflow Engine:
Engine:
•• Identifies
Identifies and
and executes
executes the
the Start
Start activity
activity
•• Determines
Determines thethe next
next activity
activity to
to transition
transition to to after
after
completing
completing thethe prerequisite
prerequisite activity
activity or
or activities
activities
•• Drives
Drives through
through the
the process,
process, automatically
automatically
executing
executing all
all function
function activities,
activities, until
until itit comes
comes to to aa
notification
notification or
or blocking
blocking activity
activity
•• Calls
Calls the
the Notification
Notification System
System to to notify
notify the the recipient
recipient
•• Continues
Continues driving
driving through
through the
the process
process until until itit
encounters
encounters an an End
End activity,
activity, (once
(once thethe performer
performer
completes
completes thethe notification
notification or
or the
the block
block activity
activity is is
completed)
completed)
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Activity Statuses

Activity
Activity Statuses
Statuses

Once
Once the
the Workflow
Workflow Engine
Engine executes
executes anan activity,
activity, it
it
updates
updates the
the state
state of
of the
the activity
activity to
to one
one of
of the
the
following
following statuses:
statuses:
•• Active
Active
•• Complete
Complete
•• Waiting
Waiting
•• Notified
Notified
•• Deferred
Deferred
•• Error
Error
•• Suspend
Suspend
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
Calling the Workflow Engine

Calling
Calling the
the Workflow
Workflow Engine
Engine

•• Engine
Engine must must be be informed
informed when when an an activity
activity
completes.
completes.
–– Process,
Process, notification,
notification, and and function
function activities
activities
automatically
automatically call call
WF_ENGINE.CompleteActivity(
WF_ENGINE.CompleteActivity( )) when when they
they
complete.
complete.
–– IfIf aa notification
notification activityactivity requires
requires some some action
action to
to
be
be taken
taken in in aa form
form or or WebWeb page, page, then then that
that form
form
or
or WebWeb page
page must must call call
WF_ENGINE.CompleteActivity(
WF_ENGINE.CompleteActivity( )) when when thethe user
user
completes
completes the the transaction.
transaction.
–– IfIf aa function
function activity
activity callscalls an an external
external program,
program,
then
then codecode that that external
external program program to to call
call
WF_ENGINE.CompleteActivity(
WF_ENGINE.CompleteActivity( )) when when itit
completes.
completes. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 10
Oracle Workflow APIs

Oracle
Oracle Workflow
Workflow APIs
APIs

Oracle
Oracle Workflow
Workflow APIs
APIs are
are grouped
grouped as
as follows:
follows:
•• Engine
Engine APIs
APIs
–– Starting/running
Starting/running aa process
process
–– Communicating
Communicating attribute
attribute information
information
–– Communicating
Communicating state
state changes
changes
•• Core
Core APIs:
APIs: raising
raising and
and catching
catching errors
errors
•• Purge
Purge APIs:
APIs: purging
purging obsolete
obsolete runtime
runtime data
data
•• Directory
Directory APIs:
APIs: communicating
communicating directory
directory services
services
user
user and
and role
role information
information

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Engine


Chapter 10 - Page 11
Oracle Workflow APIs (continued)

Oracle
Oracle Workflow
Workflow APIs
APIs (continued)
(continued)

•• Monitor
Monitor APIs:
APIs: generating
generating Workflow
Workflow Monitor
Monitor URLs
URLs
•• Notification
Notification APIs:
APIs: managing
managing notifications
notifications
•• Preference
Preference APIs:
APIs: retrieving
retrieving user
user preference
preference
information
information
•• Queue
Queue APIs:
APIs: handling
handling workflow
workflow Advanced
Advanced Queues
Queues
processing
processing
•• Document
Document Management
Management APIs:
APIs: returning
returning URLs
URLs or
or
javascript functions
javascript functions
•• Views:
Views: providing
providing public
public views
views to
to access
access workflow
workflow
data
data

Copyright  Oracle Corporation, 2000. All rights reserved.

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 12
Workflow Engine APIs

Workflow
Workflow Engine
Engine APIs
APIs

Use
Use the
the following
following APIs
APIs to
to start
start or
or run
run aa workflow
workflow
process:
process:
•• WF_ENGINE.CreateProcess
WF_ENGINE.CreateProcess
•• WF_ENGINE.StartProcess
WF_ENGINE.StartProcess
•• WF_ENGINE.LaunchProcess
WF_ENGINE.LaunchProcess
•• WF_ENGINE.SetItemOwner
WF_ENGINE.SetItemOwner
•• WF_ENGINE.SetItemUserKey
WF_ENGINE.SetItemUserKey
•• WF_ENGINE.SetItemParent
WF_ENGINE.SetItemParent
•• WF_ENGINE.background
WF_ENGINE.background

Copyright  Oracle Corporation, 2000. All rights reserved.

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 13
Workflow Engine APIs

Workflow
Workflow Engine
Engine APIs
APIs

Use
Use the
the following
following APIs
APIs to
to communicate
communicate attribute
attribute
information
information toto the
the Workflow
Workflow Engine:
Engine:
•• WF_ENGINE.SetItemAttribute
WF_ENGINE.SetItemAttribute (3) (3)
•• WF_ENGINE.SetItemAttrDocument
WF_ENGINE.SetItemAttrDocument
•• WF_ENGINE.getItemTypes
WF_ENGINE.getItemTypes
•• WF_ENGINE.GetItemAttribute
WF_ENGINE.GetItemAttribute (3)
(3)
•• WF_ENGINE.GetItemAttrDocument
WF_ENGINE.GetItemAttrDocument

Copyright  Oracle Corporation, 2000. All rights reserved.

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 14
Workflow Engine APIs

Workflow
Workflow Engine
Engine APIs
APIs

•• WF_ENGINE.GetActivityAttribute
WF_ENGINE.GetActivityAttribute (3)
(3)
•• WF_ENGINE.AddItemAttr
WF_ENGINE.AddItemAttr
•• WF_ENGINE.GetItemAttrInfo
WF_ENGINE.GetItemAttrInfo
•• WF_ENGINE.GetActivityAttrInfo
WF_ENGINE.GetActivityAttrInfo

Copyright  Oracle Corporation, 2000. All rights reserved.

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 15
Workflow Engine APIs

Workflow
Workflow Engine
Engine APIs
APIs

Use
Use the
the following
following APIs
APIs to
to communicate
communicate state
state changes
changes
to
to the
the Workflow
Workflow Engine:
Engine:
•• WF_ENGINE.CompleteActivity
WF_ENGINE.CompleteActivity
•• WF_ENGINE.BeginActivity
WF_ENGINE.BeginActivity
•• WF_ENGINE.AssignActivity
WF_ENGINE.AssignActivity
•• WF_ENGINE.GetActivityLabel
WF_ENGINE.GetActivityLabel
•• WF_ENGINE.AbortProcess
WF_ENGINE.AbortProcess
•• WF_ENGINE.SuspendProcess
WF_ENGINE.SuspendProcess

Copyright  Oracle Corporation, 2000. All rights reserved.

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 16
Workflow Engine APIs

Workflow
Workflow Engine
Engine APIs
APIs

•• WF_ENGINE.ResumeProcess
WF_ENGINE.ResumeProcess
•• WF_ENGINE.HandleError
WF_ENGINE.HandleError
•• WF_ENGINE.ItemStatus
WF_ENGINE.ItemStatus
•• WF_ENGINE.getProcessStatus
WF_ENGINE.getProcessStatus

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Background Engine

Background
Background Engine
Engine

The
The Background
Background Engine
Engine isis aa PL/SQL
PL/SQL procedure.
procedure.
•• The
The Background
Background Engine
Engine checks
checks for for and
and executes
executes
any
any deferred or timed out activities that satisfy the
deferred or timed out activities that satisfy the
arguments
arguments of of the
the procedure
procedure at at the
the time
time the
the
procedure
procedure is is invoked.
invoked.
•• The
The procedure
procedure ends
ends once
once allall matching
matching activities
activities
are
are executed.
executed.
•• IfIf new
new activities
activities are
are deferred
deferred or or timed
timed outout after
after the
the
initiation of the current Background
initiation of the current Background Engine Engine
procedure,
procedure, they they will
will be
be processed
processed when when thethe next
next
Background Engine procedure
Background Engine procedure is initiated. is initiated.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Background Engine

Background
Background Engine
Engine

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);

Copyright  Oracle Corporation, 2000. All rights reserved.

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 19
Deferred Processing

Deferred
Deferred Processing
Processing

•• Set
Set the
the Workflow
Workflow Engine
Engine threshold
threshold cost
cost to
to control
control
which
which activities
activities get
get deferred.
deferred.
•• The
The default
default threshold
threshold cost
cost of
of the
the Workflow
Workflow Engine
Engine
is set to 50.
is set to 50.
•• The
The Workflow
Workflow Engine
Engine threshold
threshold is
is an
an externalized
externalized
constant.
constant.
•• Add
Add this
this command
command to to aa PL/SQL
PL/SQL stored
stored procedure
procedure
or
or execute
execute this
this command
command in in SQL*PLUS
SQL*PLUSto to change
change
the
the threshold: WF_ENGINE.THRESHOLD := n;
threshold: WF_ENGINE.THRESHOLD := n;

Copyright  Oracle Corporation, 2000. All rights reserved.

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 20
Timed Out Notification Activities

Timed
Timed Out
Out Notification
Notification Activities
Activities

•• Workflow
Workflow EngineEngine calls
calls on
on the
the Notification
Notification System
System
to
to deliver
deliver the
the notification
notification and
and marks
marks the
the activity
activity as
as
NOTIFIED.
NOTIFIED.
•• The
The background
background Engine
Engine configured
configured forfor timed
timed out
out
activities checks for Notified activities
activities checks for Notified activities and and
determines
determines whether
whether the
the Notified
Notified activities
activities have
have
timeout
timeout values
values that
that have
have been
been exceeded.
exceeded.
•• IfIf the
the timeout
timeout value
value is
is exceeded,
exceeded, thethe Background
Background
Engine
Engine marks the activity as timed out and
marks the activity as timed out and calls
calls
the Workflow Engine to follow the
the Workflow Engine to follow the <Timeout><Timeout>
transition.
transition.
•• Timeouts
Timeouts may may be
be set
set to
to an
an item
item attribute
attribute or
or to
to aa
relative
relative time
time in
in days/hours/minutes
days/hours/minutes ®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 21
Error Processing

Error
Error Processing
Processing

IfIf an
an activity
activity error
error occurs
occurs the
the Workflow
Workflow Engine:
Engine:
•• Rolls
Rolls back
back toto the
the pre-activity
pre-activity savepoint.
savepoint.
•• Sets
Sets the
the activity
activity to
to the
the ERROR
ERROR status.
status.
•• Attempts
Attempts to
to run
run an
an Error
Error Process.
Process.

Copyright  Oracle Corporation, 2000. All rights reserved.

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.

Overview of the Workflow Engine


Chapter 10 - Page 22
Completing Workflow
Notification Activities
Chapter 11

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification Activities


Chapter 11 - Page 1
Completing Workflow Notification Activities

Completing
Completing Workflow
Workflow Notification
Notification
Activities
Activities

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification Activities


Chapter 11 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Respond
Respond to to notifications
notifications from
from the
the Notification
Notification Web
Web
page
page
•• Respond
Respond to to notifications
notifications using
using email
email
•• Access
Access thethe Oracle
Oracle Workflow
Workflow home
home page
page
•• Define
Define notification
notification routing
routing rules
rules

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification Activities


Chapter 11 - Page 3
Oracle Workflow Home Page

Oracle
Oracle Workflow
Workflow Home
Home Page
Page

Copyright  Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Web-Based Features


Use the Oracle Workflow home page to link to all of Oracle Workflow’s
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 4
Find Notifications Web Page

Find
Find Notifications
Notifications Web
Web Page
Page

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
Notifications Worklist

Notifications
Notifications Worklist
Worklist

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Use the Select checkbox to simultaneously close multiple
notifications that don’t 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 7
Notification Details

Notification
Notification Details
Details

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification Activities


Chapter 11 - Page 8
Reassigning Notifications

Reassigning
Reassigning Notifications
Notifications

User
List-of-values

Delegate or
Transfer
reassign options

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
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 10
Launching Oracle Application Forms

Launching
Launching Oracle
Oracle Application
Application Forms
Forms

Click on form icon to launch


Oracle Applications form

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification Activities


Chapter 11 - Page 11
E-Mail Notification

E-Mail
E-Mail Notification
Notification

<Place
<Place screenshot
screenshot here>
here>

Automatic
generation
of
response
template

Copyright  Oracle Corporation, 2000. All rights reserved.

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 12
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 13
E-Mail Notification (continued)

E-Mail
E-Mail Notification
Notification (continued)
(continued)

Automatic
generation
of
response
template

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification Activities


Chapter 11 - Page 14
E-Mail Summary of Notifications

E-Mail
E-Mail Summary
Summary of
of Notifications
Notifications

<Place
<Place screenshot
screenshot here>
here>

Copyright  Oracle Corporation, 2000. All rights reserved.

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 15
Automatic Notification Processing

Automatic
Automatic Notification
Notification Processing
Processing

You
You can
can automatically
automatically forward
forward oror respond
respond to
to
incoming
incoming notifications
notifications during
during aa planned
planned absence.
absence.
You
You can
can define
define automatic
automatic notification
notification processing
processing
rules using a set of Web pages.
rules using a set of Web pages.
•• AA rule
rule applies
applies to
to aa message
message or or messages
messages
belonging
belonging toto aa specific
specific role.
role.
•• AA rule
rule can
can result
result inin one
one of
of three
three actions:
actions:
–– Reassign
Reassign the
the notification
notification to
to another
another role
role
–– Respond
Respond to to or
or close
close the
the notification
notification
–– Deliver
Deliver to
to the
the original
original recipient
recipient with
with no
no further
further
action
action
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 16
Listing Notification Processing Rules

Listing
Listing Notification
Notification Processing
Processing Rules
Rules

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Creating a New Notification Processing Rule

Creating
Creating aa New
New Notification
Notification Processing
Processing
Rule
Rule

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Creating a New Notification Processing Rule
(continued)

Creating
Creating aa New
New Notification
Notification Processing
Processing
Rule
Rule (continued)
(continued)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 19
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.

Completing Workflow Notification Activities


Chapter 11 - Page 20
Monitoring Workflow
Processes
Chapter 12

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Chapter 12 - Page 1
Monitoring Workflow Processes

Monitoring
Monitoring Workflow
Workflow Processes
Processes

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Chapter 12 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Check
Check the
the progress
progress of
of aa workflow
workflow using
using the
the Java-
Java-
based Workflow Monitor
based Workflow Monitor

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Chapter 12 - Page 3
Workflow Monitor

Workflow
Workflow Monitor
Monitor

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Process Title

Process
Process Title
Title

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
Process Diagram Window

Process
Process Diagram
Diagram Window
Window

Copyright  Oracle Corporation, 2000. All rights reserved.

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
hasn’t 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 6
Detail Tab Window

Detail
Detail Tab
Tab Window
Window

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Administration Buttons

Administration
Administration Buttons
Buttons

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Application-Controlled Access to the Workflow Monitor

Application-Controlled
Application-Controlled Access
Access to
to the
the
Workflow
Workflow Monitor
Monitor
•• Calling
Calling application
application may
may launch
launch aa Web
Web browser
browser and
and
pass
pass aa Workflow
Workflow Monitor
Monitor URL.
URL.
•• From
From aa form
form in
in Oracle
Oracle Applications,
Applications, useuse
FND_UTILITIES.OPEN_URL(
FND_UTILITIES.OPEN_URL( ) ) to
to launch
launch aa
browser
browser and
and pass
pass aa Workflow
Workflow Monitor
Monitor URL.
URL.
•• Monitor a Specific Item Type and Key through:
Monitor a Specific Item Type and Key through:
–– Process
Process Diagram
Diagram URL
URL
–– Notifications
Notifications List
List URL
URL
–– Activities
Activities List
List URL
URL

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
Application-Controlled Access to the Workflow Monitor
(Continued)

Application-Controlled
Application-Controlled Access
Access to
to the
the
Workflow
Workflow Monitor
Monitor (Continued)
(Continued)
•• Call
Call functions
functions toto generate
generate Monitor
Monitor URL
URL strings
strings for:
for:
–– Process Diagram
Process Diagram
WF_MONITOR.GetDiagramURL(
WF_MONITOR.GetDiagramURL( ))
–– Notifications
Notifications List
List
WF_MONITOR.GetEnvelopeURL(
WF_MONITOR.GetEnvelopeURL( ))
–– Activities
Activities List
List
WF_MONITOR.GetAdvancedEnvelopeURL(
WF_MONITOR.GetAdvancedEnvelopeURL( ))
•• Calling
Calling application
application must
must supply
supply the
the Web
Web agent
agent
string,
string, item
item type,
type, and
and item
item key
key and
and specify
specify whether
whether
to
to run
run the
the monitor
monitor inin ADMIN
ADMIN oror USER
USER mode.
mode.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 10
Direct Access to the Workflow Monitor

Direct
Direct Access
Access to
to the
the Workflow
Workflow Monitor
Monitor

Find Processes Web page is a secured Web page that


requires user authentication.
Do you have Workflow Administrator privileges?

•• IfIf yes,
yes, then
then you
you can
can search
search for
for and
and monitor
monitor any
any
workflow
workflow process
process instance
instance in
in ADMIN
ADMIN mode.
mode.
•• IfIf no,
no, then
then you
you can
can only
only search
search for
for and
and monitor
monitor
processes
processes in ADMIN mode that you own.
in ADMIN mode that you own.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 11
Find Processes Web Page

Find
Find Processes
Processes Web
Web Page
Page

Copyright  Oracle Corporation, 2000. All rights reserved.

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 12
Reviewing the Process List

Reviewing
Reviewing the
the Process
Process List
List

Copyright  Oracle Corporation, 2000. All rights reserved.

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 13
Reviewing the Notifications List

Reviewing
Reviewing the
the Notifications
Notifications List
List

Copyright  Oracle Corporation, 2000. All rights reserved.

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 14
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 15
Filtering Activities in the Activities List

Filtering
Filtering Activities
Activities in
in the
the Activities
Activities List
List

Copyright  Oracle Corporation, 2000. All rights reserved.

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 16
Filtering Activities in the Activities List (continued)

Filtering
Filtering Activities
Activities in
in the
the Activities
Activities List
List
(continued)
(continued)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Child/Parent Instances

Child/Parent
Child/Parent Instances
Instances

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Practice Les 12-1 Overview

Practice
Practice Les
Les 12-1
12-1 Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Testing
Testing PL/SQL
PL/SQL functions
functions in
in aa Workflow
Workflow Process
Process
•• Responding
Responding toto Notifications
Notifications
•• Monitoring
Monitoring the
the results
results of
of aa Work
Work Item
Item

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Chapter 12 - Page 19
Practice Les 12-1 Overview Continued

Practice
Practice Les
Les 12-1
12-1 Overview
Overview Continued
Continued

Using
Using the
the Vacation
Vacation Proposal
Proposal process
process created
created in
in
practice
practice Les
Les 9-1:
9-1:
•• Initiate
Initiate aa work
work item
item
•• Monitor
Monitor the
the status
status of
of your
your work
work item
item using
using the
the
Monitor
Monitor Activities
Activities List
List and
and Diagram
Diagram
•• Timeout
Timeout the
the Vacation
Vacation Proposal
Proposal notification
notification
•• Exercise
Exercise the
the Schedule
Schedule UpdateUpdate function
function activity
activity
logic
logic
•• Exercise
Exercise Vacation
Vacation Proposal
Proposal post-notification
post-notification
function
function logic,
logic, ifif implemented
implemented
•• Debug
Debug any
any PL/SQL
PL/SQL errors errors encountered
encountered
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Chapter 12 - Page 20
Guided Practice Les 12-1 Initiating a Work Item

Guided
Guided Practice
Practice Les
Les 12-1
12-1
Initiating
Initiating aa Work
Work Item
Item

1.
1. Connect
Connect toto the
the Oracle
Oracle Workflow
Workflow home
home page.
page. Log
Log
on
on as
as any
any user
user with
with “Administrator”
“Administrator” privileges.
privileges.
a.
a. Select
Select the
the Launch
Launch Processes
Processes link
link
b.
b. Select
Select your
your Item
Item Type
Type link
link from
from the
the list
list
c.
c. On
On the
the Initiate
Initiate Workflow
Workflow pagepage enter:
enter:
–– an
an item
item key
key and
and user
user keykey to
to uniquely
uniquely
identify your work
identify your work itemitem
–– a
a requestor
requestor and and approver
approver usingusing the
the role
role list-
list-
of-values
of-values
–– a
a from
from andand to
to date
date (DD-MON-RR)
(DD-MON-RR)
d.
d. Click
Click on
on OK
OK
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 21
Guided Practice Les 12-1: Monitoring the Results

Guided
Guided Practice
Practice Les
Les 12-1:
12-1:
Monitoring
Monitoring the
the Results
Results

2.
2. Display
Display the
the Activities
Activities List
List and
and Diagram
Diagram for
for your
your
work
work item.
item. Evaluate
Evaluate thethe current
current status
status of
of your
your
work
work item.
item. IfIf an
an error
error occurred
occurred in in your
your process,
process,
use
use the Result Exception link in the Activities
the Result Exception link in the Activities List
List
to
to determine
determine the the cause.
cause.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 22
Guided Practice Les 12-1 Timing out Vacation Proposal
notification

Guided
Guided Practice
Practice Les
Les 12-1
12-1
Timing
Timing out
out Vacation
Vacation Proposal
Proposal notification
notification

3.
3. To
To take
take the
the <Timeout>
<Timeout> transition
transition implemented
implemented in
in
practice
practice Les
Les 9-1:
9-1:
a.
a. Wait
Wait until
until the
the Vacation
Vacation Proposal
Proposal due
due date
date has
has
expired
expired
b.
b. Run
Run the
the Background
Background Engine
Engine from
from SQL*PLUS
SQL*PLUS
EXEC
EXEC wf_engine.background(‘<itemtype>‘);
wf_engine.background(‘<itemtype>‘);

c.
c. Filter
Filter process
process activities
activities in
in the
the Monitor
Monitor
Activities
Activities List
List to
to verify
verify the
the Timeout
Timeout result
result

Copyright  Oracle Corporation, 2000. All rights reserved.

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 23
Guided Practice Les 12-1 Testing Schedule Vacation
Function

Guided
Guided Practice
Practice Les
Les 12-1
12-1
Testing
Testing Schedule
Schedule Vacation
Vacation Function
Function

4.
4. To
To test
test your
your RUN
RUN mode
mode Schedule
Schedule Vacation
Vacation logic:
logic:
a.
a. Accept
Accept the
the Vacation
Vacation Proposal
Proposal
b.
b. Display
Display the
the Activities
Activities List
List and
and Diagram
Diagram forfor
your
your work item. Evaluate the current status of
work item. Evaluate the current status of
your
your work
work item.
item. IfIf an
an error
error occurred
occurred inin your
your
Schedule
Schedule Vacation
Vacation function,
function, use
use the
the Result
Result
Exception
Exception link
link in
in the
the Activities
Activities List
List to
to
determine
determine the
the cause.
cause.
c.
c. Query
Query and
and verify
verify the
the contents
contents ofof your
your Vacation
Vacation
Schedule
Schedule table:
table:
Select
Select ** from
from
WFVACXX_Vacation_Schedule;
WFVACXX_Vacation_Schedule;
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 24
Guided Practice Les 12-1 Testing Schedule Vacation
Function Continued

Guided
Guided Practice
Practice Les
Les 12-1
12-1
Testing
Testing Schedule
Schedule Vacation
Vacation Function
Function
Continued
Continued
5.
5. To
To test
test your
your CANCEL
CANCEL mode mode Schedule
Schedule Vacation
Vacation
logic:
logic:
a.
a. Display
Display your
your completed
completed work
work item
item in
in the
the
Monitor
Monitor Diagram.
Diagram. “Rewind”
“Rewind” your
your work
work item
item to
to
the
the Start
Start node
node using
using the
the Diagram
Diagram Expedite
Expedite
feature.
feature.
–– select
select the
the Start
Start node
node and
and click
click on
on the
the
Expedite
Expedite button
button
–– select
select Retry
Retry and
and click
click on
on the
the OK
OK button
button
b.
b. Query
Query and
and verify
verify the
the contents
contents of
of your
your Vacation
Vacation
Schedule table. The Schedule Vacation
Schedule table. The Schedule Vacation
function
function should
should have
have removed
removed the
the appropriate
appropriate
vacation
vacation schedule
schedule row.
row. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Chapter 12 - Page 25
Guided Practice Les 12-1 Testing Post-Notification
Function

Guided
Guided Practice
Practice Les
Les 12-1
12-1
Testing
Testing Post-Notification
Post-Notification Function
Function
6.
6. To
To exercise
exercise your
your post-notification
post-notification function
function logic:
logic:
a.
a. Reassign
Reassign the
the Vacation
Vacation Proposal
Proposal to
to aa new
new role
role
–– Transfer
Transfer should
should raise
raise an
an exception
exception
–– Delegate
Delegate should
should be
be successful
successful
b.
b. Reject
Reject the
the Vacation
Vacation Proposal
Proposal without
without entering
entering
alternate
alternate vacation
vacation dates
dates
–– any
any missing
missing dates
dates on
on reject
reject should
should raise
raise an
an
exception
exception
c.
c. Reject
Reject the
the Vacation
Vacation Proposal
Proposal with
with an
an alternate
alternate
from
from date
date prior
prior to
to the
the alternate
alternate to
to date
date
–– invalid
invalid date
date ranges
ranges should
should raise
raise an
an
exception
exception ®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Chapter 12 - Page 26
Guided Practice Les 12-1 Testing Post-Notification
Function Continued

Guided
Guided Practice
Practice Les
Les 12-1
12-1
Testing
Testing Post-Notification
Post-Notification Function
Function
Continued
Continued
d.
d. Reject
Reject the
the Vacation
Vacation Proposal,
Proposal, including
including valid
valid
alternate dates and comment
alternate dates and comment
–– response
response should
should be
be successful
successful
e.
e. Accept
Accept the
the Vacation
Vacation Proposal
Proposal
–– response
response should
should be
be successful
successful

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Chapter 12 - Page 27
Les 12-1 Summary

Les
Les 12-1
12-1 Summary
Summary

In
In this
this practice,
practice, you
you should
should have
have learned
learned how
how to:
to:
•• Implement
Implement and
and test
test aa notification
notification activity
activity Timeout
Timeout
•• Implement
Implement and
and test
test function
function activity
activity logic
logic
•• Implement
Implement and
and test
test post-notification
post-notification function
function
response
response logic
logic

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow Processes


Chapter 12 - Page 28
PL/SQL Documents
Chapter 13

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 1
PL/SQL Documents

PL/SQL
PL/SQL Documents
Documents

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Integrate
Integrate PL/SQL
PL/SQL documents
documents into
into aa Workflow
Workflow
process
process
•• Define
Define aa procedure
procedure to
to generate
generate aa PL/SQL
PL/SQL
document
document
•• Attach
Attach PL/SQL
PL/SQL documents
documents

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 3
Integrating PL/SQL Documents in Workflow Processes

Integrating
Integrating PL/SQL
PL/SQL Documents
Documents in
in
Workflow
Workflow Processes
Processes

•• Use
Use aa PL/SQL
PL/SQL document
document whenwhen the
the format
format oror
content
content ofof the
the document
document may may vary.
vary.
•• You
You integrate
integrate aa PL/SQL
PL/SQL document
document intointo aa workflow
workflow
process
process by defining an attribute of type
by defining an attribute of type document
document
for
for an
an item
item type
type or
or message.
message.
•• The
The document-type
document-type attribute
attribute value
value tells
tells Oracle
Oracle
Workflow
Workflow how how toto construct
construct the
the dynamic
dynamic callcall to
to aa
PL/SQL
PL/SQL procedure
procedure which
which generates
generates thethe document.
document.
•• You
You embed
embed aa PL/SQL
PL/SQL document-type
document-type message
message
attribute
attribute in a message body
in a message body toto display
display the
the
document
document in in aa notification.
notification.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Defining Procedures to Generate a PL/SQL Document

Defining
Defining Procedures
Procedures to
to Generate
Generate aa
PL/SQL
PL/SQL Document
Document

procedure
procedure <procedure
<procedure name>
name>
(document_id
(document_id in
in varchar2,
varchar2,
display_type
display_type in varchar2,
in varchar2,
document
document in
in out
out varchar2,
varchar2,
document_type
document_type in
in out
out varchar2)
varchar2)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
‘ ‘: 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 6
Defining Procedures to Generate a PL/SQL Document
(continued)

Defining
Defining Procedures
Procedures to
to Generate
Generate aa
PL/SQL
PL/SQL Document
Document (continued)
(continued)

procedure
procedure <procedure
<procedure name>
name>
(document_id
(document_id in
in varchar2,
varchar2,
display_type
display_type in
in varchar2,
varchar2,
document
document in
in out
out varchar2,
varchar2,
document_type
document_type in out varchar2)
in out varchar2)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
PL/SQL Document Attachments

PL/SQL
PL/SQL Document
Document Attachments
Attachments

Attach Document
Content to
Notification Message

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Practice Les 13-1 Overview

Practice
Practice Les
Les 13-1
13-1 Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Creating
Creating aa PL/SQL
PL/SQL Document
Document procedure
procedure
–– for
for the
the vacation
vacation proposal
proposal requestor,
requestor,
report
report the
the scheduled
scheduled vacation
vacation as
as stored
stored in
in
your
your WFVACXX_Vacation_Schedule
WFVACXX_Vacation_Schedule table table
•• Using
Using aa PL/SQL
PL/SQL Document
Document attribute
attribute in
in aa message
message
–– create
create an
an attribute,
attribute, message,
message, and
and notification
notification
to
to send the scheduled vacation report
send the scheduled vacation report to
to the
the
requestor when the vacation proposal
requestor when the vacation proposal is is
approved
approved
•• Setting
Setting the
the value
value of
of aa PL/SQL
PL/SQL Document
Document attribute
attribute
•• Testing
Testing aa PL/SQL
PL/SQL Document
Document ®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 9
Guided Practice Les 13-1 Creating a PL/SQL
Document Procedure

Guided
Guided Practice
Practice Les
Les 13-1
13-1
Creating
Creating aa PL/SQL
PL/SQL Document
Document Procedure
Procedure

1.
1. Use
Use the
the standard
standard PL/SQL
PL/SQL Document
Document API
API format
format for
for
your
your PL/SQL
PL/SQL specification
specification and
and body.
body.
procedure
procedure <procedure
<procedure name>
name>
(document_id
(document_id in
in varchar2,
varchar2,
display_type
display_type in
in varchar2,
varchar2,
document
document in
in out
out varchar2,
varchar2,
document_type
document_type in out varchar2)
in out varchar2)
a.
a. Add
Add to
to your
your package
package “WFVACXX”
“WFVACXX” created
created in
in
practice Les 8-1.
practice Les 8-1.
b.
b. Give
Give your
your procedure
procedure aa descriptive
descriptive name,
name, such
such
as
as “VACATION_SCHEDULED”.
“VACATION_SCHEDULED”.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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

Guided
Guided Practice
Practice Les
Les 13-1
13-1
Creating
Creating aa PL/SQL
PL/SQL Document
Document Procedure
Procedure

c.
c. Code
Code requestor
requestor username
username as as the
the value
value of
of the
the
document_id
document_id to to create
create aa document
document displaying
displaying
the
the vacation
vacation scheduled
scheduled forfor the
the current
current
requestor.
requestor.
d.
d. Create
Create aa cursor
cursor toto select
select all
all vacation
vacation schedule
schedule
rows for the requestor.
rows for the requestor.
Cursor
Cursor vacation_schedule
vacation_schedule
(xrequestor
(xrequestor in
in varchar2)
varchar2) is
is
Select
Select approver_username,from_date,
approver_username,from_date, to_date
to_date
from WFVACXX_Vacation_Schedule
from WFVACXX_Vacation_Schedule
where
where requestor_username
requestor_username == xrequestor
xrequestor
order
order by
by from_date,
from_date, to_date;
to_date;
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 11
Guided Practice Les 13-1 Creating a PL/SQL
Document Procedure

Guided
Guided Practice
Practice Les
Les 13-1
13-1
Creating
Creating aa PL/SQL
PL/SQL Document
Document Procedure
Procedure

e.
e. Build
Build aa document
document texttext buffer.
buffer. You
You can
can choose
choose
to
to create
create aa document
document specific
specific to
to the
the
display_type
display_type (text/html,
(text/html, text/plain,
text/plain, or
or null)
null) or
or
choose
choose to to always
always create
create anan html
html oror plain
plain text
text
document.
document.
f.f. Set
Set the
the document_type
document_type based based onon the
the document
document
you created, text/html or text/plain.
you created, text/html or text/plain.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 12
Guided Practice Les 13-1 Using a PL/SQL Document
Attribute

Guided
Guided Practice
Practice Les
Les 13-1
13-1
Using
Using aa PL/SQL
PL/SQL Document
Document Attribute
Attribute

2.
2. In
In the
the Workflow
Workflow Builder
Builder Navigator
Navigator open
open your
your
WFVACXX
WFVACXXitem item type:
type:
a.
a. Create
Create an
an item
item attribute
attribute of
of type
type Document
Document withwith
descriptive
descriptive internal
internal and
and display
display names.
names.
For
For example,
example, VACATION_SCHEDULE_DOC
VACATION_SCHEDULE_DOC and and
Vacation Schedule Document, respectively.
Vacation Schedule Document, respectively.
b.
b. Create
Create aa Vacation
Vacation Schedule
Schedule message.
message.
To
To embed
embed the
the Document
Document contents
contents inin the
the message,
message,
include
include aa token
token &<VACATION_SCHEDULE_DOC>
&<VACATION_SCHEDULE_DOC>
in
in the
the text
text and/or
and/or HTML
HTML message
message bodies.
bodies.
c.
c. Drag
Drag and
and drop
drop the
the Document
Document item
item attribute,
attribute,
(along
(along with any other attributes you need) to
with any other attributes you need) to your
your
Vacation Schedule message.
Vacation Schedule message. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

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

Guided
Guided Practice
Practice Les
Les 13-1
13-1
Using
Using aa PL/SQL
PL/SQL Document
Document Attribute
Attribute

d.
d. ToTo attach
attach the
the content
content of of the
the PL/SQL
PL/SQL Document
Document
to
to aa message,
message, open
open your
your Document
Document message
message
attribute
attribute Properties,
Properties, select
select aa Frame
Frame Target
Target and
and
check
check the
the Attach
Attach Content
Content checkbox.
checkbox.
e.
e. Create
Create aa Notification
Notification activity
activity that
that sends
sends the
the
Vacation Schedule message.
Vacation Schedule message.
f.f. Drag
Drag and
and drop
drop the
the Notification
Notification activity
activity from
from the
the
Builder
Builder Navigator
Navigator to to the
the Vacation
Vacation Proposal
Proposal
process
process diagram.
diagram. Replace
Replace thethe transition
transition from
from
Update
Update Vacation
Vacation Schedule
Schedule to to End
End (Approve)
(Approve) with
with
transitions
transitions from
from Update
Update Vacation
Vacation Schedule
Schedule to to the
the
Vacation
Vacation Schedule
Schedule notification,
notification, and
and Vacation
Vacation
Schedule
Schedule notification
notification toto End
End (Approve).
(Approve).
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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

Guided
Guided Practice
Practice Les
Les 13-1
13-1
Using
Using aa PL/SQL
PL/SQL Document
Document Attribute
Attribute

g.
g. Assign
Assign item
item attribute
attribute Requestor
Requestor as
as the
the
performer
performer on
on the
the Vacation
Vacation Schedule
Schedule notification
notification
node.
node.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 15
Guided Practice Les 13-1 Setting a Document Attribute
Value

Guided
Guided Practice
Practice Les
Les 13-1
13-1
Setting
Setting aa Document
Document Attribute
Attribute Value
Value

3.
3. The
The Document
Document attribute
attribute value
value should
should be
be set
set to:
to:
PLSQL:<package.procedure>/<Document
PLSQL:<package.procedure>/<Document ID>
ID>
For example,
For example,
PLSQL:WFVACXX.VACATION_SCHEDULED/&REQUESTOR
PLSQL:WFVACXX.VACATION_SCHEDULED/&REQUESTOR

In
In the
the message
message attribute
attribute Properties
Properties set
set the
the value
value
of
of your
your Document
Document message
message attribute:
attribute:
a.
a. To
To aa corresponding
corresponding Document
Document itemitem attribute.
attribute.
Set
Set the
the item
item attribute
attribute value
value as
as aa Constant
Constant inin the
the
item attribute Properties Default Value
item attribute Properties Default Value or at or at
runtime
runtime in in the
the Initiate
Initiate Workflow
Workflow webweb page.
page.
b.
b. ToTo aa Constant
Constant value.
value.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 16
Guided Practice Les 13-1 Testing a PL/SQL Document
(HTML)

Guided
Guided Practice
Practice Les
Les 13-1
13-1
Testing
Testing aa PL/SQL
PL/SQL Document
Document (HTML)
(HTML)

4.
4. A
A PL/SQL
PL/SQL Document
Document is is generated
generated with
with display
display type
type
of
of text/html
text/html when
when the
the message
message isis viewed
viewed through
through
the
the Notification
Notification Details
Details web
web page.
page.
a.
a. Launch
Launch aa Vacation
Vacation Proposal
Proposal work
work item
item and
and
approve
approve the
the proposal.
proposal.
b.
b. Open
Open the
the Vacation
Vacation Schedule
Schedule notification
notification from
from
the
the Worklist
Worklist and
and review
review your
your document.
document.
c.
c. Correct
Correct any
any formatting
formatting oror processing
processing errors
errors
needed
needed inin your
your PL/SQL
PL/SQL procedure.
procedure. Use
Use the
the
browser
browser Reload
Reload option
option to
to display
display the
the updated
updated
version
version of
of the
the Vacation
Vacation Schedule
Schedule notification
notification
details.
details.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 17
Les 13-1 Summary

Les
Les 13-1
13-1 Summary
Summary

In
In this
this practice,
practice, you
you should
should have
have learned
learned how
how to:
to:
•• Write
Write aa PL/SQL
PL/SQL procedure
procedure to
to create
create aa document
document
based on application data
based on application data
•• Embed
Embed aa PL/SQL
PL/SQL Document
Document inin aa message
message
•• Attach
Attach aa PL/SQL
PL/SQL Document
Document toto aa message
message
•• Set
Set the
the value
value of
of aa PL/SQL
PL/SQL Document
Document attribute
attribute

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Practice Les 13-2 Overview

Practice
Practice Les
Les 13-2
13-2 Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Creating
Creating aa function
function activity
activity with
with aa result
result type
type
–– write
write aa supporting
supporting PL/SQL
PL/SQL procedure
procedure to
to check
check
for
for Requestor
Requestor equal
equal to
to Approver
Approver
–– return
return result
result of
of Y
Yor
or N
N
•• Branching
Branching on on aa function
function activity
activity result
result
–– ifif function
function returns
returns Yes,
Yes, reject
reject proposal
proposal
–– ifif function
function returns
returns No,
No, continue
continue process
process

Copyright  Oracle Corporation, 2000. All rights reserved.

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 19
Guided Practice Les 13-2 Creating a PL/SQL
Procedure with Result

Guided
Guided Practice
Practice Les
Les 13-2
13-2
Creating
Creating aa PL/SQL
PL/SQL Procedure
Procedure with
with Result
Result
1.
1. Use
Use the
the standard
standard API
API format
format for
for your
your PL/SQL
PL/SQL
specification and body.
specification and body.
procedure
procedure <procedure
<procedure name>
name>
(itemtype
(itemtype inin varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
actid
actid in
in number,
number,
funcmode
funcmode in
in varchar2,
varchar2,
resultout
resultout out
out varchar2)
varchar2)
a.
a. Add
Add to
to your
your package
package “WFVACXX”
“WFVACXX” created
created in
in
practice Les 8-1.
practice Les 8-1.
b.
b. Give
Give your
your procedure
procedure aa descriptive
descriptive name,
name, such
such
as
as CHECK_APPROVER.
CHECK_APPROVER.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 20
Guided Practice Les 13-2 RUN processing

Guided
Guided Practice
Practice Les
Les 13-2
13-2
RUN
RUN processing
processing

c.
c. In
In your
your PL/SQL
PL/SQL procedure
procedure include
include logic
logic for
for
RUN
RUN funcmode:
funcmode:
–– retrieve
retrieve the
the values
values for
for requestor
requestor andand
approver
approver using API calls to
using API calls to
wf_engine.GetItemAttrText
wf_engine.GetItemAttrText
–– if
if requestor
requestor <>
<> approver
approver set
set resultout
resultout to
to
wf_engine.eng_completed||’:’||’N’
wf_engine.eng_completed||’:’||’N’
–– if
if requestor
requestor == approver
approver set
set resultout
resultout to
to
wf_engine.eng_completed||’:’||’Y’
wf_engine.eng_completed||’:’||’Y’

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 21
Guided Practice Les 13-2 CANCEL processing

Guided
Guided Practice
Practice Les
Les 13-2
13-2
CANCEL
CANCEL processing
processing

d.
d. Specific
Specific logic
logic is
is not
not necessary
necessary for
for CANCEL
CANCEL
funcmode,
funcmode, set
set resultout
resultout to
to
wf_engine.eng_completed||’:’||
wf_engine.eng_completed||’:’||
wf_engine.eng_null
wf_engine.eng_null

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 22
Guided Practice Les 13-2 Adding a Function Activity

Guided
Guided Practice
Practice Les
Les 13-2
13-2
Adding
Adding aa Function
Function Activity
Activity
2.
2. In
In the
the Workflow
Workflow Builder
Builder Vacation
Vacation Proposal
Proposal process
process
diagram:
diagram:
a.
a. Delete
Delete the
the transition
transition between
between the the Start
Start and
and
Vacation Proposal notification nodes.
Vacation Proposal notification nodes.
b.
b. Click on
Click on the
the New
New Function
Function icon,
icon, position
position the
the
cross-hairs
cross-hairs between
between the
the Start
Start and
and Vacation
Vacation
Proposal
Proposal notification
notification nodes,
nodes, andand click
click again
again to
to
open
open the
the properties.
properties.
c.
c. Enter
Enter unique
unique Internal
Internal and
and Display
Display Names
Names (such
(such
as
as CHECK_APPROVER and Approver same as
CHECK_APPROVER and Approver same as
Requestor?),
Requestor?), select
select an
an icon
icon ,, and
and enter
enter aa
Function
Function Name
Name using
using format
format
<package.procedure>
<package.procedure> for for the
the PL/SQL
PL/SQL
procedure
procedure you
you just
just created.
created. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 23
Guided Practice Les 13-2 Adding a Function Activity
Continued

Guided
Guided Practice
Practice Les
Les 13-2
13-2
Adding
Adding aa Function
Function Activity
Activity Continued
Continued
d.
d. Draw
Draw aa transition
transition from
from Start
Start to
to Approver
Approver same
same
as Requestor? node.
as Requestor? node.
e.
e. Draw
Draw aa transition
transition from
from Approver
Approver same
same as as
Requestor?
Requestor? to to Vacation
Vacation Proposal
Proposal notification
notification
node,
node, select
select ‘No’
‘No’ from
from Results
Results menu.
menu.
f.f. Drag
Drag and
and drop
drop anan additional
additional End
End node
node from
from the
the
Standard
Standard item
item type
type into
into your
your diagram.
diagram. On On the
the
Node
Node properties
properties tab,
tab, set
set the
the Result
Result to
to Reject.
Reject.
g.
g. DrawDraw aa transition
transition from
from Approver
Approver same
same as as
Requestor?
Requestor? to to new
new EndEnd (Reject)
(Reject) node,
node, select
select
‘Yes’
‘Yes’ or
or <Default>
<Default> from
from Results
Results menu.
menu.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 24
Les 13-2 Summary

Les
Les 13-2
13-2 Summary
Summary

In
In this
this practice,
practice, you
you should
should have
have learned
learned how
how to:
to:
•• Write
Write aa PL/SQL
PL/SQL procedure
procedure that
that returns
returns aa result
result
•• Draw
Draw aa diagram
diagram that
that branches
branches on
on aa result
result from
from aa
function
function activity
activity

Copyright  Oracle Corporation, 2000. All rights reserved.

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 25
Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL Documents
Chapter 13 - Page 26
Selector Functions
Chapter 14

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector Functions
Chapter 14 - Page 1
Selector Functions

Selector
Selector Functions
Functions

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector Functions
Chapter 14 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson
lesson you
you should
should bebe able
able to:
to:
•• Create
Create aa standard
standard API
API for
for aa selector/callback
selector/callback
function
function
•• Define
Define aa selector/callback
selector/callback function
function
•• Call
Call aa selector/callback
selector/callback function
function

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector Functions
Chapter 14 - Page 3
Item Type Selector Function

Item
Item Type
Type Selector
Selector Function
Function

•• An
An item
item type
type can
can have
have more
more than
than one
one runnable
runnable
process
process activity
activity associated
associated withwith it.
it.
•• PL/SQL
PL/SQL selector
selector functions
functions areare defined
defined toto
determine
determine which process activity to
which process activity to run
run in
in aa
particular situation.
particular situation.
•• Selector
Selector functions
functions can
can be
be extended
extended to to be
be aa general
general
callback
callback function
function soso that
that item
item type
type context
context
information
information can
can be
be reset
reset as
as needed
needed ifif the
the SQL
SQL
session is interrupted.
session is interrupted.
•• Associate
Associate aa Selector
Selector Function
Function withwith an
an Item
Item Type
Type
through the item type properties.
through the item type properties.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Standard API for the Selector/Callback Function

Standard
Standard API
API for
for the
the Selector/Callback
Selector/Callback
Function
Function

•• You
You can
can define
define one
one PL/SQL
PL/SQL procedure
procedure that
that
includes
includes both
both selector
selector and
and callback
callback
functionality
functionality by
by following
following aa standard
standard API.
API.

procedure
procedure <procedure
<procedure name>
name>
(itemtype in
(itemtype in varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
actid
actid in
in number,
number,
command
command in
in varchar2,
varchar2,
resultout
resultout out
out varchar2)
varchar2)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
Standard API for the Selector/Callback Function
(continued)

Standard
Standard API
API for
for the
the Selector/Callback
Selector/Callback
Function
Function (continued)
(continued)

•• You
You can
can define
define one
one PL/SQL
PL/SQL procedure
procedure that
that
includes
includes both
both selector
selector and
and callback
callback
functionality
functionality by
by following
following aa standard
standard API.
API.

procedure
procedure <procedure
<procedure name>
name>
(itemtype
(itemtype inin varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
actid
actid in
in number,
number,
command
command in
in varchar2,
varchar2,
resultout
resultout out
out varchar2)
varchar2)

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Defining a Selector/Callback Function

Defining
Defining aa Selector/Callback
Selector/Callback Function
Function

•• itemtypethe
itemtypethe internal
internal name
name for
for the
the item
item type.
type.
Defined
Defined inin the
the Oracle
Oracle Workflow
Workflow Builder.
Builder.
•• itemkeya
itemkeya string
string that
that represents
represents aa primary
primary key key
generated
generated by the workflow-enabled application for
by the workflow-enabled application for
the
the item
item type.
type. The
The string
string uniquely
uniquely identifies
identifies thethe
item
item within
within an
an item
item type.
type.
•• actidthe
actidthe ID ID number
number of of the
the activity
activity that
that this
this
procedure
procedure is is called
called from.
from. This
This parameter
parameter is is always
always
null if the procedure is called with the
null if the procedure is called with the ‘RUN’ ‘RUN’
command
command to to execute
execute the
the selector
selector function.
function.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector Functions
Chapter 14 - Page 7
Defining a Selector/Callback Function (continued)

Defining
Defining aa Selector/Callback
Selector/Callback Function
Function
(continued)
(continued)

•• commanddetermines
commanddetermines how how to to execute
execute the
the
selector/callback
selector/callback function.
function.
•• resultouta
resultouta result
result may
may be
be returned
returned depending
depending onon
the command used to call the selector/callback
the command used to call the selector/callback
function
function

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Calling a Selector/Callback Function

Calling
Calling aa Selector/Callback
Selector/Callback Function
Function
Oracle Workflow can call the selector/callback function
with the following commands:
•• RUNto
RUNto select
select the
the appropriate
appropriate process
process toto start
start
when either of the following conditions
when either of the following conditions occur: occur:
–– AA process
process isis not
not explicitly
explicitly passed
passed to
to
WF_ENGINE.CreateProcess.
WF_ENGINE.CreateProcess.
–– AA process
process isis implicitly
implicitly started
started by
by
WF_ENGINE.CompleteActivity
WF_ENGINE.CompleteActivity with with no
no prior
prior
call to WF_ENGINE.CreateProcess.
call to WF_ENGINE.CreateProcess.
•• SET_CTXto
SET_CTXto establish
establish any
any context
context information
information
that
that aa function
function activity
activity in
in an
an item
item type
type needs
needs to to
execute,
execute, before
before aa new
new database
database session
session begins.
begins.
•• TEST_CTXto
TEST_CTXto determine
determine ifif the
the current
current item
item type
type
context is correct before executing a function.
context is correct before executing a function. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector Functions
Chapter 14 - Page 9
Practice Les 14-1 Overview

Practice
Practice Les
Les 14-1
14-1 Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Creating
Creating additional
additional processes
processes inin the
the WFVACXX
WFVACXX
item type
item type
–– duplicate
duplicate the
the Vacation
Vacation Proposal
Proposal process,
process, but
but
implement
implement anan alternate
alternate Vacation
Vacation Proposal
Proposal
notification
notification Timeout
Timeout
•• Assigning
Assigning aa Selector
Selector function
function to
to an
an Item
Item Type
Type
•• Creating
Creating aa Selector
Selector function
function to
to choose
choose which
which
process
process to run based on the item key
to run based on the item key value
value
•• Testing
Testing aa Selector
Selector function
function

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector Functions
Chapter 14 - Page 10
Guided Practice Les 14-1 Duplicating a Process

Guided
Guided Practice
Practice Les
Les 14-1
14-1
Duplicating
Duplicating aa Process
Process
1.
1. In
In the
the Workflow
Workflow Builder
Builder Navigator
Navigator openopen and
and expand
expand
the
the <WFVACXX>
<WFVACXX> item item type:
type:
a.
a. Drag
Drag and
and drop
drop the
the Vacation
Vacation Proposal
Proposal process
process
onto
onto the WFVACXX item type to create a copy.
the WFVACXX item type to create a copy.
When
When thethe process
process properties
properties window
window opens,
opens, enter
enter
new
new internal
internal and
and display
display names
names forfor the
the duplicate
duplicate
process.
process. ForFor example,
example,
WFVACXX_PROCESS_ALTERNATE
WFVACXX_PROCESS_ALTERNATE and and Alternate
Alternate
Vacation
Vacation Proposal.
Proposal.
b.
b. Open
Open the
the Alternate
Alternate Vacation
Vacation Proposal
Proposal process
process
diagram. Replace the Vacation
diagram. Replace the Vacation Proposal Proposal
notification
notification <Timeout>
<Timeout> to to aa Loop
Loop Counter
Counter with
with aa
<Timeout> transition back to the
<Timeout> transition back to the Vacation Vacation
Proposal
Proposal notification.
notification. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 11
Guided Practice Les 14-1 Assigning a Selector
Function

Guided
Guided Practice
Practice Les
Les 14-1
14-1
Assigning
Assigning aa Selector
Selector Function
Function
2.
2. In
In the
the Workflow
Workflow Builder
Builder Navigator
Navigator open
open the
the
properties
properties for the <WFVACXX> item type
for the <WFVACXX> item type and
and enter
enter
aa <package.procedure>
<package.procedure> value in the Selector field.
value in the Selector field.
For
For example,
example, WFVACXX.SELECTOR.
WFVACXX.SELECTOR.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector Functions
Chapter 14 - Page 12
Guided Practice Les 14-1 Creating a Selector
Procedure

Guided
Guided Practice
Practice Les
Les 14-1
14-1
Creating
Creating aa Selector
Selector Procedure
Procedure
3.
3. Use
Use the
the standard
standard API
API format
format for
for your
your PL/SQL
PL/SQL
specification and body.
specification and body.
procedure
procedure <procedure
<procedure name>
name>
(itemtype
(itemtype inin varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
actid
actid in
in number,
number,
command
command in
in varchar2,
varchar2,
resultout
resultout in
in out
out varchar2)
varchar2)

a.
a. Add
Add to
to your
your package
package “WFVACXX”
“WFVACXX” created
created in
in
practice
practice Les
Les 8-1.
8-1.
b.
b. Give
Give your
your procedure
procedure the
the same
same name
name assigned
assigned
as
as the
the item
item type
type Selector
Selector <procedure>
<procedure> value.
value. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector Functions
Chapter 14 - Page 13
Guided Practice Les 14-1 RUN processing

Guided
Guided Practice
Practice Les
Les 14-1
14-1
RUN
RUN processing
processing
4.
4. In
In your
your SELECTOR
SELECTORprocedure
procedure include
include logic
logic for
for the
the
RUN
RUN command:
command:
a.
a. Evaluate
Evaluate the the value
value passed
passed in in the
the item
item key.
key.
IfIf the
the upper case value of the first four
upper case value of the first four
characters
characters is: is:
–– ‘CNTR’
‘CNTR’ return
return the
the internal
internal name
name of of the
the
process
process with
with the
the Loop
Loop Counter
Counter Timeout
Timeout
implementation
implementation
–– ‘SELF’
‘SELF’ return
return the
the internal
internal name
name of of the
the
process with the Self Loop
process with the Self Loop Timeout Timeout
implementation
implementation
–– neither
neither value,
value, either
either raise
raise an
an error
error oror return
return
one
one of
of the
the processes
processes as as the
the default
default process
process ®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 14
Guided Practice Les 14-1 Testing a Selector Function

Guided
Guided Practice
Practice Les
Les 14-1
14-1
Testing
Testing aa Selector
Selector Function
Function

5.
5. Connect
Connect toto the
the Oracle
Oracle Workflow
Workflow home
home page.
page. Log
Log
on
on as
as any
any user
user with
with “Administrator”
“Administrator” privileges.
privileges.
a.
a. Select
Select the
the Launch
Launch Processes
Processes link
link
b.
b. Select
Select your
your Item
Item Type
Type link
link from
from the
the list
list
c.
c. On
On the
the Initiate
Initiate Workflow
Workflow pagepage enter:
enter:
–– an
an item
item key
key to
to exercise
exercise your
your Selector
Selector logic
logic
(values prefixed with ‘CNTR’, ‘SELF’,
(values prefixed with ‘CNTR’, ‘SELF’, etc.)etc.)
–– a
a unique
unique user
user key
key
–– a
a Process
Process Name
Name of
of None
None from
from the
the poplist
poplist
–– a
a requestor
requestor and
and approver
approver
–– a
a from
from and
and to
to date
date (DD-MON-RR)
(DD-MON-RR) ®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 15
Guided Practice Les 14-1: Monitoring the Results

Guided
Guided Practice
Practice Les
Les 14-1:
14-1:
Monitoring
Monitoring the
the Results
Results

6.
6. Display
Display the
the Monitor
Monitor web
web pages
pages for
for your
your work
work item.
item.
The
The process
process run
run will
will appear
appear in
in the:
the:
–– Monitor
Monitor Process
Process List,
List, Process
Process Name
Name column
column
–– Monitor
Monitor Activities
Activities List,
List, Parent
Parent Activity
Activity column
column
–– Monitor
Monitor Diagram,
Diagram, Process
Process Title
Title and
and Diagram
Diagram
itself
itself
Verify
Verify that
that the
the expected
expected process
process waswas run.
run. IfIf an
an
error
error occurred in your process, use the Result
occurred in your process, use the Result
Exception
Exception link
link in
in the
the Activities
Activities List
List to
to determine
determine
the
the cause.
cause.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 16
Les 14-1 Summary

Les
Les 14-1
14-1 Summary
Summary

In
In this
this practice,
practice, you
you should
should have
have learned
learned how
how to:
to:
•• Write
Write aa PL/SQL
PL/SQL procedure
procedure toto select
select which
which process
process
to run
to run
•• Assign
Assign aa Selector
Selector function
function to
to an
an item
item type
type
•• Cause
Cause the
the Workflow
Workflow Engine
Engine to
to run
run aa Selector
Selector
function
function
•• Verify
Verify that
that your
your Selector
Selector function
function returns
returns the
the
process name expected
process name expected

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Copyright © Oracle Corporation, 2000. All rights reserved.

Selector Functions
Chapter 14 - Page 18
External System Integration
Chapter 15

Copyright © Oracle Corporation, 2000. All rights reserved.

External System Integration


Chapter 15 - Page 1
External System Integration

External
External System
System Integration
Integration

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

External System Integration


Chapter 15 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson
lesson you
you should
should be be able
able to:
to:
•• Understand
Understand thethe options
options toto incorporate
incorporate external
external
system processing in a workflow process.
system processing in a workflow process.
•• Describe
Describe the
the concept
concept ofof Advanced
Advanced Queues.
Queues.
•• Describe
Describe how
how to
to pause
pause and
and resume
resume aa workflow
workflow
process.
process.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

External System Integration


Chapter 15 - Page 3
Oracle Workflow Terms

Oracle
Oracle Workflow
Workflow Terms
Terms

•• BlockActivity
BlockActivity
•• CompleteActivity
CompleteActivity

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

External System Integration


Chapter 15 - Page 4
External Function Activity Support

External
External Function
Function Activity
Activity Support
Support

Oracle8
Advanced
Queues

Function
Activity External Execution
Agent
• Java
• CORBA
• OS command
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
Advanced Queues Processing

Advanced
Advanced Queues
Queues Processing
Processing
•• Oracle
Oracle Workflow
Workflow queue
queue APIs
APIs are
are called
called to
to handle
handle
workflow Advanced Queues Processing.
workflow Advanced Queues Processing.
•• An
An ‘outbound’
‘outbound’ and
and ‘inbound’
‘inbound’ queue
queue isis established.
established.
•• A
A package
package ofof data
data on
on the
the queue
queue isis referred
referred to
to as
as
an
an event
event or
or aa message.
message.
•• Events
Events are
are enqueued
enqueued in in the
the outbound
outbound queuequeue for
for
agents to consume and process.
agents to consume and process.
•• An
An agent
agent may
may enqueue
enqueue aa message
message to to the
the inbound
inbound
queue
queue for
for the
the Workflow
Workflow Engine
Engine toto consume
consume and and
process.
process.
•• Outbound
Outbound and and inbound
inbound queues
queues facilitate
facilitate the
the
integration
integration of external activities into
of external activities into the
the workflow
workflow
process.
process.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Advanced Queue Integration

Advanced
Advanced Queue
Queue Integration
Integration

Oracle Server External System

External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine

WF Deferred External Process

Background
Engine
WF Inbound
External Outbound

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Advanced Queue Integration

Advanced
Advanced Queue
Queue Integration
Integration

Oracle Server External System

External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine

WF Deferred External Process

Background
Engine
WF Inbound
External Outbound

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Advanced Queue Integration

Advanced
Advanced Queue
Queue Integration
Integration

Oracle Server External System

External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine

WF Deferred External Process

Background
Engine
WF Inbound
External Outbound

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
Advanced Queue Integration

Advanced
Advanced Queue
Queue Integration
Integration

Oracle Server External System

External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine

WF Deferred External Process

Background
Engine
WF Inbound
External Outbound

Copyright  Oracle Corporation, 2000. All rights reserved.

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 10
Advanced Queue Integration

Advanced
Advanced Queue
Queue Integration
Integration

Oracle Server External System

External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine

WF Deferred External Process

Background
Engine
WF Inbound
External Outbound

Copyright  Oracle Corporation, 2000. All rights reserved.

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 11
Advanced Queue Integration

Advanced
Advanced Queue
Queue Integration
Integration

Oracle Server External System

External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine

WF Deferred External Process

Background
Engine
WF Inbound
External Outbound

Copyright  Oracle Corporation, 2000. All rights reserved.

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 12
Advanced Queue Integration

Advanced
Advanced Queue
Queue Integration
Integration

Oracle Server External System

External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine

WF Deferred External Process

Background
Engine
WF Inbound
External Outbound

Copyright  Oracle Corporation, 2000. All rights reserved.

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 13
Block Activity

Block
Block Activity
Activity

•• is
is aa standard
standard function
function activity
activity alternative
alternative to
to
incorporating
incorporating external
external system
system processing.
processing.
•• lets
lets you
you pause
pause aa process
process until
until an
an external
external program
program
or manual step completes.
or manual step completes.
•• delays
delays aa process
process until
until aa particular
particular condition
condition is
is met.
met.
•• requires
requires aa program
program to
to issue
issue aa call
call to
to
WF_ENGINE.CompleteActivity
WF_ENGINE.CompleteActivity to to resume
resume the
the
process
process at
at the
the Block
Block activity.
activity.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

External System Integration


Chapter 15 - Page 14
CompleteActivity

CompleteActivity
CompleteActivity

•• Notifies
Notifies the
the Workflow
Workflow Engine
Engine that
that the
the specified
specified
activity
activity for
for an
an item
item has
has been
been completed.
completed.

procedure
procedure CompleteActivity
CompleteActivity
(itemtype
(itemtype in
in varchar2,
varchar2,
itemkey
itemkey in
in varchar2,
varchar2,
activity
activity in
in varchar2,
varchar2,
result_code
result_code in
in varchar2);
varchar2);

Copyright  Oracle Corporation, 2000. All rights reserved.

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 15
Copyright © Oracle Corporation, 2000. All rights reserved.

External System Integration


Chapter 15 - Page 16
Forced Synchronous
Processing
Chapter 16

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous Processing


Chapter 16 - Page 1
Forced Synchronous Processing

Forced
Forced Synchronous
Synchronous Processing
Processing

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous Processing


Chapter 16 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson,
lesson, you
you should
should be
be able
able to:
to:
•• Describe
Describe forced
forced synchronous
synchronous processing.
processing.
•• Describe
Describe process
process definition
definition restrictions.
restrictions.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous Processing


Chapter 16 - Page 3
Forced Synchronous Processes

Forced
Forced Synchronous
Synchronous Processes
Processes

•• A
A synchronous
synchronous process
process includes
includes consecutive
consecutive
function
function activities
activities in
in aa single
single thread
thread that
that are
are not
not
deferred to the background engine.
deferred to the background engine.
•• A
A forced
forced synchronous
synchronous process
process completes
completes inin aa
single SQL session and never inserts or
single SQL session and never inserts or updatesupdates
any
any database
database tables.
tables.
•• A
A forced
forced synchronous
synchronous process,
process, therefore,
therefore,
generates
generates aa result
result more
more quickly
quickly than
than aa
synchronous
synchronous process.
process.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Process Definition Restrictions

Process
Process Definition
Definition Restrictions
Restrictions

•• Process
Process definitions
definitions must
must adhere
adhere to
to various
various
restrictions:
restrictions:
–– No
No Notification
Notification Activities
Activities
–– Limited
Limited Blocking
Blocking Activity
Activity Use
Use
–– No
No Error
Error Processing
Processing
–– No
No Master/Detail
Master/Detail Coordination
Coordination Activities
Activities
–– No
No Parallel
Parallel Flows
Flows

Copyright  Oracle Corporation, 2000. All rights reserved.

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 process’s
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 5
Process Definition Restrictions (continued)

Process
Process Definition
Definition Restrictions
Restrictions
(continued)
(continued)

•• Process
Process definitions
definitions must
must adhere
adhere toto various
various
restrictions:
restrictions:
–– Some
Some Standard
Standard Activities
Activities are
are Not
Not Supported
Supported
–– No
No Deferred
Deferred Processing
Processing
–– No
No Process
Process Status
Status Information
Information is
is Saved
Saved

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Process Definition Restrictions (continued)

Process
Process Definition
Definition Restrictions
Restrictions
(continued)
(continued)

•• Limited
Limited WF_ENGINE
WF_ENGINE API
API calls:
calls:
–– CreateProcess
CreateProcess
–– StartProcess
StartProcess
–– SetItemAttribute
SetItemAttribute
–– GetItemAttribute
GetItemAttribute
–– GetActivityAttribute
GetActivityAttribute
–– CompleteActivity
CompleteActivity

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous Processing


Chapter 16 - Page 8
Purge
Chapter 17

Copyright © Oracle Corporation, 2000. All rights reserved.

Purge
Chapter 17 - Page 1
Purge

Purge
Purge

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Purge
Chapter 17 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson
lesson you
you should
should be
be able
able to:
to:
•• Purge
Purge obsolete
obsolete Workflow
Workflow runtime
runtime data
data

Copyright  Oracle Corporation, 2000. All rights reserved.

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 3
Purging Obsolete Workflow Data

Purging
Purging Obsolete
Obsolete Workflow
Workflow Data
Data

•• Purge
Purge APIs
APIs delete
delete obsolete
obsolete runtime
runtime data
data and
and
activity
activity versions
versions no
no longer
longer in
in use.
use.
•• The
The most
most commonly
commonly used
used WF_PURGE
WF_PURGE APIs:APIs:
–– Items
Items –– purge
purge all
all runtime
runtime data
data associated
associated with
with
completed
completed items, their processes, and
items, their processes, and
notifications
notifications sent
sent byby them.
them.
–– Activities
Activities –– purge
purge obsolete
obsolete versions
versions ofof
activities
activities that
that are
are no
no longer
longer in
in use
use by
by any
any item.
item.
–– Total
Total –– purge
purge both
both item
item data
data and
and activity
activity data.
data.
–– AdHocDirectory
AdHocDirectory -- purgepurge users
users and
and roles
roles in
in the
the
WF_LOCAL_*
WF_LOCAL_* tablestables whose
whose expiration
expiration date
date
has
has elapsed
elapsed andand that
that are
are not
not referenced
referenced inin any
any
notification.
notification.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 object’s 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 4
Purging Obsolete Workflow Data in Oracle Applications

Purging
Purging Obsolete
Obsolete Workflow
Workflow Data
Data
in
in Oracle
Oracle Applications
Applications
•• Use
Use the
the concurrent
concurrent program
program Purge
Purge Obsolete
Obsolete
Workflow
Workflow Runtime
Runtime Data,
Data, short
short name
name FNDWFPR.
FNDWFPR.
•• Systems
Systems administrator
administrator should
should add
add the
the concurrent
concurrent
program
program to to the
the security
security group
group for
for the
the
responsibility
responsibility you
you wish
wish to
to run
run this
this program
program from.
from.
•• Navigate
Navigate toto the
the Submit
Submit Request
Request form
form in
in Oracle
Oracle
Applications.
Applications.
•• Supply
Supply the
the following
following parameters:
parameters:
–– Item
Item Type
Type
–– Item
Item Key
Key
–– Age
Age
–– Persistence
Persistence Type
Type
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 object’s 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 5
Purging Obsolete Workflow Data in Oracle Applications
(continued)

Purging
Purging Obsolete
Obsolete Workflow
Workflow Data
Data
in
in Oracle
Oracle Applications
Applications (continued)
(continued)

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Purge
Chapter 17 - Page 6
Demonstration

Demonstration
Demonstration

In Oracle Workflow we will demonstrate how to:


•• Run
Run the WF_PURGE.Total API
the WF_PURGE.Total API
•• Show
Show the
the effects
effects of
of purge
purge

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Purge
Chapter 17 - Page 7
Copyright © Oracle Corporation, 2000. All rights reserved.

Purge
Chapter 17 - Page 8
Document Management
Integration
Chapter 18

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management Integration


Chapter 18 - Page 1
Document Management Integration

Document
Document Management
Management Integration
Integration

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management Integration


Chapter 18 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson
lesson you
you should
should be
be able
able to:
to:
•• Describe
Describe how
how DM
DM systems
systems integrate
integrate with
with Oracle
Oracle
Workflow.
Workflow.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management Integration


Chapter 18 - Page 3
Document Management Integration

Document
Document Management
Management Integration
Integration

Notification
Activities

PL/SQL Interface Layer

Document
Management
System
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Document Management

Document
Document Management
Management

Document can be
viewed online
Attached Document

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
Defining Document Management Repositories

Defining
Defining Document
Document Management
Management
Repositories
Repositories

•• Seamless
Seamless open
open integration
integration
•• Communications
Communications through
through aa web
web server
server agent
agent
interface
interface

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Document Management Integration in Notifications

Document
Document Management
Management Integration
Integration in
in
Notifications
Notifications

•• To
To access
access aa referenced
referenced DM DM document
document in in aa specific
specific
notification,
notification, view
view it
it from
from the
the Notification
Notification Details
Details
web
web page
page and
and select
select thethe document
document link.
link.
•• To
To respond to a notification by attaching aa
respond to a notification by attaching
document,
document, select
select the
the paper
paper clip
clip icon
icon which
which
appears
appears next
next to
to the
the field
field that
that requires
requires aa document
document
response.
response.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management Integration


Chapter 18 - Page 7
Accessing a DM Document Sent by a Notification

Accessing
Accessing aa DM
DM Document
Document Sent
Sent by
by aa
Notification
Notification
•• When
When you you view
view aa notification
notification from
from the
the Notification
Notification
Details
Details web page, the body of the message may
web page, the body of the message may
include
include aa reference
reference linklink to
to aa DM
DM document.
document. ThisThis
link
link allows
allows access
access to to the
the DMDM system.
system.
•• Click
Click onon the
the link
link to
to display
display aa DMDM integration
integration screen
screen
in
in aa new
new browser
browser window.
window.
•• The
The screen
screen displays
displays aa Launch
Launch Document
Document toolbar
toolbar
and
and the content of the referenced DM
the content of the referenced DM document.
document.
The
The toolbar
toolbar buttons
buttons are are fixed
fixed and
and represent
represent
standard
standard functions
functions regardless
regardless of of the
the DM
DM system
system
you
you are
are integrating
integrating with.
with.
•• Click
Click onon any
any ofof the
the toolbar
toolbar buttons
buttons to to perform
perform any
any
of
of the
the standard
standard functions.
functions.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 8
Responding to a Notification with a DM Document

Responding
Responding to
to aa Notification
Notification with
with aa DM
DM
Document
Document
•• When
When you you view
view aa notification
notification from
from the
the Notification
Notification
Details
Details web
web page,
page, certain
certain response
response fields
fields may
may
display
display paper
paper clip
clip icons.
icons. These
These fields
fields prompt
prompt for
for aa
DM document as part of the notification
DM document as part of the notification response. response.
The
The paper
paper clip
clip icon
icon provides
provides thethe direct
direct access
access toto
the DM system.
the DM system.
•• Click
Click onon the
the paper
paper clip
clip icon
icon to
to display
display aa DM
DM screen
screen
in
in aa new
new browser
browser window.
window.
•• The
The screen
screen displays
displays aa Launch
Launch Document
Document toolbar
toolbar
and
and the default DM system’s native search screen.
the default DM system’s native search screen.
The
The toolbar
toolbar buttons
buttons are are fixed
fixed and
and represent
represent
standard
standard functions
functions regardless
regardless of of the
the DM
DM system
system
you
you are
are integrating
integrating with.
with.
•• Click
Click onon any
any of
of the
the toolbar
toolbar buttons
buttons to to perform
perform any
any
of
of the
the standard
standard functions.
functions. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 9
Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management Integration


Chapter 18 - Page 10
Setting Up Oracle Workflow
Chapter 19

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 1
Setting Up Oracle Workflow

Setting
Setting Up
Up Oracle
Oracle Workflow
Workflow

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson
lesson youyou should
should bebe able
able to:
to:
•• Define
Define the
the required
required setup
setup steps
steps of
of Oracle
Oracle
Workflow.
Workflow.
•• Define
Define the
the optional
optional setup
setup steps
steps of
of Oracle
Oracle
Workflow.
Workflow.
•• Understand
Understand the the access
access protection
protection feature
feature of
of
Oracle
Oracle Workflow.
Workflow.
•• Transfer
Transfer workflow
workflow definitions
definitions between
between aa database
database
and
and flat
flat file.
file.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 3
Required Set Up Steps

Required
Required Set
Set Up
Up Steps
Steps

Step 1 Step 2 Step 3


Global User Directory WF_LANGUAGES
Preferences Service View

Step 4 Step 5 Step 6


http_proxy WF_RESOURCES Background
Environment Environment Workflow
Variable Variable Engines

Background
Engines

Copyright  Oracle Corporation, 2000. All rights reserved.

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 Workflow’s directory service to the users and roles currently defined
in your organization’s 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 4
Step 1 Setting Global User Preferences

Step
Step 11
Setting
Setting Global
Global User
User Preferences
Preferences

•• Use
Use the
the Global
Global Preferences
Preferences web
web page
page to:
to:
–– define
define the
the Workflow
Workflow administrator
administrator role
role and
and
Workflow web agent.
Workflow web agent.
–– set
set default
default user
user preference
preference values
values for
for the
the
entire
entire enterprise.
enterprise.
•• Entries
Entries in
in User
User Preferences
Preferences web
web page
page override
override
those
those defaults
defaults set
set in
in the
the Global
Global Preferences
Preferences webweb
page.
page.
•• Both
Both web
web pages
pages are
are accessible
accessible from
from the
the Oracle
Oracle
Workflow
Workflow Home
Home page.
page.
•• Global
Global Preferences
Preferences webweb page
page only
only available
available toto the
the
Workflow
Workflow administrator
administrator role.
role.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
Step 2 Setting Up an Oracle Workflow Directory Service

Step
Step 22
Setting
Setting Up
Up an
an Oracle
Oracle Workflow
Workflow Directory
Directory
Service
Service
Oracle Workflow :
•• offers
offers flexibility
flexibility in
in defining
defining who
who the
the workflow
workflow
users and roles
users and roles are. are.
•• references
references any any directory
directory repository
repository for
for users
users and
and
roles
roles information
information by by creating
creating views
views based
based on
on the
the
database
database tables
tables making
making up up that
that repository.
repository.
•• provides
provides local
local tables
tables that
that contain
contain columns
columns similar
similar
to
to those
those defined
defined in in the
the views.
views. These
These tables
tables are
are
used
used to store users and roles not included in the
to store users and roles not included in the
existing
existing directory
directory repository.
repository.
•• provides
provides predefined
predefined Directory
Directory Service
Service view
view
definition
definition andand verification
verification scripts
scripts
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Step 3 Verifying the WF_LANGUAGES View

Step
Step 33
Verifying
Verifying the
the WF_LANGUAGES
WF_LANGUAGES View
View

•• WF_LANGUAGES
WF_LANGUAGES view view is
is predefined
predefined in in Oracle
Oracle
Workflow
Workflow Directory
Directory Services
Services scripts.
scripts.
•• Verify
Verify that
that the
the view
view definition
definition identifies
identifies thethe
languages
languages defined in your Oracle installation.
defined in your Oracle installation.
•• Customize
Customize thethe view
view definition
definition ifif necessary.
necessary.
•• WF_LANGUAGES
WF_LANGUAGES allows allows for
for translation
translation of
of field
field
values
values in
in the
the property
property pages
pages of of Oracle
Oracle Workflow
Workflow
Builder
Builder and
and workflow
workflow notifications.
notifications.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Step 4 Setting the http_proxy Environment Variable

Step
Step 44
Setting
Setting the
the http_proxy
http_proxy Environment
Environment
Variable
Variable
•• IfIf you
you are
are planning
planning to to use
use the
the Notification
Notification Mailer,
Mailer,
set
set up up the
the http_proxy
http_proxy variable
variable to
to point
point to
to your
your
proxy
proxy server
server before
before starting
starting the
the Oracle
Oracle Workflow
Workflow
Database
Database or or the
the Notification
Notification Mailer.
Mailer. Only
Only required
required
ifif you
you plan
plan to
to attach
attach URL
URL content
content that
that exists
exists
outside
outside your your organization
organization firewall.
firewall.
•• For
For example, in UNIX, use the following
example, in UNIX, use the following command
command
to set the http_proxy variable:
to set the http_proxy variable:
setenv
setenv http_proxy
http_proxy “http://www-proxy.
“http://www-proxy.
yourcompany.com:80/”
yourcompany.com:80/”

Copyright  Oracle Corporation, 2000. All rights reserved.

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 organization’s firewall, the Notification Mailer must go through your organization’s
proxy server to fetch the URL content.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 8
Step 5 Setting the WF_RESOURCES Environment
Variable

Step
Step 55
Setting
Setting the
the WF_RESOURCES
WF_RESOURCES
Environment
Environment Variable
Variable
•• IfIf you
you are
are using
using the
the standalone
standalone version
version of of Oracle
Oracle
Workflow
Workflow and and the
the Workflow
Workflow server
server is
is installed
installed on
on aa
UNIX
UNIX platform,
platform, set
set the
the WF_RESOURCES
WF_RESOURCES
environment
environment variable.
variable.
•• This
This environment
environment variable
variable points
points to
to the
the language-
language-
dependent Oracle Workflow resource
dependent Oracle Workflow resource file file
wf<language>.res.
wf<language>.res.
•• The
The resource
resource file
file is
is generally
generally found
found inin the
the res
res
subdirectory
subdirectory of of the
the Oracle
Oracle Workflow
Workflow server
server
directory
directory structure.
structure.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 9
Step 6 Setting Up Background Workflow Engines

Step
Step 66
Setting
Setting Up
Up Background
Background Workflow
Workflow
Engines
Engines
•• Background
Background engines
engines areare set
set up
up to
to handle
handle costly
costly
‘deferred’
‘deferred’ activities
activities allowing
allowing the
the Workflow
Workflow Engine
Engine
to continue to the next available activity.
to continue to the next available activity.
•• Background
Background engines
engines areare also
also set
set up up to
to handle
handle
timed out notifications.
timed out notifications.
•• You
You can
can define
define and
and start
start up
up as
as many
many background
background
engines
engines asas you
you like.
like.
•• A
A background
background engine
engine runs
runs until
until itit completes
completes allall
eligible activities.
eligible activities.
•• You
You should
should set
set the
the background
background engine
engine up up to
to run
run
periodically.
periodically.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 10
Optional Setup Steps

Optional
Optional Setup
Setup Steps
Steps

Step 1 Step 2 Step 3


Document
Notification Message
Management
Mailer Templates
Repositories

Step 4 Step 5
Workflow Web Custom
Page Logo Icons

Copyright  Oracle Corporation, 2000. All rights reserved.

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 Workflow’s 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 11
Optional Step 1 Document Management Repositories

Optional
Optional Step
Step 11
Document
Document Management
Management Repositories
Repositories

•• Oracle
Oracle Workflow
Workflow communicates
communicates with with specific
specific DMDM
systems
systems through
through aa web
web server
server agent
agent interface.
interface. The
The
syntax
syntax for for identifying
identifying the
the DM
DM systems
systems webweb server
server
is
is <protocol>://<server:port>/.
<protocol>://<server:port>/.
•• IfIf you
you plan
plan toto use
use DM
DM system
system integration,
integration, you
you must
must
register
register the the DM
DM system
system withwith Oracle
Oracle Workflow
Workflow by by
using
using the the Document
Document NodesNodes web
web page
page to
to identify
identify
the
the DM DM system
system as as aa document
document node.
node.
•• Oracle
Oracle Workflow
Workflow usesuses the
the document
document node
node asas the
the
gateway to a specific DM system and
gateway to a specific DM system and uses the uses the
information
information defined
defined inin the
the node
node to
to construct
construct the
the
URLs that display the DM system
URLs that display the DM system documents. documents.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 12
Optional Step 2 Notification Mailer

Optional
Optional Step
Step 22
Notification
Notification Mailer
Mailer
•• Implement
Implement thethe Notification
Notification Mailer
Mailer ifif users
users are
are to
to
receive
receive notifications
notifications by
by e-mail
e-mail asas well
well as as from
from the
the
Notifications Worklist web
Notifications Worklist web page. page.
•• The
The Notification
Notification Mailer
Mailer isis aa program
program that that performs
performs
email
email send and response processing for
send and response processing for the
the
Oracle
Oracle Workflow
Workflow Notification
Notification System.
System.
•• The
The Notification
Notification Mailer
Mailer also
also processes
processes responses
responses
by
by interpreting
interpreting the
the text
text of
of messages
messages mailed mailed to
to its
its
response account and calling the appropriate
response account and calling the appropriate
Notification
Notification API
API to
to complete
complete the the notification.
notification.
•• Once
Once set up, the Notification Mailer continually
set up, the Notification Mailer continually
polls
polls for
for messages
messages to to send
send and and checks
checks for for
responses
responses to to process.
process.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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:
• MAILTEXTplain text mail: The notification message appears as plain text
with no attachments.
• MAILHTMLHTML 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.
• MAILATTHplain 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.
• SUMMARYplain text summary mail: The message is a plain text summary of
all open notifications.
• QUERYdo 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 13
Optional Step 2 Notification Mailer Overview

Optional
Optional Step
Step 22
Notification
Notification Mailer
Mailer Overview
Overview

Oracle
Internet
Various HTML Messaging Notifications
Mail Plain text

Applications
Advanced Queues
SMTP
Netscape
Lotus Notes MAPI
MS Exchange
Unix Sendmail
Others

Oracle Workflow
Notification Mailer Oracle server
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 14
Optional Step 2 continued Notification Mailer

Optional
Optional Step
Step 22 continued
continued
Notification
Notification Mailer
Mailer
•• You
You can
can set
set up
up the
the Notification
Notification Mailer
Mailer to
to run
run
against
against UNIX
UNIX SendMail,
SendMail, Oracle
Oracle Internet
Internet Messaging
Messaging
4.2,
4.2, or
or aa MAPI-compliant
MAPI-compliant mail mail application
application on on
Windows
Windows NT. NT.
•• Set
Set up
up at
at least
least one
one mail
mail account
account dedicated
dedicated toto the
the
Notification
Notification Mailer
Mailer processing
processing in in one
one of
of these
these mail
mail
applications.
applications.
•• Define
Define three
three folders/files
folders/files in
in the
the mail
mail account
account for
for
response processing.
response processing.
•• Use
Use the
the sample
sample configuration
configuration file,
file, wfmail.cfg,
wfmail.cfg, toto
create
create a configuration file of Notification Mailer
a configuration file of Notification Mailer
input
input arguments.
arguments.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 15
Optional Step 2 continued Running the Notification
Mailer

Optional
Optional Step
Step 22 continued
continued
Running
Running the
the Notification
Notification Mailer
Mailer
For
For the
the standalone
standalone version
version of
of Oracle
Oracle Workflow,
Workflow, run
run
the
the Notification
Notification Mailer
Mailer using
using one
one of
of the
the following
following
operating
operating system
system commands:
commands:
•• Integrating
Integrating with
with Oracle
Oracle Internet
Internet Messaging:
Messaging:
– wfmail.ofc -f <config_file>
– wfmail.ofc -f <config_file>
•• Integrating
Integrating with
with UNIX
UNIX Sendmail:
Sendmail:

– wfmail.snd
wfmail.snd -f -f <config_file>
<config_file>
•• Integrating
Integrating with
with MAPI-compliant
MAPI-compliant applications:
applications:
– wfmlr20.exe -f <config_file>
– wfmlr20.exe -f <config_file>
•• Replace <config_file> with
Replace <config_file> with the
the path
path and
and name
name
of
of the
the configuration
configuration file.
file.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 16
Optional Step 2 continued Running the Notification
Mailer

Optional
Optional Step
Step 22 continued
continued
Running
Running the
the Notification
Notification Mailer
Mailer
To
To run
run the
the Notification
Notification Mailer
Mailer for
for Oracle
Oracle Workflow
Workflow
embedded
embedded in in Oracle
Oracle Applications:
Applications:
•• Integrating
Integrating with
with UNIX
UNIX Sendmail
Sendmail or
or Oracle
Oracle Internet
Internet
Messaging,
Messaging, submit
submit the
the Notification
Notification Mailer
Mailer
concurrent
concurrent program
program from
from the
the Submit
Submit Request
Request
form.
form. You can also run the concurrent program
You can also run the concurrent program
from
from the
the command
command line:
line:
–– WFMAIL
WFMAIL apps/pwd
apps/pwd 00 YY FILE
FILE <config_file>
<config_file>
•• Integrating
Integrating with
with MAPI-compliant
MAPI-compliant mail
mail applications,
applications,
install
install the
the Notification
Notification Mailer
Mailer on
on Windows
Windows NTNT and
and
run:
run:
–– wfmlr20.exe
wfmlr20.exe -f
-f <config_file>
<config_file>
•• Replace
Replace <config_file>
<config_file> with
with the
the path
path and
and name
name of
of
the configuration file.
the configuration file. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 17
Optional Step 2 continued Notification Mailer
Arguments

Optional
Optional Step
Step 22 continued
continued
Notification
Notification Mailer
Mailer Arguments
Arguments
•• CONNECT
CONNECT (required)
(required)
•• ACCOUNT
ACCOUNT (required)
(required)
•• NODE
NODE (required)
(required)
•• FROM
FROM
•• SUMMARYONLY
SUMMARYONLY (required)
(required)
•• DIRECT_RESPONSE
DIRECT_RESPONSE
•• AUTOCLOSE_FYI
AUTOCLOSE_FYI
•• ALLOW_FORWARDED_RESPONSE
ALLOW_FORWARDED_RESPONSE
•• IDLE
IDLE
•• LOG
LOG
•• SHUTDOWN
SHUTDOWN
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 18
Optional Step 2 continued Notification Mailer
Arguments

Optional
Optional Step
Step 22 continued
continued
Notification
Notification Mailer
Mailer Arguments
Arguments
•• FAILCOMMAND
FAILCOMMAND
•• DEBUG
DEBUG
•• TEST_ADDRESS
TEST_ADDRESS
•• REPLYTO
REPLYTO
•• HTMLAGENT
HTMLAGENT
•• HTMLDESC
HTMLDESC
•• HTMLTYPE
HTMLTYPE
•• DISCARD
DISCARD
•• PROCESS
PROCESS
•• UNPROCESS
UNPROCESS
•• TAGFILE
TAGFILE
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 19
Optional Step 3 Message Templates

Optional
Optional Step
Step 33
Message
Message Templates
Templates

Messages
Messages sent
sent by
by the
the Notification
Notification Mailer
Mailer are
are
composed
composed using
using one
one of
of six
six templates
templates defined
defined in
in the
the
System:
System: Mailer item type. This item type is defined in
Mailer item type. This item type is defined in
the
the wfmail.wft
wfmail.wft workflow
workflow definition
definition file.
file.
•• Copy
Copy wfmail.wft
wfmail.wft and
and store
store in
in your
your source
source
controlled
controlled file
file system.
system.
•• Open
Open your
your file
file copy
copy ofof the
the System:
System: Mailer
Mailer item
item
type
type in
in your
your Workflow
Workflow Builder.
Builder.
•• Select
Select one
one of
of the
the message
message templates.
templates.
•• Display
Display the
the property
property sheet
sheet for
for the
the message.
message.
•• Edit
Edit the
the Subject
Subject or
or Body
Body of
of the
the message.
message.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 20
Optional Step 3 continued Message Templates

Optional
Optional Step
Step 33 continued
continued
Message
Message Templates
Templates
•• Do
Do not
not add,
add, delete,
delete, or
or modify
modify any
any attributes
attributes in
in the
the
System: Mailer item type.
System: Mailer item type.
•• Verify
Verify your
your edits
edits using
using File
File ->
-> Verify
Verify and
and Save.
Save.
•• Source
Source control
control your
your edited
edited version
version of
of the
the System:
System:
Mailer item type.
Mailer item type.
•• Load
Load your
your System:
System: Mailer
Mailer item
item type
type to
to your
your
database
database using
using the
the Workflow
Workflow Loader
Loader program
program or
or
the
the Workflow
Workflow Builder
Builder Save
Save As
As menu
menu option.
option.
•• Test
Test use
use of
of your
your modified
modified templates
templates using
using the
the test
test
account
account capability
capability of
of the
the Notification
Notification Mailer.
Mailer.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 21
Optional Step 4 Workflow Web Page Logo

Optional
Optional Step
Step 44
Workflow
Workflow Web
Web Page
Page Logo
Logo

•• Once
Once the
the web
web server
server is
is installed
installed and
and set
set up,
up, you
you
can
can customize
customize the
the company
company logo logo that
that appears
appears onon
Oracle
Oracle Workflow’s
Workflow’s web
web pages.
pages.
•• Create
Create your
your company
company logologo file
file in
in gif
gif format
format and
and
save as filename WFLOGO.gif.
save as filename WFLOGO.gif.
•• Move
Move WFLOGO.gif
WFLOGO.gif to to the
the physical
physical directory
directory
associated
associated with
with your
your web
web server’s
server’s /OA_MEDIA/
/OA_MEDIA/
virtual
virtual directory.
directory.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 22
Optional Step 5 Custom Icons

Optional
Optional Step
Step 55
Custom
Custom Icons
Icons
•• Oracle
Oracle Workflow
Workflow provides
provides aa variety
variety ofof icons
icons that
that
you
you can
can useuse with
with your
your activities
activities and
and processes.
processes.
You
You cancan add
add additional
additional icon
icon files
files as
as long
long asas they
they
are of the appropriate
are of the appropriate format. format.
•• Create
Create custom
custom iconicon files
files and
and convert
convert toto gif
gif files.
files.
•• Oracle
Oracle Workflow
Workflow Builder
Builder looks
looks for
for Windows
Windows icon icon
files
files (.ico)
(.ico) inin the
the Icon
Icon subdirectory
subdirectory of of the
the Oracle
Oracle
Workflow
Workflow area area onon your
your PC.
PC.
•• Oracle
Oracle Workflow Monitor and
Workflow Monitor and web
web pages
pages look
look for
for
gif files (.gif)
gif files (.gif) inin
/OA_MEDIA/oracle/apps/fnd/wf/icons
/OA_MEDIA/oracle/apps/fnd/wf/icons
where
where /OA_MEDIA/
/OA_MEDIA/ is is aa virtual
virtual directory
directory mapping
mapping
defined
defined in in your
your web
web server.
server.
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 23
Oracle Workflow Access Protection

Oracle
Oracle Workflow
Workflow Access
Access Protection
Protection

Oracle
Oracle Workflow
Workflow Access
Access Protection:
Protection:
•• Allows
Allows aa “customer”
“customer” of of aa workflow
workflow definition
definition to
to
modify
modify objects
objects toto meet
meet their
their needs.
needs.
•• Prevents
Prevents aa “customer”
“customer” ofof aa workflow
workflow definition
definition
from
from modifying “seed data” objects.
modifying “seed data” objects.
•• Preserves
Preserves legitimate
legitimate customizations
customizations of of workflow
workflow
objects
objects during
during aa workflow
workflow definition
definition upgrade.
upgrade.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 24
Access Levels

Access
Access Levels
Levels

•• Each
Each user
user of
of Oracle
Oracle Workflow
Workflow Builder
Builder operates
operates the
the
system
system at
at aa certain
certain access
access level.
level.
•• The
The access
access levels
levels are
are defined
defined as
as follows:
follows:
–– 0-9—reserved
0-9—reserved for
for Oracle
Oracle Workflow
Workflow
–– 10-19—reserved
10-19—reserved for
for Oracle
Oracle Application
Application Object
Object
Library
Library
–– 20-99—reserved
20-99—reserved for
for Oracle
Oracle Applications
Applications
–– 100-999—reserved
100-999—reserved for
for customer
customer organizations
organizations
–– 1000—Public
1000—Public

Copyright  Oracle Corporation, 2000. All rights reserved.

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 shouldn’t 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 25
Setting Access Level

Setting
Setting Access
Access Level
Level
Access
Access Level
Level defaults
defaults to
to 100
100 when
when Oracle
Oracle Workflow
Workflow
Builder
Builder is is installed.
installed.
Your
Your access
access level
level can
can be
be modified
modified from
from the
the Help
Help
menu
menu in the “About Oracle Workflow Builder” dialog
in the “About Oracle Workflow Builder” dialog
box.
box.
•• Enter
Enter anan integer
integer value
value in
in the
the Access
Access Level
Level field
field and
and
click
click OK.
OK.
•• Your
Your access
access level
level setting
setting will
will be
be maintained
maintained by
by the
the
Workflow Builder.
Workflow Builder.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 26
Setting Access, Protection, and Customization Levels

Setting
Setting Access,
Access, Protection,
Protection, and
and
Customization
Customization Levels
Levels

Copyright  Oracle Corporation, 2000. All rights reserved.

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 27
Example of Access Protection

Example
Example of
of Access
Access Protection
Protection

Assume you have an access level of 100.

Checkbox Resulting Level Edit Range


Customization = 0
None Access = 100 0-100
Protection = 1000

Customization = 100
Preserve 100-1000
Access = 100
Customizations Protection = 1000
Lock at this Customization = 0 0-100
Access Level Access = 100
Protection = 100

Customization = 100
Both Access = 100
100
Protection = 100
®

Copyright  Oracle Corporation, 2000. All rights reserved.

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 28
Workflow Definitions Loader

Workflow
Workflow Definitions
Definitions Loader
Loader

•• Use
Use the
the Workflow
Workflow Definitions
Definitions Loader
Loader to to transfer
transfer
workflow
workflow definitions
definitions between
between aa flat
flat file
file and
and aa
database.
database.
•• The
The loader
loader is is aa server-executable
server-executable program
program thatthat is
is
handy to use when definitions need
handy to use when definitions need to be backedto be backed
up
up to
to aa file
file prior
prior to
to aa database
database upgrade.
upgrade.
•• Workflow
Workflow definition
definition files
files are
are identified
identified by by the
the file
file
extension
extension .wft.
.wft.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 29
Transferring Workflow Definitions: Oracle Workflow
Standalone

Transferring
Transferring Workflow
Workflow Definitions:
Definitions:
Oracle
Oracle Workflow
Workflow Standalone
Standalone
•• To
To upgrade
upgrade aa definition
definition and
and preserve
preserve
customizations
customizations using the access
using the access level
level listed
listed in
in the
the
input file:
input file:
wfload
wfload -u
-u <username/password@database>
<username/password@database>
<input
<input file>
file>
•• To
To upload
upload aa new
new version
version of
of aa definition
definition using
using the
the
access level listed in the input file:
access level listed in the input file:
wfload
wfload -u
-u <username/password@database>
<username/password@database>
<input
<input file>
file>

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 30
Transferring Workflow Definitions: Oracle Workflow
Standalone

Transferring
Transferring Workflow
Workflow Definitions:
Definitions:
Oracle
Oracle Workflow
Workflow Standalone
Standalone
•• To
To force
force an
an upload
upload of
of aa definition
definition regardless
regardless of
of an
an
object’s protection level:
object’s protection level:
wfload
wfload -f
-f <username/password@database>
<username/password@database>
<input
<input file>
file>
•• To
To download
download aa definition:
definition:
wfload
wfload [-d
[-d <date>]
<date>]
<username/password@database>
<username/password@database> <output
<output file>
file>
<item_type1>
<item_type1> <item_type2>
<item_type2> …… <item_typeN>
<item_typeN>

Copyright  Oracle Corporation, 2000. All rights reserved.

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 31
Transferring Workflow Definitions: Oracle Workflow
embedded in Oracle Applications

Transferring
Transferring Workflow
Workflow Definitions:
Definitions:
Oracle
Oracle Workflow
Workflow embedded
embedded in in
Oracle
Oracle Applications
Applications
Run
Run the
the Workflow
Workflow Definitions
Definitions Loader
Loader concurrent
concurrent
program
program using one of the following modes:
using one of the following modes:
•• Upgrade:
Upgrade: Upgrade
Upgrade toto aa definition
definition in
in an
an input
input file,
file,
preserving
preserving customizations,
customizations, usingusing access
access level
level inin
input
input file.
file.
•• Upload:
Upload: Upload
Upload the
the definition
definition from
from anan input
input file,
file,
overwriting
overwriting accidental
accidental customizations,
customizations, using using thethe
default access level.
default access level.
•• Force:
Force: Upload
Upload aa definition
definition from
from an
an input
input file
file
regardless
regardless of of access
access level.
level.
•• Download:
Download: Download
Download specified
specified item
item type
type
definitions
definitions from
from the
the database
database to to an
an output
output file.
file. ®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle Workflow


Chapter 19 - Page 32
Master/Detail Coordination
Activities
Chapter 20

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination Activities


Chapter 20 - Page 1
Master/Detail Coordination Activities

Master/Detail
Master/Detail Coordination
Coordination Activities
Activities

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination Activities


Chapter 20 - Page 2
Objectives

Objectives
Objectives

After
After this
this lesson
lesson you
you should
should be
be able
able to:
to:
•• Describe
Describe thethe concept
concept of
of Master/Detail
Master/Detail coordination
coordination
activities.
activities.

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination Activities


Chapter 20 - Page 3
Master/Detail Coordination Activities

Master/Detail
Master/Detail Coordination
Coordination Activities
Activities

•• Master/Detail
Master/Detail coordination
coordination activities
activities allow
allow you
you to
to
coordinate
coordinate the
the flow
flow of
of master
master and
and detail
detail
processes.
processes.
•• Spawning
Spawning aa detail
detail process
process from
from aa master
master process,
process,
in
in effect, creates a separate detail process with
effect, creates a separate detail process with its
its
own
own unique
unique item
item type
type and
and item
item key.
key.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 4
Master/Detail Coordination Activities (continued)

Master/Detail
Master/Detail Coordination
Coordination Activities
Activities
(continued)
(continued)

•• Master/Detail
Master/Detail coordination
coordination activities
activities allow
allow you
you to
to
coordinate
coordinate the
the flow
flow of
of master
master and
and detail
detail
processes.
processes.
•• Spawning
Spawning aa detail
detail process
process from
from aa master
master process,
process,
in
in effect, creates a separate detail process with
effect, creates a separate detail process with its
its
own
own unique
unique item
item type
type and
and item
item key.
key.

Copyright  Oracle Corporation, 2000. All rights reserved.

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 5
Example of Master Process

Example
Example of
of Master
Master Process
Process

Copyright  Oracle Corporation, 2000. All rights reserved.

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 6
Example of Detail Process

Example
Example of
of Detail
Detail Process
Process

Copyright  Oracle Corporation, 2000. All rights reserved.

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 7
Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination Activities


Chapter 20 - Page 8
Extra Practices
Chapter 21

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra Practices
Chapter 21 - Page 1
Extra Practices

Extra
Extra Practices
Practices

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra Practices
Chapter 21 - Page 2
Extra Practice 1 Overview

Extra
Extra Practice
Practice 11 Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Creating
Creating aa function
function or
or process
process activity
activity that
that uses
uses
an activity attribute to control processing
an activity attribute to control processing

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra Practices
Chapter 21 - Page 3
Extra Practice 2 Overview

Extra
Extra Practice
Practice 22 Overview
Overview

This
This practice
practice covers
covers thethe following
following topics:
topics:
•• Changing
Changing thethe Vacation
Vacation Proposal
Proposal notification
notification into
into aa
“vote” and implementing RUN and
“vote” and implementing RUN and TIMEOUT TIMEOUT
function
function mode
mode logic
logic in
in the
the post-notification
post-notification
function
function
–– check
check the
the Expand
Expand Roles
Roles checkbox
checkbox on on the
the
notification
notification activity
activity
–– with
with the
the potential
potential for
for multiple
multiple responses
responses to to the
the
Vacation Proposal, how should the result
Vacation Proposal, how should the result be be
determined?
determined?
–– should
should the
the SCHEDULE_UPDATE
SCHEDULE_UPDATE logic logic be
be
moved
moved toto the
the post-notification
post-notification procedure?
procedure?
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra Practices
Chapter 21 - Page 4
Extra Practice 3 Overview

Extra
Extra Practice
Practice 33 Overview
Overview

This
This practice
practice covers
covers the
the following
following topics:
topics:
•• Anticipating
Anticipating customization
customization ofof aa process
process byby end
end
users
users
–– build
build in
in customization
customization points
points for
for
enhancements
enhancements suchsuch as:
as:
–– allowing
allowing users
users to
to self-approve
self-approve vacation
vacation
under
under certain
certain circumstances
circumstances
–– hooking
hooking the
the Vacation
Vacation Proposal
Proposal process
process into
into
communicating with a time reporting
communicating with a time reporting
application
application
–– featuring
featuring Block/Complete
Block/Complete Activity
Activity or
or
Advanced
Advanced Queue
Queue integration
integration
®

Copyright  Oracle Corporation, 2000. All rights reserved.

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra Practices
Chapter 21 - Page 5
Copyright © Oracle Corporation, 2000. All rights reserved.

Extra Practices
Chapter 21 - Page 6

You might also like