Professional Documents
Culture Documents
Oracle Workflow Student Guide PDF
Oracle Workflow Student Guide PDF
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:
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
Siu Chang
Kevin Hudson
Clara Jaeckel
Table of Contents
Profile
Before you begin this course, you should have the following qualifications:
Prerequisites
Oracle Publications
Additional Publications
• read.me files
• Oracle Magazine
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
1. (N) From the Navigator window, select Invoice > Entry > Invoice Batches
Summary.
(N) = Navigator
(M) = Menu
(T) = Tab
(I) = Icon
(H) = Hyperlink
(B) = Button
This course uses a “navigation path” convention to represent actions you perform
to find pertinent information in the Oracle Applications Help System.
1. In the navigation frame of the help system window, expand the General
Ledger entry.
4. Review the Enter Journals topic that appears in the document frame of the
help system window.
Oracle
Oracle Workflow
Workflow Release
Release 2.5
2.5
Introduction
Introduction
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
®
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
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
Why Workflow?
Chapter 2 - Page 1
Why Workflow?
Why
Why Workflow?
Workflow?
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
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
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
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
Why Workflow?
Chapter 2 - Page 6
Example Workflow Processes
Example
Example Workflow
Workflow Processes
Processes
Order Flow - Generic with Header Level Invoicing
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
Why Workflow?
Chapter 2 - Page 7
Designing Business Processes for Change
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
®
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
®
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?
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?
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
Re je ct
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)
Why Workflow?
Chapter 2 - Page 14
New Hire Processing
New
New Hire
Hire Processing
Processing
•• 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
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>
Why Workflow?
Chapter 2 - Page 16
New Hire Process @ Oracle
New
New Hire
Hire Process
Process @
@ Oracle
Oracle
Enabling e-business at Oracle
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>
Why Workflow?
Chapter 2 - Page 17
New Hire Process @ Oracle
New
New Hire
Hire Process
Process @
@ Oracle
Oracle
Enabling e-business at Oracle
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>
Why Workflow?
Chapter 2 - Page 18
New Hire Process @ Oracle
New
New Hire
Hire Process
Process @
@ Oracle
Oracle
Enabling e-business at Oracle
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>
Why Workflow?
Chapter 2 - Page 19
Workflow Enabled e-business Suite
Workflow
Workflow Enabled
Enabled e-business
e-business Suite
Suite
Workflow enabled
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 .
Why Workflow?
Chapter 2 - Page 21
Workflow
Workflow
Workflow
Workflow
is much more
than approvals
Why Workflow?
Chapter 2 - Page 22
Overview of Oracle Workflow
Chapter 3
Overview
Overview of
of Oracle
Oracle Workflow
Workflow
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
Overview
Overview
•• Routes
Routes Information
Information
•• Defines
Defines any
any rule
rule
•• Delivers
Delivers electronic
electronic notifications
notifications
Workflow
Workflow Architecture
Architecture
Directory Services
Users Roles
Web
Notification
Worklist
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
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
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.
Workflow
Workflow Process
Process Definition
Definition
Supported
Supported Process
Process Constructs
Constructs
• Looping
• Results-based
branching
• Parallel flows
• Rendezvous
Workflow Engine
The Workflow Engine supports sophisticated workflow rules including looping,
branching, parallel flows and subflows.
Supported
Supported Process
Process Constructs
Constructs
• Voting
• Timeouts
– Escalation
– Automatic
forwarding
• Subprocesses
(unlimited
hierarchy)
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
Workflow
Workflow Definitions
Definitions Loader
Loader
Workflow
Builder
Workflow Workflow
Loader Engine
Workflow
Loader
Proc
ess Oracle 8 or higher
Process
Defin
Definition
itions
Notification
Notification System
System
Workflow
Worklist
Directory Notification
Services System
Application Oracle
Applications
Screens
Oracle 8 or higher
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.
Notification
Notification Details
Details Web
Web Page
Page
Extended HTML
message formats
Email
Email Notifications
Notifications
Automatic generation of
response template
Email
Email Notifications
Notifications -- Response
Response Template
Template
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
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.
Oracle
Oracle Workflow
Workflow Monitor
Monitor
Demonstration
Demonstration
•• 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
Planning
Planning aa Workflow
Workflow Process
Process
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
Process
Process Components
Components
Item Type
Process
... ...
Oracle
Oracle Workflow
Workflow Builder
Builder
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
®
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
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
Activities
Activities and
and Lookup
Lookup Types
Types
}
T
E Result A
Process: F
N
Y
S E Result B
}
Notification: Message Result Y
Response ‘Send’ and RESULT
Required ‘Respond’ Attributes Result N
Resp 1
Resp 2
...
Process Activities
A process activity can be completed with a specific result that is defined in
a lookup type. For example, the New Hire Process can be completed with
a final result of Accepted or Declined, both of which are codes defined in
the Applicant Response lookup type.
Function Activities
The PL/SQL procedure for a function activity can return some result that
determines the next transition the Workflow Engine takes. That result
should be defined as a code in a lookup type.
Notification Activities
The message sent by a notification activity can simply convey information
or it can require a response:
If the message only provides information (such as an “FYI”), then
create and include “Send” message attributes in the message as
necessary.
If the message requires a response, then create “Send” message
attributes that provide enough information for the recipient to
respond and also create “Respond” message attributes that prompt
a response.
If a particular response defines the actual result of the notification
activity, then complete the Result tab for the message. The
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.
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.
®
Demonstration
Demonstration
•• Samples
Samples of
of Oracle
Oracle Applications
Applications R11i
R11i workflow
workflow
processes
processes
Defining
Defining Item
Item Types,
Types, Item
Item Attributes,
Attributes, and
and
Lookup Types
Lookup Types
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
Create
Create aa New
New Workflow
Workflow Process
Process
Definition
Definition
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.
Quick
Quick Start
Start Wizard
Wizard
Quick
Quick Start
Start Wizard
Wizard (Continued)
(Continued)
Quick
Quick Start
Start Wizard
Wizard (Continued)
(Continued)
Define
Define an
an Item
Item Type
Type
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
Note: Launching a form from the Notification Detail Web page is only
available when Workflow is embedded in Oracle Applications.
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
Define
Define Item
Item Type
Type Attributes
Attributes (continued)
(continued)
Form
Form Attributes
Attributes
Note: This attribute type is not relevant for the standalone version of
Oracle Workflow.
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
URL
URL Attributes
Attributes
Activities
Activities and
and Lookup
Lookup Types
Types
}
T
E Result A
Process: F
N
Y
S E Result B
}
Notification: Message Result Y
Response ‘Send’ and RESULT
Required ‘Respond’ Attributes Result N
Resp 1
Resp 2
...
Lookup Types
Lookup types can be referenced by activities, attributes, and messages in a
process to provide a predefined list of values.
Define
Define Lookup
Lookup Types
Types
Define
Define Lookup
Lookup Codes
Codes
Defining
Defining aa Notification
Notification Activity
Activity
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
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.
Create
Create aa New
New Workflow
Workflow Process
Process
Definition
Definition
Define
Define aa Message
Message
Define
Define aa Message
Message (Continued)
(Continued)
Message Result
Create a “result” for a message when you wish to send a message that
prompts for a response and then uses that response as the result of its
notification activity.
Select the Result tab of the Message Property page.
Enter a Display Name. This will be the response prompt.
Select a Lookup Type. This will provide the possible result values.
The lookup type associated with the message result should be the
same as the result type of the notification activity that sends the
notification message.
The icon for messages in the navigator tree includes a red question
mark in its bottom left corner when a message has a Result
defined.
Note: In version 2.0.3 of Oracle Workflow it was necessary to define a
message attribute which had an internal name of RESULT. This is
implemented through the message Result property tab in version 2.5.
Define
Define aa Message
Message Attribute
Attribute
Define
Define aa Respond
Respond Attribute
Attribute
Respond Attributes
If you wish to create a message that prompts a response from the recipient, then
define a message attribute that has Source set to “Respond.”
The Notification System uses a message's Respond attributes to
generate the response section of the notification.
A message can have multiple Respond attributes.
The icon for Respond attributes in the navigator tree includes a red
question mark in its bottom left corner to distinguish it from Send
attributes.
Respond
Respond Attributes
Attributes in
in an
an E-mail
E-mail
Notification
Notification
Respond
Respond Attributes
Attributes in
in the
the Notifications
Notifications
Web
Web Page
Page
Define
Define aa Notification
Notification Activity
Activity
Notification Activities
Notification activities must be associated with an item type and are created in
the navigator tree beneath the Notifications branch of the item type. Select the
item type, then select New Notification... from the Edit menu.
Activity Property Page
The procedure for defining a notification activity is as follows:
1. Specify an internal name, display name, and description for the
notification activity.
2. Specify the lookup type that contains the possible results that the activity
can return.
3. Choose a descriptive icon for the notification activity.
4. Choose a message to send from the list of predefined messages.
5. If a message includes a Result, then the result type of the notification
activity must be the same as the lookup type that the message Result references.
6. If you want to send this notification to a multi-user role, ensuring each
user receives an individual copy of the notification, select the Expand Roles
check box.
7. You can optionally specify a PL/SQL stored procedure in the Function
field. The procedure is known as a post-notification function and can be used to
couple processing logic to the notification activity.
8. Always select the Expand Roles check box for FYI-type notifications.
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.
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.
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
Standard
Standard Voting
Voting Activity
Activity
Vote Yes/No
Vote Yes/No is a notification activity associated with the Standard item type. This
activity can be customized. Use this activity to send a notification to all users in a
role and tally the Yes/No responses of the users. The tallied responses determine
the final result of the notification activity.
The activity sends a message called “Default Voting Message
Yes/No” that includes message Result. The message prompts the
recipient to reply with “Yes” or “No.”
The possible results of this notification activity are stored in the
lookup type called Yes/No.
Choose the “Expand Roles” to ensure that all users in the role
receive a copy of the notification.
When the activity receives responses, it executes a PL/SQL
procedure called WF_STANDARD.VOTEFORRESULTTYPE to
tally the Yes/No responses.
Vote Yes/No has three activity attributes associated with it:
Voting Option: Specifies when and how to tally the votes
Percent Yes: Specifies what percentage of Yes responses
are required for a Yes result
Percent No: Specifies what percentage of No responses are
required for a No result
Define
Define Notification
Notification Activity
Activity Details
Details
Define
Define aa Dynamic
Dynamic Priority
Priority for
for aa
Notification
Notification
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
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.
®
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
®
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
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.
®
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.
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.
®
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.
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.
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.
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
®
Sample Solutions
Refer to workflow definition file wfvacxx_61.wft for a sample solution.
Overview
Overview of
of the
the
Workflow
Workflow Directory Service
Directory Service
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
Terms
Terms
•• Role
Role
•• Directory
Directory Repository
Repository
Workflow Definitions
Role: A grouping of one or more users who share a common responsibility
Directory Repository: A set of database tables that contain user information
Directory
Directory Service
Service Views
Views
•• WF_USERS
WF_USERS
•• WF_ROLES
WF_ROLES
•• WF_USER_ROLES
WF_USER_ROLES
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
®
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
®
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
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
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.
WF_USER_ROLES
WF_USER_ROLES View
View
•• 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
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
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
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
User
User Preference
Preference Information
Information
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.
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.
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.
®
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.
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.
Defining
Defining Function
Function and
and Process
Process Activities
Activities
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
Create
Create aa New
New Workflow
Workflow Process
Process
Definition
Definition
Define
Define aa Function
Function Activity
Activity
Function Activities
Function activities must be associated with an item type and are created in
the navigator tree beneath the Functions branch of the item type. Select the
item type, then select New Function… from the Edit menu.
Activity Property Page
Specify an internal name, display name, and description for the
function activity.
Choose a descriptive icon for the activity.
Specify a function type and function for the activity.
PL/SQL: Enter the name of the PL/SQL stored procedure
that you want the Workflow Engine to execute for this
function activity.
External: Enter the name of the external program you want
the Workflow Engine to enqueue in the Outbound queue.
The correlation value of that entry is set to the value you
specify in the Function field.
Specify the result type that contains the possible results that the
activity can return.
Specify a relative cost, in seconds, that represents how long the
procedure takes to run. If the cost exceeds the Workflow Engine
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.
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)
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;
...
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
®
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)
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)
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
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
Exception
Exception Handling
Handling
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>
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.
Defining
Defining aa Function
Function Activity
Activity Attribute
Attribute
Defining
Defining aa Process
Process Activity
Activity
Process Activities
A process activity must be defined before a business process can be
diagrammed.
Process activities must be associated with an item type and are created in the
navigator tree beneath the Processes branch of the item type. Select the
item type, then select New Process... from the Edit menu.
Activity Property Page
1. Specify an internal name, display name, and description for the process
activity.
2. Choose a descriptive icon for your process.
3. Specify the result type that contains the possible results that the process
can return.
4. Select the Runnable check box if this is a top level workflow process that
can be initiated.
Clear the Runnable check box if this process activity can only be executed
as a subprocess called by another higher-level process.
Defining
Defining Activity
Activity Details
Details
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.
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
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.
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.
Self-Looping
Self-Looping Transitions
Transitions
<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
Self-Looping Transitions
You can draw a transition that loops back to its source activity without
creating additional activity nodes.
Default
Default Error
Error Process
Process
•• 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
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
Error
Error Handling
Handling (Continued)
(Continued)
Fa ls e
Error S till Active End
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
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.
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 ®
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
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.
®
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
®
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 ®
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
®
Function Value
<package.procedure> value should look something like
WFVACXX.SCHEDULE_UPDATE, where ‘XX’ is the unique number assigned
to your work station.
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
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
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.
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.
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
®
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
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. ®
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’)
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
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
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
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
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.
Function Value
<package.procedure> value should look like
WFVACXX.NTF_VACATION_PROPOSAL where ‘XX’ is the unique number
assigned to your work station.
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
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.
Diagramming
Diagramming aa Workflow
Workflow Process
Process
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
Create
Create aa New
New Workflow
Workflow Process
Process
Definition
Definition
Loading
Loading Roles
Roles
Loading Roles
If you wish to set the recipient of a notification to a constant value, you must
first load the roles stored in your Oracle Workflow directory service into Oracle
Workflow Builder. To load roles, use the following procedure:
1. Choose File—>Open to connect to your database and open the item type
for which you are creating a process diagram.
2. Choose File—>Load Roles from Database.
3. Specify search criteria in the Find Roles field of the Role selection
window and then choose Find.
4. Select the roles you want to load in the Query Results list, then choose
Add to add them to the Loaded Roles list.
5. Choose OK to load the roles and make them available to the objects in
your open item type.
Directory Service Display
Use the Directory Service branch in the navigator tree to see information about
the roles you load from the database.
List-of-Values for Role Attributes
You can select roles from the list of values which the directory service
populates. List-of-values is available wherever large lists are used.
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.
®
Quick
Quick Start
Start Wizard
Wizard
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
Show
Show Label
Label in
in Designer
Designer Menu
Menu Option
Option
Display
Display Modes
Modes
Standard icons
used for display
Display Modes
You can toggle between the following two display modes of the workflow
builder:
Presentation mode
Developer mode
In presentation mode, workflow builder shows the names for the activity
icons that you specify in their property page.
The developer mode assists you in developing large complex processes as
follows:
Providing visual distinctions between top-level processes and
subprocesses in the navigator tree
Setting the icons for each activity and object to the default icon of
its object type or subtype in both the navigator tree and the process
diagram window
Identifying each object in the navigator tree by its internal, or
developer, name
Identifying each activity in the process diagram window by its
activity label
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.
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 :
Self-Looping
Self-Looping Transitions
Transitions
Activity loops
back to itself
on Timeout
Self-Looping Transitions
How to draw a self-loop transition
1. Select the activity node.
2. Hold down the right mouse button.
3. Drag the cursor away and back to the same activity node.
4. Release the right mouse button and select the transition label from the list
of results.
Note: The node Timeout property must be set to enable the <Timeout> option
in the transition list of results.
<Any>
<Any> Transitions
Transitions
Approve
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
®
<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.
Top
Top Down
Down Design
Design
Palette permits
creating processes,
notifications or
functions without
underlying
dependencies
No need to
specify function
at this point
No need to
specify function
at this point
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.
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.
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.
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
®
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
®
Customizing
Customizing aa Process
Process Node
Node
Customize a Node
Since an activity can be reused throughout a process, a node represents an
instance of that activity and its properties are unique to that instance. To
customize a node, in the Process Activity property page:
1. Specify whether the activity is a Start, End, or Normal activity in the
process.
For an End activity, if the process itself has a result type associated with it,
you should specify what the result of the process is when this End activity
completes. Choose from the possible results listed in the result type of the
process activity.
2. If you use an activity more than once in a process, subsequent nodes of
that activity will have an “-N” appended to its label name to identify it as a
unique instance.
3. If the activity is a notification, specify a performer.
A performer is a role that can consist of one or more users.
You can specify a static role. Specify Constant for the Performer Type, then
select a role name. Note that you must first load roles from your database
first.
You can alternatively specify a dynamic role. Select item attribute for the
Performer type, then select an Item Type attribute that returns a role name
during runtime.
Setting
Setting Activity
Activity Attribute
Attribute Values
Values
Activity Attributes
Because an activity can be reused throughout a process, the value of an activity
attribute can vary from node to node. Specify the values for the attributes in the
Attribute Values property page.
1. Select the attribute.
2. The value can be constant or dynamic:
For a constant value, select Constant, then enter a value.
For a dynamic value, select Item Attribute, then select the name of an item
type attribute that returns a value of the same type during runtime.
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
Standard
Standard Activities
Activities
Standard Activities
The standard item type includes function and notification activities that
can be included in process diagrams associated with the other item types.
For a full explanation of the above standard activities please see the
Oracle Workflow Guide (Release 2.5), chapter 6, Predefined Workflow
Activities.
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.
Reviewing
Reviewing the
the Process
Process Definition
Definition
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
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.
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.
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
®
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.
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
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
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.
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
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
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
®
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
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
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
Note:
The Start/End property must be set to End to enable the Result property on the
node.
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
Sample Solutions
Refer to workflow definition file wfvacxx_91.wft for Timeout using a Loop
Counter sample solution.
Overview
Overview of
of the
the Workflow
Workflow Engine
Engine
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
Overview
Overview of
of the
the Workflow
Workflow Engine
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.
®
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.
Workflow
Workflow Engine
Engine Features
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
Initiating
Initiating aa Workflow
Workflow Process
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
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.
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)
®
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
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
®
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. ®
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.
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
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
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.
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
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
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
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
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
For more information, see the Oracle Workflow Guide (Release 2.5),
chapter 8 for a complete description of all Oracle Workflow APIs.
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.
Background
Background Engine
Engine
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);
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;
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 ®
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.
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.
Completing
Completing Workflow
Workflow Notification
Notification
Activities
Activities
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
Oracle
Oracle Workflow
Workflow Home
Home Page
Page
Find
Find Notifications
Notifications Web
Web Page
Page
Finding Notifications
Enter criteria to search for a specific set of notifications.
Users who have workflow administrator privileges can search for
notifications that belong to any other user/role by specifying an
internal role name in the User ID field.
Users who do not have workflow administrator privileges can only
search for their own notifications.
Choose Find to display matching notifications in the Notifications
Web page.
Notifications
Notifications Worklist
Worklist
Notification
Notification Details
Details
Reassigning
Reassigning Notifications
Notifications
User
List-of-values
Delegate or
Transfer
reassign options
Launching
Launching Oracle
Oracle Application
Application Forms
Forms
E-Mail
E-Mail Notification
Notification
<Place
<Place screenshot
screenshot here>
here>
Automatic
generation
of
response
template
E-Mail
E-Mail Notification
Notification (continued)
(continued)
Automatic
generation
of
response
template
E-Mail
E-Mail Summary
Summary of
of Notifications
Notifications
<Place
<Place screenshot
screenshot here>
here>
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
®
Listing
Listing Notification
Notification Processing
Processing Rules
Rules
Creating
Creating aa New
New Notification
Notification Processing
Processing
Rule
Rule
Creating
Creating aa New
New Notification
Notification Processing
Processing
Rule
Rule (continued)
(continued)
Monitoring
Monitoring Workflow
Workflow Processes
Processes
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
Workflow
Workflow Monitor
Monitor
Process
Process Title
Title
Process
Process Diagram
Diagram Window
Window
Detail
Detail Tab
Tab Window
Window
Administration
Administration Buttons
Buttons
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
Web Browser
The Workflow Monitor requires a Web browser that supports Java 1.1.4
and AWT.
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.
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.
Direct
Direct Access
Access to
to the
the Workflow
Workflow Monitor
Monitor
•• 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.
Find
Find Processes
Processes Web
Web Page
Page
Reviewing
Reviewing the
the Process
Process List
List
Reviewing
Reviewing the
the Notifications
Notifications List
List
Notifications List
Displays all the current notifications that have been sent that
require a Result response.
Summarizes what each notification activity is, who it is assigned
to, when it was sent, whether it has been completed, how many
days have passed before completion and what the result is.
Note: If the process instance is in an error state and the cause of the error
was from a notification, you can click on the link in the Result column, if
any, to display the cause of the error.
Choose a user link in the Who column to send an email to the user
that a notification has been assigned to.
Choose a notification activity link in the Activity column if you
want to view the full definition of a notification activity.
If a notification is still open and requires a response, an icon will
appear after the notification activity name. You can click on this
icon and you will go to the Notification Details page where you
can respond to the notification if you are logged in as the
notification recipient, or if you are logged in with administrator
privileges.
Choose Advanced Options to go to the Activities List Web page
where you can specify advanced criteria to search and display
specific activities of interest for the process.
Filtering
Filtering Activities
Activities in
in the
the Activities
Activities List
List
Activities List
The Activities List lets you use different criteria to filter for
specific activities of interest in the current process instance.
Activity Status Options:
Active (includes Notified, Deferred, and Waiting states)
Complete
Error
Suspended
Activity Types:
Response Notifications
FYI Notifications
Functions
Standard Workflow Items
Choose Filter Activities to display the activities that match your
criteria.
Filtering
Filtering Activities
Activities in
in the
the Activities
Activities List
List
(continued)
(continued)
Child/Parent
Child/Parent Instances
Instances
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
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
®
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
®
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.
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.
Note:
After starting a process from the Initiate Workflow web page, control is passed to
the Monitor Activities List web page.
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
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.
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;
®
Note:
Your Vacation Schedule table and WFVACXX package must be successfully
loaded into the workflow account of your test database.
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. ®
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 ®
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
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
PL/SQL Documents
Chapter 13 - Page 1
PL/SQL Documents
PL/SQL
PL/SQL Documents
Documents
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
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.
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)
PL/SQL Documents
Chapter 13 - Page 5
‘ ‘: The document is presented as a separate attachment to the notification.
Any content type may be returned.
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)
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
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.
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 ®
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”.
®
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;
®
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.
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.
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>.
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.
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. ®
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).
®
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.
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.
®
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.
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.
®
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
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.
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
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.
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.
®
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’
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
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. ®
Function Value
<package.procedure> value should look like WFVACXX.CHECK_APPROVER,
where ‘XX’ is the unique number assigned to your work station.
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.
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
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.
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
Selector Functions
Chapter 14 - Page 1
Selector Functions
Selector
Selector Functions
Functions
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
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.
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)
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)
Selector Functions
Chapter 14 - Page 6
Defining a Selector/Callback Function
Defining
Defining aa Selector/Callback
Selector/Callback Function
Function
•• itemtypethe
itemtypethe internal
internal name
name for
for the
the item
item type.
type.
Defined
Defined inin the
the Oracle
Oracle Workflow
Workflow Builder.
Builder.
•• itemkeya
itemkeya 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.
•• actidthe
actidthe 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.
Selector Functions
Chapter 14 - Page 7
Defining a Selector/Callback Function (continued)
Defining
Defining aa Selector/Callback
Selector/Callback Function
Function
(continued)
(continued)
•• commanddetermines
commanddetermines how how to to execute
execute the
the
selector/callback
selector/callback function.
function.
•• resultouta
resultouta 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
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:
•• RUNto
RUNto 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_CTXto
SET_CTXto 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_CTXto
TEST_CTXto 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. ®
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
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. ®
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.
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. ®
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 ®
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) ®
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.
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.
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
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.
Selector Functions
Chapter 14 - Page 17
Copyright © Oracle Corporation, 2000. All rights reserved.
Selector Functions
Chapter 14 - Page 18
External System Integration
Chapter 15
External
External System
System Integration
Integration
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.
Oracle
Oracle Workflow
Workflow Terms
Terms
•• BlockActivity
BlockActivity
•• CompleteActivity
CompleteActivity
External
External Function
Function Activity
Activity Support
Support
Oracle8
Advanced
Queues
Function
Activity External Execution
Agent
• Java
• CORBA
• OS command
®
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.
®
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.
Advanced
Advanced Queue
Queue Integration
Integration
External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine
Background
Engine
WF Inbound
External Outbound
Advanced
Advanced Queue
Queue Integration
Integration
External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine
Background
Engine
WF Inbound
External Outbound
Advanced
Advanced Queue
Queue Integration
Integration
External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine
Background
Engine
WF Inbound
External Outbound
Advanced
Advanced Queue
Queue Integration
Integration
External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine
Background
Engine
WF Inbound
External Outbound
The external system consumes and processes the message and may write it to an
external outbound queue.
Advanced
Advanced Queue
Queue Integration
Integration
External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine
Background
Engine
WF Inbound
External Outbound
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.
Advanced
Advanced Queue
Queue Integration
Integration
External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine
Background
Engine
WF Inbound
External Outbound
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()
Advanced
Advanced Queue
Queue Integration
Integration
External Inbound
Workflow Advanced Queue
WF Outbound
Workflow
Engine
Background
Engine
WF Inbound
External Outbound
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.
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.
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);
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>.
Forced
Forced Synchronous
Synchronous Processing
Processing
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.
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.
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
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
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
Purge
Chapter 17 - Page 1
Purge
Purge
Purge
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
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
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.
®
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.
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
®
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)
Purge
Chapter 17 - Page 6
Demonstration
Demonstration
Demonstration
Purge
Chapter 17 - Page 7
Copyright © Oracle Corporation, 2000. All rights reserved.
Purge
Chapter 17 - Page 8
Document Management
Integration
Chapter 18
Document
Document Management
Management Integration
Integration
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.
Document
Document Management
Management Integration
Integration
Notification
Activities
Document
Management
System
®
Document
Document Management
Management
Document can be
viewed online
Attached Document
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
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.
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.
®
Note: For further information on the above functions please see the Oracle
Workflow Guide (Release 2.5), chapter 10 Viewing Notifications and
Processing Responses.
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. ®
Note: For further information on the above functions please see the Oracle
Workflow Guide (Release 2.5), chapter 10 Viewing Notifications and
Processing Responses.
Setting
Setting Up
Up Oracle
Oracle Workflow
Workflow
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.
Required
Required Set
Set Up
Up Steps
Steps
Background
Engines
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.
®
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.
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
®
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.
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.
Note:
A sample WF_LANGUAGES view is included in the script of each of the predefined
directory services that Oracle Workflow provides.
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/”
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.
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.
Optional
Optional Setup
Setup Steps
Steps
Step 4 Step 5
Workflow Web Custom
Page Logo Icons
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.
®
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.
®
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
®
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.
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.
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.
®
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. ®
#Description
PARAMETER1=value1
#Description
PARAMETER2=value2
. . .
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
®
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
®
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.
®
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
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.
Note:
Always use flat file data stores (.wft files) for edits rather than editing directly against a
database datastore. Source control your workflow definitions.
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.
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.
®
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.
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.
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
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.
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.
Setting
Setting Access,
Access, Protection,
Protection, and
and
Customization
Customization Levels
Levels
Example
Example of
of Access
Access Protection
Protection
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
®
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.
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>
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>
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.
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. ®
Master/Detail
Master/Detail Coordination
Coordination Activities
Activities
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.
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.
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.
Example
Example of
of Master
Master Process
Process
Master Process
In the master process above, the Start Detail Flows activity initiates
several detail processes. The master process then completes Activity 1
before it pauses at the Wait for Flow activity. Wait for Flow is defined to
wait for all its detail processes to complete a Continue Flow activity
before allowing the master process to transition to Activity 2.
Example
Example of
of Detail
Detail Process
Process
Detail Process
When a detail process begins it completes Activity A, when it reaches the
Continue Flow activity it signals to the Workflow Engine that the master
process can now continue from the Wait for Flow activity. The detail
process itself then transitions to Activity B.
Extra Practices
Chapter 21 - Page 1
Extra Practices
Extra
Extra Practices
Practices
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
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?
®
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
®
Extra Practices
Chapter 21 - Page 5
Copyright © Oracle Corporation, 2000. All rights reserved.
Extra Practices
Chapter 21 - Page 6