Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

D50948 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 286

R12 Implement Oracle

Workflow
Volume 3 - Student Guide

m y
d e
c a
e A
c l
r a
O ly
l & On
D49191GC10
Edition 1.0
n a e
June 2007

t e r U s
D50948

I n
c l e
r a
O
Copyright © 2007, Oracle. All rights reserved.

This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and
print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way.
Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.

The information contained in this document is subject to change without notice. If you find any problems in the document, please
report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.

If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United
States Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTS


The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted
by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.

Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may
be trademarks of their respective owners.

Authors

Clara Jaeckel, Melody Yang

Technical Contributors and Reviewers

Leta Davis, Donna Johnson, Gary Lemmons, Michael Morrison, Georgia Price, Robert
Wunderlich

oracletutor m y
This book was published using:

d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Table of Contents

Introduction to Oracle Workflow ..................................................................................................................1-1


Introduction to Oracle Workflow ..................................................................................................................1-3
Objectives ......................................................................................................................................................1-4
Enabling E-Business......................................................................................................................................1-5
Inter-Enterprise Business Processes ..............................................................................................................1-6
Traditional Workflow ....................................................................................................................................1-7
Workflow-Driven Business Processes...........................................................................................................1-8
Sample Workflow Process.............................................................................................................................1-10
Event-Based Workflow .................................................................................................................................1-11
Subscription-Based Processing......................................................................................................................1-12
System Integration with Oracle Workflow ....................................................................................................1-13
Business Process-Based Integration ..............................................................................................................1-14
Supported System Integration Types.............................................................................................................1-15
Designing Applications for Change...............................................................................................................1-16
Designing Applications for Integration .........................................................................................................1-19
Oracle Workflow in Oracle E-Business Suite ...............................................................................................1-21
Guided Demonstration - Loading and Running a Workflow Process........................................................1-22
Summary........................................................................................................................................................1-24
Oracle Workflow Components.......................................................................................................................2-1
Oracle Workflow Components ......................................................................................................................2-3
Objectives ......................................................................................................................................................2-4
Oracle Workflow Architecture ......................................................................................................................2-5
Oracle Workflow Components ......................................................................................................................2-9
Workflow Engine ..........................................................................................................................................2-10
m y
d e
Workflow Processes ......................................................................................................................................2-11
Supported Process Constructs........................................................................................................................2-13

c a
Oracle Workflow Builder ..............................................................................................................................2-17
Business Event System Architecture .............................................................................................................2-18

A
Business Event System Components.............................................................................................................2-19
Advanced Queuing, an Enabling Technology ...............................................................................................2-20

e
c l
Oracle Database Communication Alternatives..............................................................................................2-21
Accessing Oracle Workflow Web Pages .......................................................................................................2-23
Oracle Workflow Home Pages ......................................................................................................................2-24

r a
Notification System .......................................................................................................................................2-25
Worklist Web Pages ......................................................................................................................................2-26

O ly
E-Mail Notifications ......................................................................................................................................2-27
Directory Services .........................................................................................................................................2-28

l & On
Status Monitor Web Pages.............................................................................................................................2-29
Workflow Definitions Loader........................................................................................................................2-30

n a e
Workflow XML Loader.................................................................................................................................2-31
Workflow Manager........................................................................................................................................2-32

t e r U s
Service Components ......................................................................................................................................2-33
Oracle Workflow Documentation..................................................................................................................2-34

I n
Review Questions ..........................................................................................................................................2-36
Summary........................................................................................................................................................2-37

c l e
Planning a Workflow Process.........................................................................................................................3-1
Planning a Workflow Process........................................................................................................................3-3
Objectives ......................................................................................................................................................3-4

r a
Workflow Process Components ....................................................................................................................3-5
Oracle Workflow Builder ..............................................................................................................................3-7

O Standard Activities ........................................................................................................................................3-8

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


i
Planning a Workflow Process........................................................................................................................3-10
Activity Results and Lookup Types...............................................................................................................3-13
Practice - Planning a Workflow Process....................................................................................................3-15
Solution – Planning a Workflow Process ..................................................................................................3-16
Summary........................................................................................................................................................3-17
Diagramming a Workflow Process ................................................................................................................4-1
Diagramming a Workflow Process................................................................................................................4-3
Objectives ......................................................................................................................................................4-4
Creating a New Workflow Process................................................................................................................4-5
Creating a New Process from Top Down ......................................................................................................4-6
Creating a New Process from Bottom Up .....................................................................................................4-7
Diagramming a Process .................................................................................................................................4-8
Quick Start Wizard ........................................................................................................................................4-9
Defining an Item Type...................................................................................................................................4-12
Defining a Process Activity ...........................................................................................................................4-14
Diagramming a Process .................................................................................................................................4-16
Top-Down Design .........................................................................................................................................4-17
Diagramming a Process .................................................................................................................................4-18
<Default> Transition .....................................................................................................................................4-19
<Any> Transition ..........................................................................................................................................4-20
Editing a Transition .......................................................................................................................................4-21
Self-Looping Transitions ...............................................................................................................................4-23
Customizing an Activity Node ......................................................................................................................4-24
Show Label in Designer Menu Options.........................................................................................................4-26
Display Modes...............................................................................................................................................4-27
Verifying a Process Definition ......................................................................................................................4-28
Validation Performed by the Verify Command.............................................................................................4-29
Saving Process Definitions ............................................................................................................................4-31
m y
d
Solution – Creating a Workflow Process...................................................................................................4-33e
Practice - Creating a Workflow Process ....................................................................................................4-32

c
Defining Item Type Attributes and Lookup Types.......................................................................................5-1 a
Summary........................................................................................................................................................4-35

A
Defining Item Type Attributes and Lookup Types........................................................................................5-3
Objectives ......................................................................................................................................................5-4

e
c l
Defining Item Type Attributes.......................................................................................................................5-5
Attribute Data Types .....................................................................................................................................5-7

r a
Defining Item Type Attributes.......................................................................................................................5-9
URL Attributes ..............................................................................................................................................5-10
Form Attributes .............................................................................................................................................5-13
O ly
Document Attributes......................................................................................................................................5-16

l & On
Deleting Item Attributes ................................................................................................................................5-19
Defining Lookup Types.................................................................................................................................5-20
Defining Lookup Codes.................................................................................................................................5-21
a e
Practice - Defining Item Type Attributes...................................................................................................5-22

n
e r
Solution – Defining Item Type Attributes ................................................................................................5-23

s
Summary........................................................................................................................................................5-26

t U
Defining Messages and Notification Activities ..............................................................................................6-1

I n
Defining Messages and Notification Activities .............................................................................................6-3
Objectives ......................................................................................................................................................6-4

l e
Notification Activities ...................................................................................................................................6-5

c
Defining a Message .......................................................................................................................................6-6

r a
Defining a Message Attribute........................................................................................................................6-8
Defining a Respond Attribute........................................................................................................................6-10
Defining a Message Result ............................................................................................................................6-11
O Notification Details Web Page ......................................................................................................................6-12

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


ii
HTML E-mail Notifications ..........................................................................................................................6-13
Plain Text E-mail Notifications Using Templated Response ........................................................................6-14
Plain Text E-mail Notifications Using Direct Response ...............................................................................6-15
Practice - Defining Messages ....................................................................................................................6-16
Solution – Defining Messages ..................................................................................................................6-17
Defining a Notification Activity....................................................................................................................6-20
Standard Voting Activity...............................................................................................................................6-22
Defining a Notification Activity Node ..........................................................................................................6-23
Defining a Timeout for a Notification ...........................................................................................................6-24
Defining a Dynamic Priority for a Notification.............................................................................................6-25
Defining a Performer for a Notification ........................................................................................................6-26
Special Message Attributes............................................................................................................................6-27
Action History ...............................................................................................................................................6-34
Special Message Function .............................................................................................................................6-35
Embedding Oracle Application Framework Regions in Notifications ..........................................................6-37
Practice - Defining Notification Activities ................................................................................................6-38
Solution – Defining Notification Activities...............................................................................................6-39
Summary........................................................................................................................................................6-41
Testing and Monitoring Workflow Processes ...............................................................................................7-1
Testing and Monitoring Workflow Processes................................................................................................7-3
Objectives ......................................................................................................................................................7-4
Testing Workflow Processes .........................................................................................................................7-5
Administrator Monitor...................................................................................................................................7-8
Viewing Workflows in the Administrator Monitor .......................................................................................7-10
Viewing Activity History in the Administrator Monitor ...............................................................................7-12
Viewing a Status Diagram in the Administrator Monitor..............................................................................7-13
Viewing Responses in the Administrator Monitor ........................................................................................7-15
Viewing Workflow Details in the Administrator Monitor.............................................................................7-17
m y
Viewing Error Information in the Administrator Monitor.............................................................................7-18
Viewing Child Workflows in the Administrator Monitor .............................................................................7-19
d e
c
Viewing Workflows in the Self-Service Monitor..........................................................................................7-21
Viewing Notification History in the Self-Service Monitor............................................................................7-23
a
Self-Service Monitor .....................................................................................................................................7-20

e A
Viewing a Status Diagram in the Self-Service Monitor ................................................................................7-24
Viewing Responses in the Self-Service Monitor ...........................................................................................7-26

c l
Viewing Error Information in the Self-Service Monitor ...............................................................................7-28
Practice - Running a Workflow Process ....................................................................................................7-29

r a
Solution – Running a Workflow Process...................................................................................................7-30
Summary........................................................................................................................................................7-31

O ly
Viewing and Responding to Notifications......................................................................................................8-1

l & On
Viewing and Responding to Notifications.....................................................................................................8-3
Objectives ......................................................................................................................................................8-4
Viewing Notifications from a Web Browser .................................................................................................8-5
a e
Worklist Pages...............................................................................................................................................8-6

n
e r
Advanced Worklist ........................................................................................................................................8-7

s
Notification Details........................................................................................................................................8-9

t U
Reassigning Notifications..............................................................................................................................8-12

I n
Requesting More Information........................................................................................................................8-14
Certificate-Based Digital Signatures .............................................................................................................8-15

e
Granting Worklist Access..............................................................................................................................8-17

l
Administrator Search for Notifications..........................................................................................................8-21

c
Reviewing Electronic Signature Details ........................................................................................................8-23

r a
Personal Worklist ..........................................................................................................................................8-25
Simple Search for Notifications.....................................................................................................................8-27

O Advanced Search for Notifications................................................................................................................8-28


Creating a Personal Worklist View ...............................................................................................................8-30

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


iii
Practice - Responding to Notifications ......................................................................................................8-32
Solution – Responding to Notifications.....................................................................................................8-33
Viewing Notifications Through E-mail .........................................................................................................8-34
E-mail Response Methods .............................................................................................................................8-36
HTML-Formatted E-mail Notifications.........................................................................................................8-37
Plain Text E-mail Notifications Using Templated Response ........................................................................8-39
Plain Text E-mail Notifications Using Direct Response ...............................................................................8-40
Viewing an E-mail Summary of Notifications ..............................................................................................8-41
Vacation Rules...............................................................................................................................................8-42
Maintaining Vacation Rules ..........................................................................................................................8-43
Defining Vacation Rules ...............................................................................................................................8-44
Practice - Modifying A Workflow Process................................................................................................8-47
Solution – Modifying a Workflow Process ...............................................................................................8-49
Summary........................................................................................................................................................8-52
Worklist Flexfields...........................................................................................................................................9-1
Worklist Flexfields ........................................................................................................................................9-3
Objectives ......................................................................................................................................................9-4
Worklist Flexfields ........................................................................................................................................9-5
Benefits of Worklist Flexfields......................................................................................................................9-6
Defining a Specialized Worklist View Using Worklist Flexfields ................................................................9-7
Message Attributes in Worklist Flexfields Rules ..........................................................................................9-8
How Worklist Flexfields Rules Operate........................................................................................................9-9
Phase Numbers ..............................................................................................................................................9-10
Customization Levels ....................................................................................................................................9-11
Core Rules .....................................................................................................................................................9-12
Limit and User Rules.....................................................................................................................................9-14
Combining Core, Limit, and User Rules .......................................................................................................9-17
Worklist Flexfields Rules Example ...............................................................................................................9-18
m y
Defining a Worklist Flexfields Rule: Entering General Properties ...............................................................9-20
Defining a Worklist Flexfields Rule: Selecting Filter Criteria ......................................................................9-22
d e
Defining a Worklist Flexfields Rule: Selecting Message Attributes .............................................................9-23
Defining a Worklist Flexfields Rule: Mapping Attributes to Columns .........................................................9-25
c
Resolving Conflicts Between Worklist Flexfields Rules...............................................................................9-27
a
e A
Maintaining Worklist Flexfields Rules..........................................................................................................9-28
Storing Message Attribute Values in Worklist Flexfields Columns..............................................................9-30

c l
Performing a Worklist Flexfields Rule Simulation .......................................................................................9-31
Defining a Securing Function........................................................................................................................9-34

r a
Creating a Personalized View for the Personal Worklist...............................................................................9-35
Restarting Oracle HTTP Server.....................................................................................................................9-37

O ly
Practice - Defining a Specialized Worklist View Using Worklist Flexfields ............................................9-38
Solution – Defining a Specialized Worklist View Using Worklist Flexfields...........................................9-41

l & On
Summary........................................................................................................................................................9-45
Oracle Workflow Directory Service...............................................................................................................10-1
a e
Oracle Workflow Directory Service ..............................................................................................................10-3

n
e r
Objectives ......................................................................................................................................................10-4

s
Oracle Workflow Directory Service ..............................................................................................................10-5

t U
Predefined Directory Service.........................................................................................................................10-6

I n
Directory Service Views................................................................................................................................10-7
WF_USERS View .........................................................................................................................................10-8

e
WF_ROLES View.........................................................................................................................................10-11

l
WF_USER_ROLES View.............................................................................................................................10-13

c
WF_USER_ROLE_ASSIGNMENTS_V View ............................................................................................10-16

r a
Local Directory Service Tables .....................................................................................................................10-18
Ad Hoc Users and Roles................................................................................................................................10-20

O Validating a Directory Service Data Model...................................................................................................10-21


Setting Workflow Preferences.......................................................................................................................10-22

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


iv
Loading Roles................................................................................................................................................10-23
Summary........................................................................................................................................................10-24
Defining Function Activities ...........................................................................................................................11-1
Defining Function Activities .........................................................................................................................11-3
Objectives ......................................................................................................................................................11-4
Function Activities ........................................................................................................................................11-5
Defining a Function Activity .........................................................................................................................11-6
Practice - Defining a Function Activity .....................................................................................................11-8
Solution – Defining a Function Activity....................................................................................................11-10
External Function Activities ..........................................................................................................................11-13
Assigning a Cost to a Function Activity........................................................................................................11-15
Practice - Branching on a Function Activity Result ..................................................................................11-16
Solution – Branching on a Function Activity Result .................................................................................11-18
PL/SQL Procedures for Function Activities ..................................................................................................11-21
Standard API for PL/SQL Procedures Called by Function Activities ...........................................................11-22
Standard API Parameters...............................................................................................................................11-24
Function Activity Execution Modes ..............................................................................................................11-25
Standard API Resultout Parameter ................................................................................................................11-27
Exception Handling .......................................................................................................................................11-28
Exception Handling Example ........................................................................................................................11-29
Defining Activity Details...............................................................................................................................11-30
Error Handling...............................................................................................................................................11-32
Looping .........................................................................................................................................................11-33
Defining an Activity Attribute.......................................................................................................................11-34
Setting Activity Attribute Values ..................................................................................................................11-35
Practice - Using the Standard Assign Activity...........................................................................................11-36
Solution – Using the Standard Assign Activity .........................................................................................11-38

m y
Summary........................................................................................................................................................11-44

d e
Workflow Engine.............................................................................................................................................12-1
Workflow Engine ..........................................................................................................................................12-3

c a
Objectives ......................................................................................................................................................12-4
Overview of the Workflow Engine................................................................................................................12-5

A
Initiating a Workflow Process .......................................................................................................................12-7
Workflow Engine Processing ........................................................................................................................12-9

e
c l
Activity Statuses ............................................................................................................................................12-12
Calling the Workflow Engine........................................................................................................................12-13

r a
Background Engines......................................................................................................................................12-14
Stuck Processes .............................................................................................................................................12-15
Timed Out Activities .....................................................................................................................................12-16
O ly
Deferred Processing.......................................................................................................................................12-17

l & On
Oracle Workflow APIs ..................................................................................................................................12-19
Workflow Engine APIs .................................................................................................................................12-21
Workflow Engine Bulk APIs.........................................................................................................................12-28
a e
Practice - Implementing Timeout Processing ............................................................................................12-29

n
e r
Solution – Implementing Timeout Processing...........................................................................................12-30

s
Practice - Implementing Deferred Processing ...........................................................................................12-33

t U
Solution – Implementing Deferred Processing ..........................................................................................12-34

I n
Summary........................................................................................................................................................12-36
Business Events ................................................................................................................................................13-1

l e
Business Events .............................................................................................................................................13-3

c
Objectives ......................................................................................................................................................13-4

r a
Business Events .............................................................................................................................................13-5
Event Properties.............................................................................................................................................13-6
Generate Functions ........................................................................................................................................13-8
O License Status for Events ..............................................................................................................................13-10

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


v
Defining an Event..........................................................................................................................................13-11
Event Groups .................................................................................................................................................13-12
Defining an Event Group...............................................................................................................................13-13
Maintaining Events........................................................................................................................................13-14
Raising Events ...............................................................................................................................................13-16
Event Message Structure ...............................................................................................................................13-18
Raising an Event Manually............................................................................................................................13-19
Predefined Events ..........................................................................................................................................13-20
Practice - Defining an Event......................................................................................................................13-21
Solution – Defining an Event.....................................................................................................................13-22
Practice - Raising an Event........................................................................................................................13-24
Solution – Raising an Event ......................................................................................................................13-25
Summary........................................................................................................................................................13-27
Event Subscriptions.........................................................................................................................................14-1
Event Subscriptions .......................................................................................................................................14-3
Objectives ......................................................................................................................................................14-4
Event Subscriptions .......................................................................................................................................14-5
Event Manager Subscription Processing .......................................................................................................14-6
Local Event Subscription Processing ............................................................................................................14-7
External Event Subscription Processing ........................................................................................................14-9
Subscription Properties..................................................................................................................................14-10
Subscription Actions......................................................................................................................................14-14
Subscription Actions: Sending an Event to a Workflow Process ..................................................................14-15
Subscription Actions: Sending an Event to an Agent....................................................................................14-17
Subscription Actions: Sending a Notification................................................................................................14-19
Subscription Actions: Sending and Receiving Oracle XML Gateway Messages..........................................14-21
Subscription Actions: Running a Custom Rule Function ..............................................................................14-22
Subscription Properties..................................................................................................................................14-25
m y
d e
License Status for Subscriptions....................................................................................................................14-28
Deferred Subscription Processing..................................................................................................................14-29

c a
PL/SQL and Java Subscription Processing....................................................................................................14-31
Defining a Subscription .................................................................................................................................14-33
Maintaining Subscriptions .............................................................................................................................14-35

e A
Predefined Subscriptions ...............................................................................................................................14-36
Practice - Defining a Subscription .............................................................................................................14-37

c l
Solution – Defining a Subscription............................................................................................................14-39
Summary........................................................................................................................................................14-44

r a
Systems and Agents .........................................................................................................................................15-1
Systems and Agents.......................................................................................................................................15-3
O ly
Objectives ......................................................................................................................................................15-4

l & On
Systems..........................................................................................................................................................15-5
System Properties ..........................................................................................................................................15-6
Local System .................................................................................................................................................15-7
a e
External Systems ...........................................................................................................................................15-8

n
e r
Defining a System .........................................................................................................................................15-9

s
Maintaining Systems .....................................................................................................................................15-10

t U
Agents............................................................................................................................................................15-12

I n
Standard Agents.............................................................................................................................................15-14
Agent Properties ............................................................................................................................................15-16

e
Custom Queue Handlers ................................................................................................................................15-21

l
Agents on External Systems ..........................................................................................................................15-22

c
Defining an Agent .........................................................................................................................................15-24

r a
Agent Groups.................................................................................................................................................15-26
Defining an Agent Group ..............................................................................................................................15-27

O Maintaining Agents .......................................................................................................................................15-28


External System Registration ........................................................................................................................15-29

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


vi
Retrieving System Identifier Information......................................................................................................15-31
Registering Systems ......................................................................................................................................15-33
Review Questions ..........................................................................................................................................15-36
Summary........................................................................................................................................................15-38
Defining Event Activities.................................................................................................................................16-1
Defining Event Activities ..............................................................................................................................16-3
Objectives ......................................................................................................................................................16-4
Event Activities .............................................................................................................................................16-5
Event-Based Workflow Processes .................................................................................................................16-6
Event Activity Actions ..................................................................................................................................16-7
Receive Event Activities ...............................................................................................................................16-8
Receive Event Activities: Event Filter..........................................................................................................16-9
Receive Event Activities: Sending an Event to One Process........................................................................16-10
Receive Event Activities: Sending an Event to Multiple Processes .............................................................16-12
Receive Event Activities: Receiving an Event ..............................................................................................16-13
Raise Event Activities ...................................................................................................................................16-15
Send Event Activities ....................................................................................................................................16-16
Defining an Event Activity............................................................................................................................16-17
Event Details .................................................................................................................................................16-19
Defining Event Details: Receive ...................................................................................................................16-20
Defining Event Details: Raise .......................................................................................................................16-21
Defining Event Details: Send ........................................................................................................................16-23
Example: Order Processing ...........................................................................................................................16-25
Standard Activities ........................................................................................................................................16-26
Practice - Defining Event Activities ..........................................................................................................16-27
Solution – Defining Event Activities.........................................................................................................16-29
y
Summary........................................................................................................................................................16-38
Business Event System APIs ...........................................................................................................................17-1
m
d e
Business Event System APIs .........................................................................................................................17-3
Objectives ......................................................................................................................................................17-4

c a
Business Event System datatypes ..................................................................................................................17-5
Event Message Structure ...............................................................................................................................17-6

A
Agent Structure..............................................................................................................................................17-10
Parameter List Structure ................................................................................................................................17-12

e
c l
Parameter Structure .......................................................................................................................................17-13
Raising Events Programmatically..................................................................................................................17-15

r a
Event Data Generate Functions .....................................................................................................................17-22
Standard API for PL/SQL Event Data Generate Functions...........................................................................17-23
Standard API for Java Event Data Generate Functions .................................................................................17-24
O ly
Queue Handlers .............................................................................................................................................17-27

l & On
Standard APIs for PL/SQL Queue Handlers .................................................................................................17-28
Standard APIs for Java Queue Handlers........................................................................................................17-29
Subscription Rule Functions..........................................................................................................................17-31
a e
Standard API for PL/SQL Subscription Rule Functions ...............................................................................17-32

n
e r
Standard API for Java Subscription Rule Functions......................................................................................17-34

s
Predefined Subscription Rule Functions........................................................................................................17-36

t U
Event APIs.....................................................................................................................................................17-38

I n
Event Function APIs......................................................................................................................................17-40
Adding a Correlation ID to an Event Message ..............................................................................................17-41

l e
Business Event System Cleanup API ............................................................................................................17-43
Summary........................................................................................................................................................17-44

c
r a
Error Handling ................................................................................................................................................18-1
Error Handling...............................................................................................................................................18-3
Objectives ......................................................................................................................................................18-4
O Error Handling for Workflow Processes .......................................................................................................18-5

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


vii
Default Error Process.....................................................................................................................................18-7
Retry-only Process.........................................................................................................................................18-9
Error Handling for Subscription Processing ..................................................................................................18-11
Stop and Rollback Error Handling ................................................................................................................18-13
Skip to Next Error Handling..........................................................................................................................18-15
Standard Error Agents ...................................................................................................................................18-17
Error Handling Subscriptions ........................................................................................................................18-18
Warning Conditions in Subscription Processing ...........................................................................................18-19
Unexpected Events ........................................................................................................................................18-20
Default Event Error Process ..........................................................................................................................18-21
Event Warnings .............................................................................................................................................18-22
External Event Errors ....................................................................................................................................18-23
Local Event Errors.........................................................................................................................................18-24
Guided Demonstration - Error Handling ...................................................................................................18-25
Summary........................................................................................................................................................18-26
PL/SQL Documents.........................................................................................................................................19-1
PL/SQL Documents.......................................................................................................................................19-3
Objectives ......................................................................................................................................................19-4
PL/SQL Documents.......................................................................................................................................19-5
Integrating PL/SQL Documents into Workflow Processes ...........................................................................19-6
Including PL/SQL Documents in Messages ..................................................................................................19-8
Standard API for a PL/SQL Document .........................................................................................................19-9
Standard API for a PL/SQL CLOB Document..............................................................................................19-11
Standard API for a PL/SQL BLOB Document..............................................................................................19-13
Practice - Using a PL/SQL Document Attribute........................................................................................19-15
Solution – Using a PL/SQL Document Attribute ......................................................................................19-17
y
Summary........................................................................................................................................................19-22
Post-Notification Functions.............................................................................................................................20-1
m
d e
Post-Notification Functions ...........................................................................................................................20-3
Objectives ......................................................................................................................................................20-4

Standard API for PL/SQL Procedures Called by Notification Activities ......................................................20-6


c a
PL/SQL Procedures for Notification Activities.............................................................................................20-5

A
Post-Notification Function Execution Modes................................................................................................20-9
Standard API Resultout Parameter for a Post-Notification Function ............................................................20-11

e
c l
Post-Notification Function Context Information ...........................................................................................20-12
Practice - Defining a Post-Notification Function.......................................................................................20-13

r a
Solution – Defining a Post-Notification Function .....................................................................................20-15
Exception Handling .......................................................................................................................................20-19
Summary........................................................................................................................................................20-20
O ly
Forced Synchronous Processing .....................................................................................................................21-1

l & On
Forced Synchronous Processing ....................................................................................................................21-3
Objectives ......................................................................................................................................................21-4

n a e
Forced Synchronous Processes......................................................................................................................21-5
Process Definition Restrictions......................................................................................................................21-6

t e r U s
Summary........................................................................................................................................................21-9
Selector/Callback Functions ...........................................................................................................................22-1

I n
Selector/Callback Functions ..........................................................................................................................22-3
Objectives ......................................................................................................................................................22-4

e
Item Type Selector/Callback Functions.........................................................................................................22-5

l
Defining a Selector/Callback Function for an Item Type ..............................................................................22-6

c
Standard API for a Selector/Callback Function.............................................................................................22-7

r a
Standard API Parameters...............................................................................................................................22-9
Selector/Callback Function Commands.........................................................................................................22-11

O Practice - Defining a Selector Function .....................................................................................................22-13


Solution – Defining a Selector Function....................................................................................................22-15

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


viii
Summary........................................................................................................................................................22-20
Master/Detail Coordination Activities ...........................................................................................................23-1
Master/Detail Coordination Activities...........................................................................................................23-3
Objectives ......................................................................................................................................................23-4
Master/Detail Coordination Activities...........................................................................................................23-5
Wait for Flow Activity ..................................................................................................................................23-9
Continue Flow Activity .................................................................................................................................23-11
Master Process Example................................................................................................................................23-12
Detail Process Example .................................................................................................................................23-13
Continue Flow Processing .............................................................................................................................23-14
Summary........................................................................................................................................................23-15
Customizing Workflow Processes ..................................................................................................................24-1
Customizing Workflow Processes .................................................................................................................24-3
Objectives ......................................................................................................................................................24-4
Customizing Workflow Processes .................................................................................................................24-5
Access Protection ..........................................................................................................................................24-7
Access Levels ................................................................................................................................................24-8
Setting the Access Level................................................................................................................................24-10
Setting Protection and Customization Levels ................................................................................................24-11
Example of Access Protection .......................................................................................................................24-13
Unsupported Customizations.........................................................................................................................24-15
Workflow Definitions Loader........................................................................................................................24-16
Preserving Customizations ............................................................................................................................24-17
Summary........................................................................................................................................................24-18
Workflow Loaders...........................................................................................................................................25-1
Workflow Loaders.........................................................................................................................................25-3

m y
Objectives ......................................................................................................................................................25-4

d e
Workflow Definitions Loader........................................................................................................................25-5
Workflow XML Loader.................................................................................................................................25-7

c a
Summary........................................................................................................................................................25-11
Specialized Workflow Monitoring .................................................................................................................26-1

A
Specialized Workflow Monitoring ................................................................................................................26-3
Objectives ......................................................................................................................................................26-4

e
c l
Assigning Specialized Workflow Monitoring Privileges ..............................................................................26-5
Granting Restricted Access to Workflow Monitoring Data...........................................................................26-7

r a
Granting Restricted Access Based on Item Types .........................................................................................26-8
Granting Restricted Access Based on Functional Criteria.............................................................................26-9
Granting Permissions for Administrative Actions.........................................................................................26-11
O ly
Guided Demonstration - Setting Up Specialized Workflow Monitoring...................................................26-12

l & On
Summary........................................................................................................................................................26-15
Setting Up Oracle Workflow ..........................................................................................................................27-1

n a e
Setting Up Oracle Workflow .........................................................................................................................27-3
Objectives ......................................................................................................................................................27-4

t r s
Required Setup Steps.....................................................................................................................................27-5

e
Step 1 Setting Global Workflow Preferences ................................................................................................27-6
U
Step 2 Setting Up an Oracle Workflow Directory Service ............................................................................27-9

I n
Step 3 Running Background Engines ............................................................................................................27-13
Step 4 Configuring the Business Event System.............................................................................................27-16

l e
Step 4 Event Message Communication .........................................................................................................27-17

c
Step 4 Setting Up Database Links and Queues..............................................................................................27-18

r a
Step 4 Checking Database Parameters...........................................................................................................27-19
Step 4 Scheduling Agent Listeners................................................................................................................27-20
Step 4 Scheduling Propagation......................................................................................................................27-23
O Guided Demonstration - Scheduling Agent Listeners and Propagation ....................................................27-27

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


ix
Step 4 Synchronizing License Statuses .........................................................................................................27-29
Step 4 Cleaning Up the WF_CONTROL Queue...........................................................................................27-30
Step 4 Tuning Performance ...........................................................................................................................27-31
Step 4 Specifying the BPEL Server...............................................................................................................27-33
Optional Setup Steps .....................................................................................................................................27-34
Optional Step 1 Partitioning Workflow Tables .............................................................................................27-36
Optional Step 2 Setting Up Additional Languages........................................................................................27-38
Optional Step 3 Implementing Notification Mailers .....................................................................................27-40
Optional Step 4 Customizing Message Templates ........................................................................................27-43
Optional Step 5 Adding Worklist Functions to User Responsibilities...........................................................27-46
Optional Step 6 Setting the Notification Reassign Mode ..............................................................................27-48
Optional Step 7 Setting Up Notification Handling Options ..........................................................................27-49
Optional Step 8 Setting Up for Electronic Signatures ...................................................................................27-51
Optional Step 9 Customizing the Workflow Web Page Logo .......................................................................27-53
Optional Step 10 Adding Custom Icons ........................................................................................................27-54
Version Compatibility ...................................................................................................................................27-55
Review Questions ..........................................................................................................................................27-56
Summary........................................................................................................................................................27-58
Managing Service Components ......................................................................................................................28-1
Managing Service Components.....................................................................................................................28-3
Objectives ......................................................................................................................................................28-4
Oracle Workflow Manager ............................................................................................................................28-5
Service Components ......................................................................................................................................28-6
Service Component Containers .....................................................................................................................28-7
Service Component Types.............................................................................................................................28-8
Accessing Service Components in Oracle Workflow Manager.....................................................................28-9
Managing Service Components.....................................................................................................................28-10
Service Component Container Logs ..............................................................................................................28-12
m y
d e
Service Component Startup Modes ...............................................................................................................28-13
Agent Listeners..............................................................................................................................................28-14

c a
Agent Listener Configuration Wizards..........................................................................................................28-17
Notification Mailers.......................................................................................................................................28-20
Outbound Notification Mailer Processing .....................................................................................................28-21

e A
Inbound Notification Mailer Processing........................................................................................................28-23
Notification Mailer Setup ..............................................................................................................................28-25

c l
Connecting to Mail Servers Through SSL.....................................................................................................28-27
Notification Mailer Basic Configuration .......................................................................................................28-28

r a
Notification Mailer Advanced Configuration................................................................................................28-30
Component Details for Notification Mailers .................................................................................................28-37

O ly
Notification Mailer Throughput ....................................................................................................................28-39
Guided Demonstration - Service Components ..........................................................................................28-40

l & On
Handling Notification Mailer Errors..............................................................................................................28-42
Summary........................................................................................................................................................28-43

a e
Managing System Status and Throughput ....................................................................................................29-1

n
e r
Managing System Status and Throughput .....................................................................................................29-3

s
Objectives ......................................................................................................................................................29-4

t U
Workflow System Status ...............................................................................................................................29-5

I n
Workflow Status in Oracle Applications Manager ........................................................................................29-7
Oracle Workflow Administration ..................................................................................................................29-9

e
Work Items ....................................................................................................................................................29-10

l
Oracle Workflow Administration ..................................................................................................................29-15

c
Purging Workflow Data.................................................................................................................................29-16

r a
Completed Work Items..................................................................................................................................29-21
Workflow Purge APIs ...................................................................................................................................29-24

O Oracle Workflow Administration ..................................................................................................................29-25


Background Engines......................................................................................................................................29-26

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


x
Oracle Workflow Administration ..................................................................................................................29-29
Control Queue Cleanup .................................................................................................................................29-30
Oracle Workflow Administration ..................................................................................................................29-32
Queue Propagation ........................................................................................................................................29-33
Oracle Workflow Administration ..................................................................................................................29-34
Agent Activity ...............................................................................................................................................29-35
Searching Messages on an Agent ..................................................................................................................29-36
Guided Demonstration - System Status and Throughput...........................................................................29-37
Summary........................................................................................................................................................29-40
Sample Solutions..............................................................................................................................................30-1
Sample Solutions ...........................................................................................................................................30-3
Overview .......................................................................................................................................................30-4
Vacation Proposal Process Sketch.................................................................................................................30-5
wfvacxx.html .................................................................................................................................................30-6
wfvacxxc.sql..................................................................................................................................................30-7
wfvacxxs.sql ..................................................................................................................................................30-9
wfvacxxb.sql..................................................................................................................................................30-14
wfvacxxd.sql..................................................................................................................................................30-28
wfslctxx.sql....................................................................................................................................................30-30

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


xi
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Preface
Profile
Before You Begin This Course

• Thorough knowledge of Oracle Database and Oracle Application Server technology

• Thorough knowledge of Oracle E-Business Suite

Prerequisites

• Introduction to Oracle Database: SQL Basics

• Oracle Database: Program with PL/SQL

How This Course Is Organized

R12 Implement Oracle Workflow is an instructor-led course featuring lecture and hands-on
exercises. Online demonstrations and written practice sessions reinforce the concepts and skills
introduced.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


xiii
Related Publications
Oracle Publications
Title Part Number
Oracle Workflow Administrator's Guide B31431
Oracle Workflow Developer's Guide B31433
Oracle Workflow User's Guide B31432
Oracle Workflow API Reference B31434
Oracle Workflow Client Installation Guide B31435
Oracle Workflow Documentation Resources, Release 12 OracleMetaLink note 396314.1

Additional Publications

• System release bulletins

• Installation and user’s guides

• Read-me files

• International Oracle User’s Group (IOUG) articles


m y
• Oracle Magazine
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


xiv
Typographic Conventions
Typographic Conventions in Text
Convention Element Example
Bold italic Glossary term (if The algorithm inserts the new key.
there is a glossary)
Caps and Buttons, Click the Executable button.
lowercase check boxes, Select the Can’t Delete Card check box.
triggers, Assign a When-Validate-Item trigger to the ORD block.
windows Open the Master Schedule window.
Courier new, Code output, Code output: debug.set (‘I”, 300);
case sensitive directory names, Directory: bin (DOS), $FMHOME (UNIX)
(default is filenames, Filename: Locate the init.ora file.
lowercase) passwords, Password: User tiger as your password.
pathnames, Pathname: Open c:\my_docs\projects
URLs, URL: Go to http://www.oracle.com
user input,
User input: Enter 300
usernames
Username: Log on as scott
Initial cap Graphics labels Customer address (but Oracle Payables)
(unless the term is a

Italic
proper noun)
Emphasized words Do not save changes to the database.
m y
and phrases,
titles of books and
For further information, see Oracle7 Server SQL Language
Reference Manual.
d e
courses,
variables
Enter user_id@us.oracle.com, where user_id is the
name of the user.
ca
Quotation
marks
Interface elements
with long names A
Select “Include a reusable module component” and click Finish.

e
that have only
initial caps;
c l
This subject is covered in Unit II, Lesson 3, “Working with
Objects.”
lesson and chapter
titles in cross-
r a
Uppercase
references
SQL column O ly Use the SELECT command to view information stored in the
names, commands,
l
functions, schemas,& On LAST_NAME
column of the EMP table.
table names

n a e
Arrow
Brackets
Commas
Menu paths
Key names

t e r
Key sequences
U s Select File > Save.
Press [Enter].
Press and release keys one at a time:

Plus signs I n
Key combinations
[Alternate], [F], [D]
Press and hold these keys simultaneously: [Ctrl]+[Alt]+[Del]

c l e
r a
O
Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


xv
Typographic Conventions in Code
Convention Element Example
Caps and Oracle Forms When-Validate-Item
lowercase triggers
Lowercase Column names, SELECT last_name
table names FROM s_emp;

Passwords DROP USER scott


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

Lowercase Syntax variables CREATE ROLE role


italic
Uppercase SQL commands and SELECT userid
functions FROM emp;

Typographic Conventions in Oracle Application Navigation Paths


This course uses simplified navigation paths, such as the following example, to direct you
through Oracle Applications.

(N) Invoice > Entry > Invoice Batches Summary (M) Query > Find (B) Approve
m y
This simplified path translates to the following:
d e
1. (N) From the Navigator window, select Invoice then Entry then Invoice Batches
Summary. ca
e A
2.

c l
(M) From the menu, select Query then Find.

3. (B) Click the Approve button.


r a
Notations:
O ly
(N) = Navigator
l & On
(M) = Menu
n a e
(T) = Tab
t e r U s
(B) = Button
I n
l e
(I) = Icon

c
r a (H) = Hyperlink

O (ST) = Sub Tab

Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


xvi
Typographical Conventions in Oracle Application Help System Paths
This course uses a “navigation path” convention to represent actions you perform to find
pertinent information in the Oracle Applications Help System.

The following help navigation path, for example—

(Help) General Ledger > Journals > Enter Journals

—represents the following sequence of actions:

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

2. Under the General Ledger entry, expand Journals.

3. Under Journals, select Enter Journals.

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

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


xvii
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle Corporation, 2007. All rights reserved.

R12 Implement Oracle Workflow Table of Contents


xviii
Forced Synchronous
Processing
Chapter 21

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 2
Forced Synchronous Processing

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 3
Objectives

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 4
Forced Synchronous Processes

m y
d e
ca
Forced Synchronous Processing
e A
c l
To create a forced synchronous process, you must set the item key of your process to

r a
#SYNCH, or to wf_engine.eng_synch, which returns the #SYNCH constant when you call the
necessary WF_ENGINE APIs. Because a forced synchronous process never writes to the
O ly
database, it’s not a problem to use a non-unique item key such as #SYNCH.

l & On
Also, because a forced synchronous process never writes workflow information to the
database, a forced synchronous process completes faster than a normal synchronous process.

n a e
However, for the same reason, you cannot view the process from the Status Monitor and no
auditing is available for the process.

e r s
Note: Although the Workflow Engine does not write workflow information to the database
t U
during a forced synchronous process, you can still use custom function activities that write to

I n
database tables as part of a forced synchronous process.

c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 5
Process Definition Restrictions

m y
d e
ca
Process Definition Restrictions
e A
c
• No notification activities are allowed.l
r a
• Limited blocking-type activities are allowed. A process can block and restart with a call to
WF_ENGINE.CompleteActivity only if the blocking and restarting activities:
O ly
- Occur in the same database session

& On
- Contain no intervening calls to Oracle Workflow
l
n a e
- Contain no intervening commits
• No error processes can be assigned to the process or the process’s activities.

e r s
• Each function activity behaves as if On Revisit is set to Loop and is executed in non-
t U
canceling mode, regardless of its actual On Revisit setting. Loops are allowed in the
process.
I n
c l e
• No master/detail coordination activities are allowed.
• No parallel flows are allowed in the process because transitions from each activity must

r a have a distinct result. This also means that no <Any> transitions are allowed because they
cause parallel flows.

O
Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 6
Process Definition Restrictions

m y
d e
ca
Process Definition Restrictions
e A
c l
• None of the following Standard activities is allowed:
- And
r a
O ly
- Block (restricted by the conditions stated for limited blocking)
- Defer Thread
- Wait
l & On
a e
- Continue Flow/Wait for Flow

n
- Role Resolution
- Voting
t e r U s
- Notify I n
- Compare Execution Time

l e
• No use of the background engine is allowed; that is, activities are never deferred.
c
• No data is ever written to the Oracle Workflow tables, and as a result:

r a - The process cannot be viewed from the Status Monitor.

O - No auditing is available for the process.

Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 7
Process Definition Restrictions

m y
d e
ca
Process Definition Restrictions
e A
c l
• Only the following WF_ENGINE API calls are allowed to be made, and in all cases, the

- WF_ENGINE.CreateProcess r a
item key supplied to these APIs must be specified as #SYNCH or wf_engine.eng_synch:

- WF_ENGINE.StartProcess O ly
- WF_ENGINE.GetItemAttribute
l & On
n a e
- WF_ENGINE.SetItemAttribute
- WF_ENGINE.GetActivityAttribute

e r s
- WF_ENGINE.CompleteActivity (for the limited usage of blocking-type activities)
t U
• WF_ENGINE API calls for any item except the current synchronous item are not allowed.
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 8
Summary

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 9
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Forced Synchronous Processing


Chapter 21 - Page 10
Selector/Callback Functions
Chapter 22

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 2
Selector/Callback Functions

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 3
Objectives

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 4
Item Type Selector/Callback Functions

m y
d e
ca
Item Type Selector/Callback Functions
e A
c l
A selector function is a PL/SQL procedure that automatically identifies the specific process

r a
definition to run when a workflow is initiated for a particular item type, but when no process
name is provided. If your item type has more than one runnable process activity associated
O ly
with it, define a PL/SQL selector function that determines which process activity to run in a
particular situation.

l & On
For example, you may have two different requisition approval process activities associated

n a e
with the same item type. The process that Oracle Workflow runs varies depending on how and
where the requisition originates. Your selector function determines which process is

e r s
appropriate in any given situation. This functionality gives you more flexibility at run time to
t U
determine dynamically which process to run.

I n
You can also extend the selector function to be a general callback function so that you can reset

l e
item type context information as needed if the SQL session is interrupted during the execution
of a process.
c
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 5
Defining a Selector/Callback Function for an Item Type

m y
d e
ca
e
Defining a Selector/Callback Function for an Item Type
A
c l
For example, the WFDEMO item type has a selector function named
WF_REQDEMO.SELECTOR.
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 6
Standard API for a Selector/Callback Function

m y
d e
ca
Standard API for a Selector/Callback Function
e A
procedure <procedure name>(
c l
itemtype
itemkey
in varchar2,
in varchar2,
r a
actid in number,
O ly
command
resultout
in varchar2,
out varchar2) is
l & On
<local declarations>

n a e
r
begin
if (command = ‘RUN’) then

t e U s
<your RUN executable statements>

return;
I n
resultout:=‘<Name of process to run>’;

endif;

c l e
if (command = ‘SET_CTX’) then
<your executable statements for establishing context information>

r a resultout:=‘ ‘;
return;

O endif;

Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 7
if (command = ‘TEST_CTX’) then
<your executable statements for testing validity of current context
information>
resultout:=‘<TRUE or FALSE or NOTSET>’;
return;
endif;
if (command = ‘<other commands>’) then
resultout:=‘ ‘;
return;
endif;
exception
when others then
WF_CORE.CONTEXT (‘<package name>’, ‘<procedure name>’, <itemtype>,
<itemkey>, to_char(<actid>), <command>);
raise;
end <procedure name>;

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 8
Standard API Parameters

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 9
Standard API Parameters

m y
d e
ca
Standard API Parameters
e A
c l
The different commands for a selector/callback function require different return values.

r a
• If the function is called with the RUN command, the name of the process to run must be
returned through the resultout parameter.
O ly
• If the function is called with the TEST_CTX command, then the code must return TRUE

not been initialized yet.


l & On
if the context is correct, FALSE if the context is incorrect, or NOTSET if the context has

n a e
• If the function is called with the SET_CTX command, then no return value is expected.

t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 10
Selector/Callback Function Commands

m y
d e
ca
Selector/Callback Function Commands
e A
c l
Use the TEST_CTX command when you want to check that the user context is correct before

r a
permitting processing to start on a workflow process. Use this mode to check that the
organization is correctly set in a multi-organization environment.
O ly
• If the function returns the result value TRUE in TEST_CTX mode when the workflow is

l & On
being processed by a background engine, this result indicates that the application context
is set correctly, and the Workflow Engine keeps the current context.
a e
• If the function returns the result value NOTSET in TEST_CTX mode, then the Workflow
n
t e r
Engine executes the function again in SET_CTX mode to set the context.

U s
• If the function returns the result value FALSE in TEST_CTX mode, and the Workflow

I n
Engine permits context switching at this point in its processing, then the Workflow Engine
executes the function again in SET_CTX mode to set the correct context. However, if the

c l e
result value is FALSE, but the Workflow Engine requires the current context to be
preserved, the Workflow Engine defers the activity to be processed by a background

r a engine instead.
Use the SET_CTX mode to set up all your PL/SQL variables. In this way, you can ensure that
O PL/SQL variables are always set for asynchronous processes when you restart these processes.

Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 11
For example, you can use this mode to set a bind variable so that specific views are correct, or
to set global variables. If you are developing a custom process, you should use this mode to set
your organization context.
Note: Oracle Workflow also uses the TEST_CTX mode to determine whether a form can be
launched with the current item type context information just before the Notification Details
Web page launches a reference form. When you view a notification from the Notification
Details Web page and attempt to launch a form that is associated with the notification, Oracle
Workflow calls the selector/callback function for your item type in TEST_CTX mode to test
the context before turning the form launch over to the Oracle Application Object Library
function security system. In TEST_CTX mode, the selector/callback function can perform
whatever logic is necessary to determine whether it is appropriate to launch the form.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 12
Practice - Defining a Selector Function
Overview
In this practice, you will define a selector function to determine which process to run in the
Vacation Proposal item type that you created in the Creating a Workflow Process practice.

Note: Because many students access the system and create objects during this course, you need a
way to distinguish between the objects created by you and by your classmates. Therefore, you
will be assigned a terminal number by your instructor. Use this number as a prefix wherever you
see XX included in the name of something that you are defining. In this way, you can ensure that
the definitions you create are unique.

Note: In order to use the sample solution scripts provided for these practices, you must enter the
internal names for all objects that you define exactly as shown in the instructions. Otherwise, you
must modify the sample code to reference the object names that you define.

Assumptions
• You must have access to an Oracle Applications Vision database, or a comparable
training or test instance at your site on which to complete this practice.

• The instructor will provide you with the connect string for the class database and the
m y
user name and password of the Oracle Workflow database account.
d e

ca
The instructor will provide you with the user name and password of a user with
workflow administrator privileges. The workflow administrator is defined on the
Workflow Configuration page.

e A

c l
The instructor will provide you with the URL for the login page and the name of a
Workflow administrator responsibility. The user name that you use to log in should

r a
have this responsibility assigned to it.

• O ly
The instructor will provide you with the names of users that you can assign as the

l & On
requestor and approver in the Vacation Proposal process. These user names should have
Workflow administrator and user responsibilities assigned to them.

n a e
Tasks

t e
Defining an Additional Process
r U s
I n
Define a new process within the Vacation Proposal item type that you created in the Creating a
l e
Workflow Process practice.
c
r a
Assigning a Selector Function

OAssign a selector function to the Vacation Proposal item type.

Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 13
Defining a Selector Function

Define the PL/SQL procedure for the selector function that determines which process to run in
the Vacation Proposal item type.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 14
Solution – Defining a Selector Function
Defining an Additional Process

1. Start the Oracle Workflow Builder.

2. From the File menu, select Open to open the wfvacXX.wft data store you defined in the
Creating a Workflow Process practice.

3. In the navigator tree, select and expand your WFVACXX item type.

4. In the navigator tree, drag and drop the Vacation Proposal process onto the WFVACXX item
type to create a copy of the process. The property pages for the copied process open
automatically so that you can enter new internal and display names for the new process.
− Internal Name: WFVACXX_ALTERNATE_PROCESS
− Display Name: XX Alternate Vacation Proposal

5. Open the process diagram window for the Alternate Vacation Proposal process.

6. Delete the Loop Counter node. The transitions to and from the node are automatically
deleted as well.

7. y
Create a timeout transition from the Vacation Proposal notification back to itself. To do so,
right-click the Vacation Proposal node and hold down the right mouse button. Drag the m
d e
cursor away from the notification and then back to the notification, and then release the right
mouse button. Select <Timeout> from the transition results menu.

ca
Assigning a Selector Function

e A
8.
l
In the navigator tree, select your item type.

c
9.
a
Open the property pages for the item type. In the Selector field, enter
r
WFVACXX.SELECTOR as the selector function for the item type.

O ly
10. In the Navigator window, click the Verify button to verify your workflow.

l & On
11. From the File menu, select Save to save your work to your workflow definition file.

n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 15
12. From the File menu, select Save As and save your item type to the class database, using the
database user name, password, and connect string provided by the instructor.

13. Close the data store.

Defining a Selector Function


m y
14. Your selector function will be a PL/SQL procedure named SELECTOR. You can either use
d e
the sample SELECTOR procedure provided in the sample WFVACXX package
ca
specification and body scripts, or you can delete the sample SELECTOR procedure from the
sample scripts and practice writing your own new PL/SQL procedure instead.

e A

c l
The sample scripts are named wfvacxxs.sql and wfvacxxb.sql, respectively. They

r a
contain all the sample PL/SQL procedures for all practices in this course. The procedure
specific to this practice is WFVACXX.SELECTOR. Open a copy of each sample file

O ly
and replace all instances of XX with your own terminal number. Save the files and
rename them by replacing xx with your terminal number.

l & On
Note: If you have already copied and edited the complete sample package specification
a e
and body scripts containing all the sample procedures for all practices, you do not need
n
t e r
to repeat these steps.

U s

I n
If you plan to use the sample WFVACXX.SELECTOR procedure provided in the
sample scripts, skip to step 17.


l e
If you want to practice writing your own new PL/SQL procedure, delete the sample
c
r a WFVACXX.SELECTOR procedure from the scripts and continue to step 15.

O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 16
15. In the WFVACXX package, create a new procedure named SELECTOR that determines
which process to run in the Vacation Proposal item type. Use the standard Selector Function
API for the SELECTOR procedure.

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

16. In the SELECTOR procedure, include logic for the RUN command.

• Evaluate the value passed in the item key.

• If the uppercase value of the first four characters is CNTR, set resultout to
‘WFVACXX_PROCESS’ (the internal name of the process with the Loop Counter
timeout implementation).

• If the uppercase value of the first four characters is SELF, set resultout to
‘WFVACXX_ALTERNATE_PROCESS’ (the internal name of the process with the self-
looping timeout implementation).


an error or set resultout to the internal name for one of the processes as the defaultm y
If the uppercase value of the first four characters is neither CNTR nor SELF, either raise

process.
d e
• Save your scripts.
ca
A
Note: This example is contrived for class purposes only and does not reflect a practical
e
c l
implementation of selector function logic. The selector function is generally expected to use
the item key as the primary key to retrieve supporting application data. That application data

a
would then be used to determine which process is appropriate to run.
r
O ly
Note: It is not possible to use the value of an item attribute in the selector function, because
at the time the selector function is called by the Workflow Engine, the item attributes for the

l & On
work item have not yet been created.

n a e
17. Log in to SQL*Plus using the database user name, password, and connect string provided by

t e r U s
the instructor. Run the package specification and package body scripts in that order by
entering the following commands from the directory where the scripts are located:

@wfvacxxs
I n
c l e
@wfvacxxb

r a Alternatively, you can run the scripts from the default prompt if you include the directory
path for the scripts in the commands. For example, if your scripts are located in the E:\Labs
O folder, then enter the following commands:

Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 17
@E:\Labs\wfvacxxs

@E:\Labs\wfvacxxb

Note: If you have already run the complete sample package specification and body scripts
containing all the sample procedures for all practices, and you did not make any changes to
the scripts for this practice, you do not need to repeat this step.

18. Use SQL*Plus to launch your workflow process and test your work. First, launch a work
item with an item key that begins with CNTR. Do not specify the process to run within the
item type, so that the Workflow Engine will run the selector function for the item type to
determine which process to run. The Workflow Engine will run the selector function only if
the process parameter is not passed in the call to create the new work item.

Next, launch a work item with an item key that begins with SELF. Again, do not specify the
process to run within the item type.

Finally, launch a work item with an item key that begins neither with CNTR nor with SELF.
For example, use an item key that begins with TEST. Again, do not specify the process to
run within the item type.

Note: The selector function provided in the sample solution package raises an error if the
item key begins neither with CNTR nor with SELF, so if you are using the sample solution,
the expected behavior when you attempt to launch the process in this case is an ORA-
20002: Invalid itemkey error message.
m y
d e
You can use the sample work item launch script to launch these three work items all at once.

• ca
Copy and edit the sample work item launch script named wfslctxx.sql. Open a copy of
A
the sample file and replace all instances of XX with your own terminal number. Also,
e
c l
replace all instances of <requestor_username> with the user name of the requestor, all
instances of <approver_username> with the user name of the approver, all instances of

r a
<from_date> with the from date, and all instances of <to_date> with the to date. Then
save the file and rename it by replacing xx with your terminal number.

• O ly
Log in to SQL*Plus using the database user name, password, and connect string

l & On
provided by the instructor. Run the work item launch script by entering the following

a e
command from the directory where the script is located: @wfslctxx

n
t e r U s
Alternatively, you can run the script from the default prompt if you include the
directory path for the script in the command. For example, if your script is located in the

n
E:\Labs folder, then enter the following command:
I
c l e
@E:\Labs\wfslctxx

r a
19. You can use the Worklist Web pages to view the notifications sent by the processes and use
the Status Monitor Web pages to review the status of the processes. For each process you

O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 18
launched, verify that the expected process was run. The process that was run appears in the
following administrator Status Monitor pages:

• Activity History, in the Activity and Parent Activity columns

• Status Diagram, in the process title and the diagram itself

20. For extra practice, you can optionally create another process within your item type that
implements timeout processing in which you transition to a reminder notification when the
Vacation Proposal notification times out. Add a timeout loop for the reminder notification as
well. Then modify your selector function to run this new process when the upper case value
of the first four characters of the item key is RMND, and test your changes.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 19
Summary

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Selector/Callback Functions
Chapter 22 - Page 20
Master/Detail Coordination
Activities
Chapter 23

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 2
Master/Detail Coordination Activities

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 3
Objectives

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 4
Master/Detail Coordination Activities

m y
d e
ca
Master/Detail Coordination Activities
e A
c l
When you spawn a detail process from a master process, you are creating a separate process

r a
with its own unique item type and item key. You define the master/detail relationship between
the two processes by calling the Workflow Engine SetItemParent API after you call the
O ly
CreateProcess API and before you call the StartProcess API when you create the detail process.

l & On
Two activities are used to coordinate the flow in the master and detail processes: the Wait for
Flow activity and the Continue Flow activity. One activity is placed in the master process; the

n a e
other is placed in the detail process. Each of the activities contains two attributes used to
identify the coordinating activity in the other process.
Example
t e r U s
I n
The following code sample shows an example of launching a set of detail processes from a
master process. This API is the PL/SQL procedure for the Spawn Detail Processes function

c l e
activity in the Workflow Agent Ping/Acknowledge process. The procedure is named
WF_EVENT_PING_PKG.Launch_Processes.

r a
procedure LAUNCH_PROCESSES (
ITEMTYPE in varchar2,
O ITEMKEY in varchar2,

Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 5
ACTID in number,
FUNCMODE in varchar2,
RESULTOUT out varchar2
) is
-----------------------------------------------------------
CURSOR c_external_in_agents IS
SELECT
wfa.name AGENT,
wfs.name SYSTEM
FROM
wf_systems wfs,
wf_agents wfa
WHERE
wfa.name != 'WF_ERROR‘
and wfa.status = 'ENABLED‘
and wfa.direction = 'IN‘
and wfa.system_guid = wfs.guid
and upper(wfa.queue_handler) = 'WF_EVENT_QH';

l_eventname varchar2(100);
m y
l_eventkey varchar2(240);
d e
l_itemkey
l_event_t
varchar2(100);
wf_event_t;
ca
l_msg varchar2(32000);

e A
l_clob clob;

c l
begin
r a
if (funcmode = 'RUN') then O ly
l & On
l_eventname := wf_engine.GetActivityAttrText(

a e
itemtype => itemtype,

n
e
actid
t r
itemkey => itemkey,
s
=> actid,
U
I naname => 'EVNTNAME');

l e
for x in c_external_in_agents loop
--
c
r a -- For every agent launch detail process

O --

Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 6
l_eventkey := x.agent||'@'||x.system||'@'||itemkey;
l_itemkey := l_eventkey;

wf_engine.CreateProcess(
itemtype => itemtype,
itemkey => l_itemkey,
process => 'WFDTLPNG');

wf_engine.SetItemAttrText(
itemtype => itemtype,
itemkey => l_itemkey,
aname => 'EVNTNAME',
avalue => l_eventname);

wf_engine.SetItemAttrText(
itemtype => itemtype,
itemkey => l_itemkey,
aname => 'EVNTKEY',
avalue => l_eventkey);

m y
wf_engine.SetItemAttrText(
d e
itemtype => itemtype,
itemkey => l_itemkey,
ca
aname => 'TOAGENT',

e A
avalue
l
=> x.agent||'@'||x.system);

c
-- Initialize the wf_event_t
r a
O ly
wf_event_t.initialize(l_event_t);
l_event_t.setcorrelationid(l_itemkey);

l & On
l_msg := '<PING>Test Ping</PING>';

a e
dbms_lob.createtemporary(l_clob, FALSE, DBMS_LOB.CALL);

n
t e r
dbms_lob.write(l_clob, length(l_msg), 1 , l_msg);
s
l_event_t.SetEventData(l_clob);
U
I n
wf_engine.SetItemAttrEvent(

c l e itemtype => itemtype,


itemkey => l_itemkey,

r a name => 'EVNTMSG',

O event => l_event_t);

Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 7
wf_engine.SetItemParent(
itemtype => itemtype,
itemkey => l_itemkey,
parent_itemtype => itemtype,
parent_itemkey => itemkey,
parent_context => null);

wf_engine.StartProcess(
itemtype => itemtype,
itemkey => l_itemkey);

end loop;

resultout :=
wf_engine.eng_completed||':'||wf_engine.eng_null;

return;

elsif (funcmode = 'CANCEL') then


m y
d e
null;

ca
end if;

e A
exception
c l
when others then
r a
O ly
WF_CORE.CONTEXT('WF_EVENT_PING_PKG', 'LAUNCH_PROCESSES',
ITEMTYPE, ITEMKEY, to_char(ACTID), FUNCMODE);
raise;
l & On
n a e
end LAUNCH_PROCESSES;

t e r U s
For more information, see Oracle Workflow Developer’s Guide, “Workflow Agent
Ping/Acknowledge.”
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 8
Wait for Flow Activity

m y
d e
ca
Wait for Flow Activity
e A
c l
The Wait for Flow activity contains two attributes:

r a
• Continuation Flow: Specify whether this activity is waiting for a corresponding Master or
Detail process to complete.
O ly
• Continuation Activity: Specify the label of the activity node that must complete in the

CONTINUEFLOW.
l & On
corresponding process before the current process continues. The default value is

a e
For more information, see Oracle Workflow Developer’s Guide, “Predefined Workflow
n
Activities.”

t e r U s
Using Multiple Wait for Flow Activities

I n
You can use multiple Wait for Flow activities in the same workflow process. For example, if a
master process launches two different sets of detail processes at different stages, the master

l e
process should include a separate Wait for Flow activity node for each set of detail processes.
c
In this case, when you call the WF_ENGINE.SetItemParent API to associate a detail process

r a
with the master process, you must specify the parent context as the activity label name for the
Wait for Flow activity node that corresponds to this detail process. (If the parent process
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 9
contains only one Wait for Flow activity, however, you can leave the parent context parameter
of the WF_ENGINE.SetItemParent API null.)

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 10
Continue Flow Activity

m y
d e
ca
Continue Flow Activity
e A
c l
The Continue Flow activity contains two attributes:

r a
• Waiting Flow: Specify whether the halted process which is waiting for this activity to
complete is a Master or Detail flow.
O ly
• Waiting Activity: Specify the label of the activity node in the halted process that is waiting
for this activity to complete.
l & On
For more information, see Oracle Workflow Developer’s Guide, “Predefined Workflow
Activities.”
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 11
Master Process Example

m y
d e
ca
Master Process Example
e A
c l
In the master process above, the Start Detail Flows activity initiates several detail processes.

r a
The master process then completes Activity 1 before it pauses at the Wait for Flow activity.
The Wait for Flow activity is defined to wait for all its detail processes to complete a Continue
O ly
Flow activity before allowing the master process to transition to Activity 2.

l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 12
Detail Process Example

m y
d e
ca
Detail Process Example
e A
c l
When a detail process begins, it completes Activity A. When the process reaches the Continue

r a
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.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 13
Continue Flow Processing

m y
d e
ca
Continue Flow Processing
e A
c l
When a Continue Flow activity is executed, the WF_STANDARD.CONTINUEFLOW

r a
procedure checks whether the corresponding Wait for Flow activity is associated with any
other processes that have not yet completed their Continue Flow activities. If so, the waiting
O ly
process continues to wait for those other processes. If the Wait for Flow activity is not waiting

l & On
for any other processes, then the WF_STANDARD.CONTINUEFLOW procedure completes
the Wait for Flow activity so that the process that was waiting now continues to the next
activity.

n a e
In the master and detail process example, when a detail process executes its Continue Flow

e r s
activity, it will check whether the Wait for Flow activity in the master process is still waiting
t U
for any other detail processes. If all the other detail processes have already completed, then the

I n
master process will proceed to Activity 2. If some of the other detail processes have not
completed yet, the master process will continue waiting until these processes are complete.
l e
For more information, see Oracle Workflow Developer’s Guide, “Predefined Workflow
c
Activities.”

r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 14
Summary

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 15
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Master/Detail Coordination Activities


Chapter 23 - Page 16
Customizing Workflow
Processes
Chapter 24

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 2
Customizing Workflow Processes

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 3
Objectives

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 4
Customizing Workflow Processes

m y
d e
ca
Customizing Workflow Processes
e A
c l
Follow these guidelines when customizing workflow processes provided by an Oracle product:

r a
1. Verify that all setup steps have been completed as documented in the Oracle Workflow
Administrator’s Guide and the product-specific user’s guides.
O ly
2. Test the unmodified seeded workflow, event, or subscription on a test database, and

l & On
ensure that it runs successfully with the setup and data specific to your environment.
3. Refer to the product-specific user’s guide and any documentation updates for the specific
a e
workflow, event, or subscription of interest. These documentation sources specifically
n
t e r U s
mention what you should not modify. Oracle Support Services will not support
modifications to any object that is specifically documented as not modifiable.

I n
4. Gradually build in customizations step-by-step, and test the customized workflow or
subscription after each step.

l e
5. When creating PL/SQL procedures, conform to the standard PL/SQL API templates
c
documented in the Oracle Workflow Developer’s Guide. Be sure to handle exceptions in

r a the event of an error so that you can track down the procedure where the error has
occurred.
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 5
6. Do not implement the customized workflow, event, or subscription in production without
fully ensuring that it works successfully on a test database that is a replica of your
production setup. Modifying workflow processes, events, and subscriptions can
fundamentally change the behavior of the applications that use them, so you should
thoroughly test your changes before deploying them in production.
The following types of customizations are supported:
1. Oracle supports any customization that is stated as required in the seeded workflow’s
product-specific user’s guide or documentation update.
2. Oracle supports customization examples documented in the product-specific user’s guide
or documentation update. Any issues that arise are fully supported to resolution, to the
extent that the customization example was followed as documented. Any deviation from
what is documented amounts to a custom development issue that needs further evaluation.
See number 3 below.
3. Customizations that are not explicitly stated as unsupported customizations, as required
customizations, or as supported customization examples are supported to the extent that
the customer must first isolate the problem following the customization guidelines listed
above. If upon evaluation, Oracle Support Services deems that the isolated problem stems
from an Oracle product, Oracle will supply a solution. Otherwise, it is the responsibility of
the customer to correct the custom development issue.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 6
Access Protection

m y
d e
ca
Access Protection
e A
c l
As a workflow developer, you can use access protection to enable or discourage “customers”

r a
of your workflows from modifying your “seed data” workflow definitions.
As a customer of predefined workflows provided by Oracle, you can use access protection to
O ly
preserve valid customizations that you have made to a predefined workflow during a workflow
definition upgrade.

l & On
All workflow objects except lookup codes, function attributes, and message attributes contain
a e
an Access tab on their property pages. Lookup codes, function attributes, and message
n
respectively.
t e r
attributes inherit their access settings from their parent lookup type, function, or message,

U s
I n
The Access tab lets you define the following properties:
• Whether future customizations to the object are preserved during a workflow definition

l e
upgrade.

c
• Whether the object can be edited by users operating at a higher access level.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 7
Access Levels

m y
d e
ca
Access Levels
e A
Protection Levels
c l
r a
• If you protect an object against customization, you effectively assign the object a
protection level equal to your current access level.
O ly
• Objects protected against customizations are considered “seed data.”

l
object can modify the object.
& On
• Only users operating at an access level equal to or lower than the protection level of the

n a e
• Users operating at an access level greater than the protection level of the object will see a

only.
t e r U s
small lock on the icon for the object in the navigator tree, indicating that the object is read-

I
Customization Levels
n
• If you set an object to be customizable, its protection level is set to 1000.
l e
• The customization level of an object is set to the access level of the initial user who
c
r a customizes the object.
• A customized object is locked from further modification except from users with access

O levels equal to the customization level of the object.

Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 8
• The customization level is relevant only with respect to unprotected workflow objects.
• If an object is protected at a certain level, it should not be modified at all except by an
access level equal to or less than the protected level of the object.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 9
Setting the Access Level

m y
d e
ca
Setting Access Levels
e A
c l
You can view your access level in the About Oracle Workflow Builder dialog box available
from the Help menu.
r a
The Allow Modifications of Customized Objects check box also appears in the About Oracle
O ly
Workflow Builder dialog box. Usually you do not need to change this setting.

l & On
• Selected: The Workflow Builder saves edits only to protected objects that you have access
to change and does not overwrite previously customized objects (equivalent to Workflow
a e
Definitions Loader Upgrade mode). This option is recommended.
n
t e r U s
• Checked: The Workflow Builder saves your edits, overwriting protected objects that you
have access to modify, as well as any previously customized objects (equivalent to

n
Workflow Definitions Loader Upload mode).
I
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 10
Setting Protection and Customization Levels

m y
d e
ca
Setting Protection and Customization Levels
e A
c l
• The indicator bar provides a visual range of access levels that can edit the object:

r a
- Black vertical line: Current access level.

O ly
- White range: Cannot edit the object.
- Solid green: Can edit the object.

l & On
- Cross-hatch green: Usually cannot modify the object because it has been customized,

n a e
but can now do so because Oracle Workflow Builder is set to Allow Modifications of
Customized Objects mode so that you can modify customized objects.

t e r U s
• The Levels region shows the Customization, Access, and Protection levels of the object
based on how you set the check boxes in the Options region.

I n
• Use the Options region to set the protection and customization levels of an object:

c l e
- Preserve Customizations: Prevents you from overwriting customized objects during a
workflow definition upgrade.

r a - Lock at this Access Level: Protects the object at the current access level and does not
allow higher access levels to customize the object.

O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 11
• Oracle E-Business Suite customers should select both the Preserve Customizations and
Lock at this Access Level check boxes to protect your workflow objects during upgrades.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 12
Example of Access Protection

m y
d e
ca
Protection and Customization Levels
e A
c l
Assuming an access level of 100, these protection and customization levels result when the

r a
following check boxes are selected in the Access properties region:
• None: Any access level can update an object at any time.
O ly
• Preserve Customizations: Prohibits anyone from overwriting customized objects during a
workflow upgrade.
l & On
- Access levels 100-1000 can update an object.

n a e
- If the Allow modifications of customized objects check box is selected, access levels

t e r
customized objects.
U s
0-99 (as represented by green crosshatches in the indicator bar) can also update

I n
• Lock at this Access Level: Protects the object at the current access level and allows only
access levels 0-100 to customize the object.

l e
• Both: Only the access level at which the object is protected can update the object.
c
r a
• Only access level 100 can update the object.

O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 13
- If the Allow Modifications of Customized Objects check box is selected, access
levels 0-99 (as represented by green crosshatches in the indicator bar) can update
customized objects.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 14
Unsupported Customizations

m y
d e
ca
Unsupported Customizations
e A
c l
Oracle does not support the following types of customizations:

r a
• Oracle does not support customizations that are explicitly documented as being
unsupported in the seeded workflow’s product-specific user’s guide or documentation
O ly
update notes. These customizations include modifying processes, attributes, function

l & On
activities, event activities, notifications, lookup types, messages, events, or subscriptions
that are specifically documented as not to be modified.
a e
• Oracle does not support manual modifications of Workflow tables with a prefix of WF_ or
n
t e r
FND_ , unless these modifications are documented in the Oracle Workflow guides or
s
required by Oracle Support Services.
U
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 15
Workflow Definitions Loader

m y
d e
ca
Workflow Definitions Loader
e A
c l
You can run the Workflow Definitions Loader in the following modes:

r a
• Upgrade: Upgrade to a definition in an input file, preserving customizations and using the
access level in the input file. This mode is recommended.
O ly
• Upload: Upload the definition from an input file, ignoring preserve customizations

l & On
settings and using the access level in the input file.
• Force: Force the upload of a definition from an input file to a database regardless of an
object's protection level.
n a e
t e r U s
• Download: Download specified item type definitions from the database to an output file.
Oracle E-Business Suite customers should always operate the Oracle Workflow Builder and

I n
Workflow Definitions Loader at an access level of 100.

c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 16
Preserving Customizations

m y
d e
ca
Preserving Customizations
e A
c l
During an Oracle Workflow seed data upgrade, the Workflow Definitions Loader is always run

r a
in Upgrade mode at an access level less than 100. As a result, the upgrade will not overwrite
any object with a customization level of 100 or higher.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 17
Summary

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Customizing Workflow Processes


Chapter 24 - Page 18
Workflow Loaders
Chapter 25

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 2
Workflow Loaders

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 3
Objectives

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 4
Workflow Definitions Loader

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 5
Workflow Definitions Loader

m y
d e
ca
Workflow Definitions Loader
e A
Specify one of the following modes:
c l
r a
• Upgrade: Upgrade to a definition in an input file, preserving customizations, using the
access level in the input file. This mode is recommended.
O ly
• Upload: Upload the definition from an input file, ignoring preserve customizations

l & On
settings and using the access level in the input file. This mode is useful to someone who is
developing a workflow process on a test system. It enables the developer to save
a e
definitions to the database without concern that accidental customizations to existing
n
t e r
objects might prevent the upload of some process definition elements.

U s
• Force: Force the upload of a definition from an input file to a database regardless of an

I n
object's protection level. This mode is useful for fixing data integrity problems in a
database with a known, reliable file backup.

l e
• Download: Download the specified item type definition from the database to an output

c
file.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 6
Workflow XML Loader

m y
d e
ca
Workflow XML Loader
e A
c l
When you download Business Event System object definitions from a database, Oracle

r a
Workflow saves the definitions as an XML file.
When you upload object definitions to a database, Oracle Workflow loads the definitions from
O ly
the source XML file into the Business Event System tables in the database, creating new

& On
definitions or updating existing definitions as necessary.

l
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 7
Workflow XML Loader

m y
d e
ca
Workflow XML Loader
e A
c l
To run the Workflow XML Loader, you must have Java Development Kit (JDK) Version 5.0
installed.
r a
For detailed information on the commands to run the Workflow XML Loader, see Oracle
O ly
Workflow Administrator’s Guide, “Setting Up Oracle Workflow.”

l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 8
Workflow XML Loader

m y
d e
ca
Workflow XML Loader
e A
c l
You can download Business Event System object definitions in either normal download mode
or exact download mode:
r a
• Normal download mode: Saves a generic copy of object definitions from one system that
O ly
you can use to create similar definitions in other systems. In normal download mode, the

l & On
Workflow XML Loader replaces certain system-specific data within the object definitions
with tokens. Select normal download mode, for example, when you want to save Business
a e
Event System object definitions from a development system as seed data that you can
n
e r
upload to a production system.
s
• Exact download mode: Saves object definitions exactly as they are specified in the
t U
database. In exact download mode, the Workflow XML Loader does not convert any data

I n
to tokens; instead, all values, including system-specific values, are copied to the XML file.

e
Select exact download mode, for example, when you want to save Business Event System
l
object definitions from one production system so that you can replicate them to another
c
production system that communicates with the first.

r a
You can upload Business Event System object definitions in either normal upload mode or

O force upload mode:

Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 9
• Normal upload mode: Loads the object definitions from the source XML file into the
Business Event System tables in the database, but does not update any event or
subscription definition with a customization level of User. Oracle Workflow uses this
mode to preserve your customizations during upgrades.
• Force upload mode: Loads the object definitions from the source XML file into the
Business Event System tables in the database and overwrites any existing definitions, even
for events or subscriptions with a customization level of User. Use this mode when you
want to update the definitions for your own custom events and subscriptions.
Note: To report more extensive debugging information in the program output, you can run the
Workflow XML Loader in debug mode by including the DebugMode argument just before
the -d, -de, -u, or -uf option.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 10
Summary

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 11
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Workflow Loaders
Chapter 25 - Page 12
Specialized Workflow
Monitoring
Chapter 26

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 2
Specialized Workflow Monitoring

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 3
Objectives

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 4
Assigning Specialized Workflow Monitoring Privileges

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 5
Assigning Specialized Workflow Monitoring Privileges

m y
d e
ca
e
Assigning Specialized Workflow Monitoring Privileges
A
c l
Users cannot perform any actions on workflows that they own themselves, irrespective of any

r a
permissions granted to them. Only users with full workflow administrator privileges assigned
in the Workflow Configuration page can perform administrative actions on workflows that
they own themselves.
O ly
l & On
If a user has full workflow administrator privileges assigned on the Workflow Configuration
page, then those privileges override any specialized workflow monitoring privileges assigned

n a e
to that user. That is, a user with full workflow administrator privileges can access all
workflows, irrespective of any restrictions defined for any specialized privileges.

t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 6
Granting Restricted Access to Workflow Monitoring Data

m y
d e
ca
e
Granting Restricted Access to Workflow Monitoring Data
A
c l
Grants based on functional criteria depend on item attribute values. Consequently, these grants

attributes. r a
are most effective when combined with grants for item types that share the same item

O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 7
Granting Restricted Access Based on Item Types

m y
d e
ca
Granting Restricted Access Based on Item Types
e A
c l
The following excerpt shows a sample predicate for an instance set on the object
WORKFLOW_ITEMS.
r a
O ly
&TABLE_ALIAS.ITEM_TYPE = &GRANT_ALIAS.PARAMETER1
To create a grant, first specify appropriate security context information such as grantee and

• Object: WORKFLOW_ITEMS l & On


responsibility. Then specify the following data context information:

n a e
• Data Context Type: Instance Set

t e r U s
• Instance Set: The instance set that you created on WORKFLOW_ITEMS
• PARAMETER1: The internal name of the item type to which you want to grant access

I n
• Permission Set: Business workflow item permission set

c l e
For more information about creating instance sets and grants, see: Defining Data Security
Policies, Oracle Applications System Administrator's Guide - Security and Assigning

a
Permissions to Roles, Oracle Applications System Administrator's Guide - Security.
r
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 8
Granting Restricted Access Based on Functional Criteria

m y
d e
ca
e
Granting Restricted Access Based on Functional Criteria
A
c l
The following excerpt shows a sample predicate for an instance set on the object

CURRENT_PERSON_ID item attribute. r a


WORKFLOW_ITEM_ATTR_VALUES, defining criteria for HR data using the

&TABLE_ALIAS.NAME='CURRENT_PERSON_ID'
O ly
& On
and EXISTS (SELECT 'Y' FROM per_people_f
l
n a e
WHERE person_id = &TABLE_ALIAS.TEXT_VALUE
AND TRUNC (SYSDATE) BETWEEN effective_start_date AND
effective_end_date)

t e r U s
As another example, if the workflows for a particular organization are marked with an item

I n
attribute named ORG_ID, the following excerpt shows a sample predicate that allows access
only to workflows associated with the user's current organization context.

c l e
&TABLE_ALIAS.NAME = 'ORG_ID'

r a
and &TABLE_ALIAS.TEXT_VALUE = substr
(sys_context('USERENV','CLIENT_INFO'),1,10)

O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 9
To create a grant, first specify appropriate security context information such as grantee and
responsibility. Then specify the following data context information:
• Object: WORKFLOW_ITEM_ATTR_VALUES
• Data Context Type: Instance Set
• Instance Set: The instance set that you created on WORKFLOW_ITEM_ATTR_VALUES
• Permission Set: Business workflow item attribute permission set

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 10
Granting Permissions for Administrative Actions

m y
d e
ca
Granting Permissions for Administrative Actions
e A
c l
You can grant a user the following permissions for administrative actions in the Status
Monitor.
• Skip Workflow Activity (WF_SKIP) r a
• Retry Activity (WF_RETRY) O ly
• Rewind Workflow (WF_REWIND)
l & On
n
• Cancel Workflow (WF_CANCEL) a e
• Suspend Workflow (WF_SUSPEND)

e r s
• Update Workflow Item Attributes (WF_UPDATE_ATTR)
t
• Monitor Data (WF_MON_DATA) U
I n
See: Assigning Permissions to Roles, Oracle Applications System Administrator's Guide -
Security.

c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 11
Guided Demonstration - Setting Up Specialized Workflow
Monitoring
Granting Restricted Access to Workflow Monitoring Data

1. Use a Web browser to connect to the Functional Developer responsibility.

2. Enter Workflow Items in the Name field and click Go.

3. Click the Workflow Items name link to access the Workflow Items Object page.

4. Click Create Instance Set in the Object Instance Sets tab.

5. Enter the following values for the instance set:


− Name: Workflow Vacation Instance Set
− Code: WFVACSET
− Description: Object Instance Set for Workflow Vacation
− Predicate: &TABLE_ALIAS.ITEM_TYPE = &GRANT_ALIAS.PARAMETER1

• Click Apply.

6. Select the Grants tab and click Update.

m y
7. Select Create Grant in the Grants tab to access the Define Grant page.

d e
8. Enter the following values to create a grant:
− Name: Workflow Vacation Grant
ca
− Description: Grant Workflow Vacation Instance Set
− Grantee Type: Specific User
e A
c l
− Grantee: Douglas, Carl (email: cdouglas@vision.com)

r a
− Responsibility: Workflow Administrator Web Applications responsibility
− Data Security Object: WORKFLOW_ITEMS

• Click Next O ly
l & On
− Data Context Type: Instance Set

a e
− Instance Set: Workflow Vacation Instance Set

n
• Click Next

t e r
− PARAMETER1: WFVACXX
U s
I n
− Permission Set: Business workflow item permission set (Code:
WF_ADMIN_ITEM_PSET)


c l e
Click Next to review your grant and then click Finish.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 12
Assigning Privileges for Administrative Actions in the Status Monitor

9. Use a Web browser to connect to the User Management responsibility.

10. Click the Users link to access the User Maintenance page.

11. Search for the user Carl Douglas with the email address cdouglas@vision.com and click Go.

12. Click the Update icon for Carl Douglas to access the Update User page.

13. Select Assign Roles.

14. Select Code in the Search By field and enter WF_ADMIN_ROLE as the code to search by.

15. Select Workflow Admin Role from the search results and click Select to return to the Update
User page.

16. Enter “Assign workflow admin role with privileges for all administrative actions within the
Status Monitor to specialized workflow administrator” as the justification.

17. Click Save.

Associating the Workflow Administrator Web Applications Responsibility with a


User

m y
18. Use a Web browser to connect to the System Administrator responsibility.

d e
19. Select Security: User > Define to open the Users window.

ca
the user name CDOUGLAS and then execute the query by selecting View > Query by
e A
20. Query CDOUGLAS as the user name by selecting View > Query by Example > Enter. Enter

l
Example > Run to display the user details.

c
Web Applications responsibility. r a
21. Click the New record icon from the application toolbar to add the Workflow Administrator

O ly
22. Save your record and close the Users window.

l & On
Launching the Vacation Proposal Workflow

n a e
t e r s
23. Use a Web browser to connect to a Workflow administrator responsibility. Log in as a user
with workflow administrator privileges.
U
I n
24. Use the Developer Studio to launch the Vacation Proposal workflow process that you loaded

c l e
in the Loading and Running a Workflow Process demonstration.

Note: Do not log in as an approver to approve the vacation proposal, but leave the

r a notification open, so that the workflow process will remain active and you can verify the
CDOUGLAS user’s privileges to perform administrative actions in the Status Monitor. After
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 13
a workflow process is completed, you can no longer perform administrative actions for that
process in the Status Monitor, even if you have privileges to perform such actions.

Verifying Specialized Workflow Monitoring Privileges

25. Log off and log in as the user CDOUGLAS.

26. Use a Web browser to connect to the Workflow Administrator Web Applications
responsibility.

27. Use the Status Monitor Web pages to review the status of the Vacation Proposal process that
you launched. The overall process status should still be Active.

28. Click the Action History button and verify that the following administrative action buttons
are available in the Action History page:

• Retry

• Skip

• Update Attributes

• Rewind

• Suspend Workflow
m y
• Cancel Workflow
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 14
Summary

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 15
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Specialized Workflow Monitoring


Chapter 26 - Page 16
Setting Up Oracle Workflow
Chapter 27

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 2
Setting Up Oracle Workflow

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 3
Objectives

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 4
Required Setup Steps

m y
d e
ca
Required Setup Steps
e A
c l
1. Set system-wide preferences and default user preferences for your installation of Oracle

r a
Workflow using the Workflow Configuration page.
2. Ensure that a directory service is set up to provide information about the individuals and
O ly
roles in your organization who may utilize Oracle Workflow functionality and receive
workflow notifications.

l & On
3. Set up background Workflow engines to manage the load on the primary Workflow
a e
Engine by processing deferred and timed out activities and stuck processes.
n
t e r U s
4. Configure the Business Event System for event communication.
For more information, refer to the “Setting Up Oracle Workflow” chapter in the Oracle

n
Workflow Administrator’s Guide.
I
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 5
Step 1 Setting Global Workflow Preferences

m y
d e
ca
Setting Global Workflow Preferences
e A
c l
Use a Web browser to navigate to the Workflow Configuration page, using a responsibility and

seeded Workflow responsibilities are: r a


navigation path specified by your system administrator. Some possible navigation paths in the

O ly
• Workflow Administrator Web Applications: Administration > Workflow Preferences

l & On
• Workflow Administrator Web (New): Administration > Workflow Preferences
• Workflow Administrator Event Manager: Administration > Workflow Preferences

n a e
You can also navigate to the Workflow Configuration page from other Oracle Workflow

t e
link at the end of the page.
r U s
administrator Web pages by choosing the Administration tab or selecting the Administration

I n
You must have workflow administrator privileges to set global workflow preferences on the
Workflow Configuration page. If you do not have administrator privileges, you can view

l e
global workflow preferences, but you cannot modify them.
c
Workflow System Administrator

r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 6
Select the role to which you want to assign workflow administrator privileges. If you want all
users and roles to have workflow administrator privileges, such as in a development
environment, enter an asterisk (*).
LDAP
If you are integrating with Oracle Internet Directory, specify the Lightweight Directory Access
Protocol (LDAP) server information for the LDAP directory to which you will connect. If you
already configured these parameters while installing Oracle Application Server with Oracle E-
Business Suite, Oracle Workflow displays those values here. For more information, see:
Installing Oracle Application Server 10g with Oracle E-Business Suite Release 12
(OracleMetaLink note 376811.1) and Oracle Single Sign-On Integration, Oracle Applications
System Administrator's Guide - Security.
• Host: The host on which the LDAP directory resides.
• Port: The port on the host.
• Username: The LDAP user account used to connect to the LDAP server. This user name
must have write privileges and is required to bind to the LDAP directory.
• Old Password: Enter your current LDAP password. Oracle Workflow validates this
password before letting you change it.
• New Password: Enter the new LDAP password you want to use. The password must be at
least five characters long.
• Repeat Password: Enter your new LDAP password again in this field to confirm it.
• Change Log Base Directory: The LDAP node under which change logs are located.
• User Base Directory: The LDAP node under which user records can be found.
m y
Business Event Local System
d e
ca
Specify the system name for the database where this installation of Oracle Workflow is
located, to identify it in the Business Event System. Oracle Workflow automatically creates the
system definition for this database in the Event Manager during installation.

e
Select the execution status for the local system. A
c l
• Enabled: Subscriptions are executed on all events. Oracle Workflow sets the system status
to Enabled by default.
r a
• Local Only: Subscriptions are executed only on events raised on the local system.
O ly
• External Only: Subscriptions are executed only on events received by inbound agents on
the local system.

l & On
• Disabled: No subscriptions are executed on any events.
Notification Style
n a e
t e r U s
Specify whether Oracle Workflow should send e-mail notifications to users, and if so, in what
format. A user can override this default setting by specifying a different notification style in his

I n
or her individual Oracle E–Business Suite preferences.
• HTML mail with attachments

l e
• Plain text mail with HTML attachments
c
r a• Plain text mail
• Plain text summary mail

O • Do not send me mail

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 7
• HTML mail
• HTML summary mail
Browser Signing DLL Location
Specify the location of the Capicom.dll file that is used for Web page operations with
encryption in the Microsoft Internet Explorer browser. This preference is required only if you
plan to use certificate-based digital signatures to confirm notification responses, and your users
access Oracle Applications with Microsoft Internet Explorer. By default, this preference is set
to a URL at which the Capicom.dll file can be downloaded from Microsoft’s Web site. In most
cases, you do not need to change this setting. However, you can update this preference if the
location of the Capicom.dll file changes, or if you choose to store a copy of the file on your
local network and point to that location instead.
JInitiator
Review details about the JInitiator plugin in your Oracle E-Business Suite installation. Oracle
Workflow uses JInitiator to launch Oracle Applications forms linked to notifications.
• Class ID: The class identifier for this version of JInitiator.
• Download Location: The location where the JInitiator executable is staged for download
to users’ client machines.
• Version: The JInitiator version number.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 8
Step 2 Setting Up an Oracle Workflow Directory Service

m y
d e
ca
Setting Up an Oracle Workflow Directory Service
e A
c l
In the predefined directory service implementation, Oracle Workflow automatically creates

r a
directory service views to integrate with the appropriate source tables.
You can also create your own directory service by defining custom views with the required
O ly
columns. However, note that only the predefined directory service provided by Oracle
Workflow is supported by Oracle.

l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 9
Step 2 Setting Up an Oracle Workflow Directory Service

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 10
Step 2 Setting Up an Oracle Workflow Directory Service

m y
d e
ca
Setting Up an Oracle Workflow Directory Service
e A
c l
You only need to run the bulk synchronization program for products that are not successfully
performing incremental synchronization.
r a
The Synchronize Workflow LOCAL Tables request set contains ten instances of the
O ly
Synchronize WF Local Tables program, one for each originating system. You can use this

l & On
request set to submit requests for all the originating systems at once.
Use the Submit Requests form to submit the request set or concurrent program. Enter the
following parameters:
n a e
t e r U s
• Orig System (single concurrent program only): Select the name of the originating system
whose user and role information you want to synchronize with the WF_LOCAL tables.

I n
• Parallel Processes: Enter the number of parallel processes to run. The default value for this
parameter is 1. However, if your hardware resources allow, you can optionally set this

l e
parameter to a higher value in order to parallelize the queries during execution of the

c
program.

r a
• Logging: Select the logging mode you want. This mode determines whether redo log data
is generated for database operations performed by the bulk synchronization process. The
O default value for this parameter is LOGGING, which generates redo log data normally.

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 11
You can optionally set the logging mode to NOLOGGING to suppress redo log data,
obtaining a performance gain. Without this redo log data, however, no media recovery is
possible for the Workflow directory tables and indexes.
• Temporary Tablespace: Select the temporary tablespace the program should use.
• Raise Errors: Select Yes or No to indicate whether the program should raise an exception
if it encounters an error. Usually you can leave this parameter set to the default value,
which is Yes.
Note: Products that use role hierarchies do not participate in bulk synchronization. These
products must perform incremental synchronization.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 12
Step 3 Running Background Engines

m y
d e
ca
Running Background Engines
e A
c l
Ensure that you have at least one background engine that can check for timed out activities,

r a
one that can process deferred activities, and one that can handle stuck processes. At a
minimum, you need to set up one background engine that can handle all three types of issues.
O ly
However, for performance reasons we recommend that you run three separate background
engines at different intervals.

l & On
• Run a background engine to handle only deferred activities every 5 to 60 minutes.
a e
• Run a background engine to handle only timed out activities every 1 to 24 hours as
n
needed.

t e r U s
• Run a background engine to handle only stuck processes once a week to once a month,

n
when the load on the system is low.
I
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 13
Step 3 Running Background Engines

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 14
Step 3 Running Background Engines

m y
d e
ca
Running Background Engines
e A
The Background Engine API parameters are:
c l
r a
• itemtype: Optional item type to restrict this engine to activities associated with that item
type.
O ly
• minthreshold: Optional minimum cost that an activity must have for this background

l & On
engine to execute it, in hundredths of a second.
• maxthreshold: Optional maximum cost an activity can have for this background engine to
a e
execute it, in hundredths of a second.
n
t e
for deferred activities.
r U s
• process_deferred: Specify TRUE or FALSE to indicate whether the engine should check

I n
• process_timeout: Specify TRUE or FALSE to indicate whether the engine should check
for timed out activities.

l e
• process_stuck: Specify TRUE or FALSE to indicate whether the engine should check for
c
stuck processes.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 15
Step 4 Configuring the Business Event System

m y
d e
ca
Configuring the Business Event System
e A
c
You can also optionally perform these steps:l
r a
• To enhance performance, you can change the maximum cache size used in Business Event
System subscription processing and enable static function calls for custom PL/SQL
functions. O ly
l & On
• If you want to invoke business process execution language (BPEL) processes through
event subscriptions, you can optionally specify the BPEL server.

n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 16
Step 4 Event Message Communication

m y
d e
ca
Event Message Communication
e A
c l
To send an event message, Oracle Workflow places the event message on a local outbound

designated inbound agent’s queue. r a


agent’s queue. You must schedule propagation to deliver the message from there to the

O ly
To receive an event message in Oracle Workflow, you must run an agent listener to dequeue

l & On
the message from the inbound agent’s queue for Oracle Workflow to process. A component of
the Event Manager called the Event Dispatcher then searches for and executes subscriptions to
the event.
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 17
Step 4 Setting Up Database Links and Queues

m y
d e
ca
Setting Up Database Links and Queues
e A
Database Links
c l
r a
When you set up database links for use by the Business Event System, you should fully qualify
each database link name with the domain name.
Queues O ly
l & On
In addition to the standard queues provide by Oracle Workflow, you can also set up your own
queues for event message propagation. To set up a queue, you must create the queue table,
a e
create the queue, and start the queue.
n
t e r U s
Oracle Workflow provides a sample script called wfevquc2.sql, which you can modify to set
up your queues, as well as a sample script called wfevqued.sql, which you can modify to drop

I n
queues. These scripts are located on your server in the $FND_TOP/sql directory.
If you define a queue with a payload type other than the standard WF_EVENT_T Workflow

l e
format or the JMS Text message format, you must create a queue handler to translate between
c
the standard Workflow format and the format required by the queue.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 18
Step 4 Checking Database Parameters

m y
d e
ca
Checking Database Parameters
e A
c l
The JOB_QUEUE_PROCESSES parameter defines the number of SNP job queue processes

r a
for your instance. You must start at least one job queue process to enable message propagation.
The minimum recommended number of processes for Oracle Workflow is ten.
O ly
You can either modify the parameter in the init.ora file and restart the database, or you can use

instance.
l & On
the ALTER SYSTEM statement to dynamically modify the parameter for the duration of the

a e
Note: If you want to review more detailed information about Oracle Advanced Queuing
n
e r
processing, you can optionally use another initialization parameter, EVENT, for detailed
s
database level tracing of issues related to Oracle Advanced Queuing. Add the following line to
your init.ora file: t U
I n
event = "24040 trace name context forever, level 10"

l e
Then restart your database to make this change effective. Be aware that using this parameter

c
may generate large trace files.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 19
Step 4 Scheduling Agent Listeners

m y
d e
ca
Scheduling Agent Listeners
e A
c l
The Generic Service Component Framework is a facility that helps to simplify and automate

r a
the management of background Java services.
Agent listener service components, managed through Oracle Workflow Manager, are the most
O ly
automated and robust way to run agent listeners. However, Oracle Workflow also provides an

l & On
administrative script named wfagtlst.sql that you can use to run an agent listener, or you can
run the WF_EVENT.Listen API directly in SQL*Plus. These methods are intended primarily
a e
for testing and debugging purposes.
n
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 20
Step 4 Scheduling Agent Listeners

m y
d e
ca
Scheduling Agent Listeners
e A
Seeded PL/SQL agent listeners:
c l
r a
• Workflow Deferred Agent Listener: Handles messages on WF_DEFERRED to support
deferred subscription processing.
O ly
• Workflow Deferred Notification Agent Listener: Handles notification messages on

l & On
WF_DEFERRED to support outbound notification processing.
• Workflow Error Agent Listener: Handles messages on WF_ERROR to support error
a e
handling for the Business Event System.
n
t e r U s
• Workflow Inbound Notifications Agent Listener: Handles messages on
WF_NOTIFICATION_IN to support inbound e-mail notification processing.

I n
Seeded Java agent listeners:
• Workflow Java Deferred Agent Listener: Handles messages on WF_JAVA_DEFERRED
l e
to support deferred subscription processing in the middle tier.
c
r a
• Workflow Java Error Agent Listener: Handles messages on WF_JAVA_ERROR to
support error handling for the Business Event System in the middle tier.

O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 21
Oracle XML Gateway also provides PL/SQL agent listeners named ECX Inbound Agent
Listener and ECX Transaction Agent Listener, and a Java agent listener named Web Services
IN Agent. See: Oracle XML Gateway User's Guide.
You can optionally create additional agent listener service components. For example, you can
configure agent listeners for other inbound agents that you want to use for event message
propagation, such as the standard WF_IN and WF_JMS_IN agents, or any custom agents. You
can also configure an agent listener service component that only processes messages on a
particular agent that are instances of a specific event.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 22
Step 4 Scheduling Propagation

m y
d e
ca
Scheduling Propagation
e A
c l
If you want to use the standard WF_OUT and WF_JMS_OUT agents or custom agents for

a
event message propagation, ensure that you schedule propagation for those agents.
r
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 23
Step 4 Scheduling Propagation

m y
d e
ca
Scheduling Propagation
e A
c l
For information about using Oracle Enterprise Manager to schedule Oracle Advanced Queuing

r a
propagation, refer to Oracle Enterprise Manager Support, Oracle Streams Advanced Queuing
User's Guide and Reference and the Oracle Enterprise Manager online help.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 24
Step 4 Scheduling Propagation

m y
d e
ca
Scheduling Propagation
e A
c
The Schedule_Propagation API parameters are:l
r a
• queue_name: The queue associated with the local outbound agent for which you want to
schedule propagation. Specify the queue name prefaced by the schema that owns the
O ly
queue, in the following format: <schema>.<queue>

l & On
The standard Workflow queues are usually owned by the APPLSYS schema.
• destination: The database link to the remote system to which you want to propagate

n a e
messages. To propagate messages to another queue on the local system, enter the

t e r U s
destination NULL. The default value is NULL.
• start_time: The initial start time for the propagation window.

I n
• duration: The duration of the propagation window, in seconds
• next_time: A date function to compute the start of the next propagation window from the
l e
end of the current window. For example, to start the window at the same time every day,
c
next_time should be specified as 'SYSDATE + 1 - duration/86400'. If this value is NULL,

r a then propagation is stopped at the end of the current window and is not run repeatedly.

O The default value is NULL.

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 25
• latency: A latency time in seconds to specify how long you want to wait, after all
messages have been propagated, before rechecking the queue for new messages to the
destination. The latency represents the maximum wait time during the propagation
window for a message to be propagated after it is enqueued. To propagate messages as
soon as possible after they are enqueued, enter a latency of zero. The default latency is 60
seconds.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 26
Guided Demonstration - Scheduling Agent Listeners and
Propagation
1. Log on to a Workflow administrator responsibility with Event Manager functionality. Log in
as a user with workflow administrator privileges.

2. Click the Administration link, and ensure that the Business Event Local System: Status is set
to Enabled on the Workflow Configuration page.

3. Ensure that the job_queue_processes database parameter is set to 10 or higher.

• You can use the Oracle Workflow Manager component of Oracle Applications Manager
to check the database parameters required for propagation.

• Connect to a Workflow administrator responsibility as a user with workflow


administrator privileges, and click the Workflow Manager link.

• Review the information in the Related Database Parameters region of the Workflow
System page.

• You can also use the following command to check the parameter value in SQL*Plus:

select name, value from v$parameter


m y
where name=’job_queue_processes’;

d e

ca
If necessary, you can increase the job_queue_processes value dynamically, without
needing to restart the database. Connect to SQL*Plus as the SYS user and execute the
following commands:

e A
c l
alter system set job_queue_processes = 10;

exit
r a
• O ly
Note that this setting is necessary because propagation schedules are handled by job

l & On
queue processes. If no job queue processes are available in the database because they are
all being used for other types of jobs, then the propagation will not take place. So the

n a e
job_queue_processes parameter needs to be set sufficiently high to ensure that a process
will be available to handle propagation.

4.
t e r U s
Schedule propagation to run once a minute for the local WF_JMS_OUT agent and the Local

I n
destination. Connect to SQL*Plus and execute the following command:

l e
Exec DBMS_AQADM.Schedule_Propagation(‘APPLSYS.WF_JMS_OUT’,

c
NULL, SYSDATE, 30, ‘SYSDATE + 1/1440’, NULL);

r
5. a Run an agent listener for the local WF_JMS_IN agent.

O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 27
• You can use the Oracle Workflow Manager component of Oracle Applications Manager
to configure and run an agent listener service component for WF_JMS_IN.

• Connect to a Workflow administrator responsibility as a user with workflow


administrator privileges, and click the Workflow Manager link.

• Click the Agent Listeners status icon on the Workflow System page.

• Click the Create button.

• Select Workflow Agent Listener and click Continue.

• Enter “WF Inbound JMS Listener” in the Name field, select Automatic in the Startup
Mode field, and select WF_JMS_IN in the Inbound Agent field. Then click Next.

• Select the Workflow Agent Listener Service in the Container field and click Next.

• Click Next.

• Click Finish.

• The container should automatically start the agent listener within a few minutes.

Components page. The agent listener should now run repeatedly.


m y
Check back until the status of the agent listener appears as Running on the Service

• You can also use the WF_EVENT.Listen API to run an agent listener manually from
d e
following command:
ca
SQL*Plus. Connect to SQL*Plus as the APPS user for Oracle Applications, and use the

exec WF_EVENT.Listen(‘WF_JMS_IN’);
e A
c l
In this case, note that running the API once means running the listener only once. The

r a
listener will dequeue all messages currently enqueued on the agent's queue and then
exit. To automatically resubmit the listener, configure an agent listener service
component.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 28
Step 4 Synchronizing License Statuses

m y
d e
ca
Synchronizing License Statuses
e A
c l
You can use the License Manager utility to review which products you currently have licensed.

r a
See: License Manager, Oracle Applications System Administrator’s Guide - Maintenance.
Use the Submit Requests form to submit the Synchronize Product License and Workflow BES
O ly
License concurrent program (FNDWFLIC). This program does not require any parameters.

l & On
If you upgrade from an Oracle E-Business Suite release earlier than Release 11.5.9, you should
run the Synchronize Product License and Workflow BES License concurrent program once
a e
after the upgrade to update the license status of the existing events and subscriptions in your
n
e r
Event Manager. Otherwise, subscriptions may not be correctly processed after the upgrade.
s
Subsequently, when you license a product, Oracle Workflow automatically updates the license
t U
status for all the events and subscriptions owned by that product.

I n
Note: Any events and subscriptions that you define with a customization level of User are

c l e
always treated as being licensed.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 29
Step 4 Cleaning Up the WF_CONTROL Queue

m y
d e
ca
Cleaning Up the WF_CONTROL Queue
e A
c l
The WF_CONTROL agent is used for internal processing only. You should not place custom

r a
event messages on this queue.You do not need to schedule propagation for the
WF_CONTROL agent, because the middle tier processes that use WF_CONTROL dequeue
O ly
messages directly from its queue. However, this queue should be cleaned up periodically.

l & On
When a middle tier process for Oracle E-Business Suite starts up, it creates a JMS subscriber to
the WF_CONTROL queue. If a middle tier process dies, however, the corresponding

n a e
subscriber remains in the database. For more efficient processing, you should ensure that
WF_CONTROL is periodically cleaned up by removing the subscribers for any middle tier

e r s
processes that are no longer active. The recommended frequency for performing cleanup is
every 12 hours.
t U
I n
Use Oracle Workflow Manager to manage the Workflow Control Queue Cleanup

e
(FNDWFBES_CONTROL_QUEUE_CLEANUP) concurrent program, which uses the
l
WF_BES_CLEANUP.Cleanup_Subscribers() API to perform the necessary cleanup. This
c
concurrent program is scheduled to run every 12 hours by default. The program does not

r a
require any parameters.

O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 30
Step 4 Tuning Performance

m y
d e
ca
Tuning Performance
e A
c l
Changing the Maximum Cache Size for the Business Event System

r a
The Business Event System caches event, subscription, and agent definitions to enhance
performance during subscription processing. The default maximum size of the cache is 50
O ly
records. You can optionally increase the maximum cache size to reduce the database queries

l
amount of memory used by the cache.& On
performed by the Business Event System, or decrease the maximum cache size to reduce the

a e
The maximum cache size is determined by the value for the WFBES_MAX_CACHE_SIZE
n
e r
resource token. To change this value, you must first create a .msg source file specifying the
s
new size as the value for the WFBES_MAX_CACHE_SIZE resource token. Then use the
t U
Workflow Resource Generator program to upload the new seed data from the source file to the

I n
database table WF_RESOURCES. See: To Run the Workflow Resource Generator, Oracle

c l e
Workflow API Reference.
Enabling Static Function Calls for Custom PL/SQL Functions

r a
If you use custom PL/SQL functions within the Business Event System, including event data
generate functions, event subscription rule functions, and queue handler enqueue and dequeue
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 31
APIs, Oracle Workflow calls those functions using dynamic SQL by default. However, you
can enable Oracle Workflow to call your custom functions statically to enhance performance.
Oracle Workflow provides two PL/SQL packages with procedures that contain lists of static
function calls. The Business Event System internally calls these procedures during subscription
processing to check whether static function calls are available for the procedures being
executed.
• WF_BES_DYN_FUNCS package - Contains static function calls for generate functions
and rule functions.
• WF_AGT_DYN_FUNCS package - Contains static function calls for queue handler
enqueue and dequeue APIs.
The initial seeded versions of these packages include static function calls only for seeded Oracle
Workflow functions, such as the rule function WF_RULE.Default_Rule and the queue handler
APIs WF_EVENT_QH.Enqueue and WF_EVENT_QH.Dequeue. You can use the
wfbesfngen.sql script to add functions from other Oracle Applications products or your own
custom functions to these packages.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 32
Step 4 Specifying the BPEL Server

m y
d e
ca
Specifying the BPEL Server
e A
c l
The WF: BPEL Server profile option lets you quickly change the BPEL server setup for all

r a
subscriptions that invoke BPEL processes, such as if you move these subscription definitions
from a test instance to a production instance. See: Invoking a Web Service, Oracle Workflow
Developer's Guide.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 33
Optional Setup Steps

m y
d e
ca
Optional Setup Steps
e A
c l
1. Partition certain Workflow tables for performance gain.

r a
2. Set up additional languages if you want to use Oracle Workflow in languages other than
English.
O ly
3. Set up one or more notification mailers if you want to allow your users to receive
notifications by e-mail.
l & On
4. Customize the templates for your e-mail notifications.

n a e
5. Give users access to the Advanced Worklist, Personal Worklist, and and Notifications

t e r U s
administrator search Web pages from any responsibility you choose.
6. Use the WF: Notification Reassign Mode profile option to control which reassign modes

I n
are available to users from the Notification Details page.
7. Control the item types for which users can define vacation rules and grant worklist
l e
access, using the WF: Vacation Rule Item Types lookup type and the WF: Vacation
c
Rules - Allow All profile option.

r a
8. Set up users to enable electronic signatures in notification responses.

O 9. Customize the company logo that appears in Oracle Workflow Web pages.

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 34
10. Include additional icons in your Oracle Workflow icons subdirectory to customize the
diagrammatic representation of your workflow processes.
For more information, refer to the “Setting Up Oracle Workflow” chapter in the Oracle
Workflow Administrator’s Guide.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 35
Optional Step 1 Partitioning Workflow Tables

m y
d e
ca
Partitioning Workflow Tables
e A
c l
The wfupartb.sql script partitions the following tables:
• WF_ITEM_ACTIVITY_STATUSES
r a
• WF_ITEM_ACTIVITY_STATUSES_H
• WF_ITEM_ATTRIBUTE_VALUES O ly
• WF_ITEMS
l & On
a e
The script recreates the following indexes:

n
t e r
• WF_ITEM_ACTIVITY_STATUSES_PK
• WF_ITEM_ACTIVITY_STATUSES_N1
U s
I n
• WF_ITEM_ACTIVITY_STATUSES_N2
• WF_ITEM_ACTIVITY_STATUSES_H_N1

l e
• WF_ITEM_ACTIVITY_STATUSES_H_N2
c
• WF_ITEM_ATTRIBUTE_VALUES_PK

r a
• WF_ITEMS_PK

O • WF_ITEMS_N1

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 36
• WF_ITEMS_N2
• WF_ITEMS_N3

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 37
Optional Step 2 Setting Up Additional Languages

m y
d e
ca
Setting Up Additional Languages
e A
c l
Note: You can display languages that require a multibyte character set only if your database

r a
uses a character set that supports these languages, such as UTF8.
Displaying Oracle Workflow Web Pages in Other Languages
O ly
You select and install additional languages as part of the Oracle E-Business Suite installation.

Homepage.
l & On
Users can set their language preference to an installed language through the Personal

a e
Creating and Viewing Workflow Definitions in Other Languages using Oracle Workflow
n
Builder

t e r U s
• Set the NLS_LANG environment variable for the new language, territory, and encoded

I n
character set that you want to use for the workflow definition. Specify the value for
NLS_LANG in the following format: LANGUAGE_TERRITORY.CHARSET Use the

l e
Registry Editor on your PC to set the NLS_LANG environment variable:

c
- Select Run from the Start menu on your PC.

r a - Enter the command to run the Registry Editor and click OK. The command depends
on your version of Windows; for example, it may be regedit or regedit32.
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 38
- Drill down to My Computer > HKEY_LOCAL_MACHINE > Software > Oracle, and
then to the Oracle home where the Workflow Builder is installed.
- Select the NLS_LANG variable and select Modify from the Edit menu.
- Enter the value you want and click OK.
- Exit the Registry Editor.
• Start Oracle Workflow Builder. Create a translated version of your workflow definition
and save it as a flat file (.wft), or open and view a workflow definition that is already
translated.
Loading Workflow Definitions in Other Languages to a Database
• Ensure that the language you want is set up in the database. You select and install
additional languages as part of the Oracle E-Business Suite installation.
• Before running the Workflow Definitions Loader program to load a translated workflow
definition to your database, you must set the NLS_LANG environment variable to the
appropriate territory and character set for the workflow definition you want to load. The
character set must match the character set encoding used to create the workflow definition
file, which is determined by the NLS_LANG value that was set on the client PC before the
.wft file was created in the Workflow Builder. To set NLS_LANG before running the
Workflow Definitions Loader, use the following format: _TERRITORY.CHARSET
Note that it is important to include the underscore (_) before the territory name and the
period (.) between the territory name and the character set name in the NLS_LANG value.
You do not need to include the language in this NLS_LANG value because the Workflow
Definitions Loader uses the language specified within the .wft file to determine the
m y
language to load.
• Before using the Workflow Builder to save a translated workflow definition to your
d e
ca
database, you must set the NLS_LANG environment variable to the appropriate language,
territory, and character set. If you are saving several workflow definitions in different
languages, you must reset NLS_LANG for each language.

e A
c l
Sending E-mail Notifications in Other Languages
• Determine whether Oracle has translated the e-mail notification templates to the language

r a
you want to set by checking for the file containing the templates in the appropriate
language subdirectory, $FND_TOP/import/<lang>. The standard templates are delivered
in a file called wfmail.wft.
O ly
l & On
• If the e-mail templates are available for the desired language, Oracle Workflow uses the
language preference for the notification recipient to determine the language for an e-mail
notification.
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 39
Optional Step 3 Implementing Notification Mailers

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 40
Optional Step 3 Implementing Notification Mailers

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 41
Optional Step 3 Implementing Notification Mailers

m y
d e
ca
Implementing Notification Mailers
e A
c l
Users can receive e-mail notifications using various e-mail clients, although notifications may

r a
be displayed differently in different clients, depending on the features each client supports.
Oracle Workflow fully supports Multipurpose Internet Mail Extensions (MIME) encoded
O ly
messages. This means that a notification mailer can exchange messages with workflow users

& On
containing languages with different character sets and multimedia encoded content.

l
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 42
Optional Step 4 Customizing Message Templates

m y
d e
ca
Customizing Message Templates
e A
c l
Message templates are defined in the System: Mailer item type, stored in a file named

r a
wfmail.wft. It is not recommended to modify the standard templates. However, you can choose
to use the alternative templates provided by Oracle Workflow instead of the default templates,
O ly
or you can also create your own custom templates in the System: Mailer item type. For more

Administrator’s Guide.
l & On
information, refer to the “Setting Up Oracle Workflow” chapter in the Oracle Workflow

a e
You can implement alternative standard or custom templates in the following ways:
n
e r
• Assign the templates that you want to a particular notification mailer service component in
s
the mailer configuration parameters. The templates assigned to a mailer override the
t U
default System: Mailer templates.

I n
• Assign the templates that you want to a particular notification in a workflow process by

c l e
defining special message attributes. In this case the templates assigned to the notification
override both the templates assigned to a mailer and the default System: Mailer templates.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 43
Optional Step 4 Customizing Message Templates

m y
d e
ca
Customizing Message Templates
e A
c l
The following standard message templates are used by default. An asterisk (*) marks the

r a
templates for which Oracle Workflow also provides an alternative version.
• * Open Mail (Templated): For notifications that require a response when you are using the
templated response method O ly
direct response method
l & On
• * Open Mail (Direct): For notifications that require a response when you are using the

a e
• * Open Mail (Outlook Express): For notifications that require a response, if you use an e-
n
t e r U s
mail application such as Microsoft Outlook Express as your e-mail client
• * Open FYI Mail: For notifications that do not require a response

I n
• View From UI: For response-required notifications whose content you do not want to send
in e-mail

l e
• View FYI From UI: For notifications that do not require a response, whose content you do
c
not want to send in e-mail

r a
• URL Attachment: Creates the Notification References attachment for HTML-formatted

O notification messages that include URL attributes with Attach Content checked

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 44
• * Canceled Mail: Informs the recipient that a notification is canceled
• * Invalid Mail: Informs the recipient that the response to the notification is invalid
• * Closed Mail: Informs the recipient that a previously sent notification is now closed
• Summary Mail (HTML): For notification summaries
• Warning Mail: Informs the recipient of unsolicited mail that he or she sent
• Signature Required Mail: For notifications that require an electronic signature in the user’s
response; users must respond to such notifications through the Notification Details Web
page rather than by e-mail
• Signature Warning Mail: Informs the recipient that an e-mail notification response was not
valid because the notification required an electronic signature to be entered through the
Notification Details Web page
• Secure Mail Content: For notifications that include sensitive content that cannot be sent in
e-mail for security reasons; users must view and respond to such notifications through the
Notification Details Web page rather than by e-mail
• * Open Mail (More Information Request): For requests for more information about a
notification from one user to another user
• More Information Request (Outlook Express): For requests for more information about a
notification from one user to another user, if you use an e-mail application such as
Microsoft Outlook Express as your e-mail client


Invalid Open Mail (More Information Request): Informs the recipient that the response to
a request for more information is invalid
User Notification Preference Update Report: Informs the administrator that an e-mail m y
e
notification could not be sent to one or more recipients, that the notification preference for
d
ca
those recipients has been set to DISABLED, and that those recipients' original notification
preferences, which are listed, should be reset after the issues that caused the failures are
corrected

e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 45
Optional Step 5 Adding Worklist Functions to User
Responsibilities

m y
d e
ca
e A
c l
Adding Worklist Functions to User Responsibilities

r a
Add the following functions to the responsibilities from which you want users to access the
corresponding pages:
• Advanced Worklist: WF_WORKLIST O ly
& On
• Personal Worklist: WF_WORKLIST_CUSTOM
l
n a e
• Notifications administrator search page: WF_WORKLIST_SEARCH
The Advanced Worklist is seeded on the menu for the Workflow User Web Applications

e r s
responsibility by default. You can also add its function to other responsibilities from which you
t U
want users to access notifications.

I n
The Personal Worklist is an optional feature that is not seeded on any Oracle E-Business Suite

l e
menu. If you want users to access this version of the Worklist, you must first add its function to
the menu for a responsibility assigned to those users.
c
r a
If you add the Personal Worklist, you can use worklist flexfields to define specialized worklist
views that display information specific to particular types of notifications. If you define a

O securing function for a view, add the securing function to the same menu as the Personal

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 46
Worklist function. Your specialized worklist view will appear in the list of views only when
users access the Personal Worklist from that responsibility.
The Notifications administrator search page is seeded on the menu for the Workflow
Administrator Web Applications responsibility by default. You can also add its function to
other responsibilities from which you want users to be able to search for notifications. For
example, if you want users with the Workflow User Web Applications responsibility to have
access to the Notifications administrator search page, you can add this function to the
FND_WFUSER (Workflow User) menu with a prompt such as Notification Search.
A user must have workflow administrator privileges to access other users' notifications on the
Notifications administrator search page. If a user does not have administrator privileges, that
user can only search for and access his or her own notifications.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 47
Optional Step 6 Setting the Notification Reassign Mode

m y
d e
ca
Setting the Notification Reassign Mode
e A
c l
The WF: Notification Reassign Mode profile option controls the reassign modes available to

Notification Details page. r a


users from the Advanced Worklist, the Personal Worklist, and the Response section of the

O ly
• Delegate: This mode lets users give another user authority to respond to a notification on

l & On
their behalf, while still retaining ownership of the notification themselves. For example, a
manager might delegate all vacation scheduling approvals to an assistant.
a e
• Transfer: This mode lets users give another user complete ownership of and responsibility
n
e r
for a notification. For example, users might select this option if they should not have
s
received a certain notification and they want to send it to the correct recipient or to another
t U
recipient for resolution. A transfer may have the effect of changing the approval hierarchy

I n
for the notification. For example, a manager might transfer a notification about a certain

c l e
project to another manager who now owns that project.
• Reassign: This setting provides users access to both the Delegate and Transfer reassign

r a modes. The Reassign setting is the default value for the WF: Notification Reassign Mode
profile option.

O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 48
Optional Step 7 Setting Up Notification Handling Options

m y
d e
ca
Setting Up Notification Handling Options
e A
c l
Adding Item Types for Vacation Rules and Worklist Access

r a
By default, the list of item types a user can select when creating a vacation rule or when
granting worklist access displays those item types for which the user has previously received at
O ly
least one notification. You can also choose to add item types that you want to appear in the lists

l & On
for all users. In this way you can allow users to create rules or grant worklist access to handle
any notifications they may receive from those item types in the future.
a e
To add an item type to the list, define the internal name of the item type as a lookup code for
n
t e r
the WF: Vacation Rule Item Types lookup type.

U s
• Navigate to the Application Object Library Lookups window in the Application Developer
responsibility.
I n
• Query the WF_RR_ITEM_TYPES lookup type with the meaning WF: Vacation Rule Item

l e
Types in the Application Object Library application.

c
• Define the item type you want as a new lookup code for this lookup type. Ensure that you

r a enter the item type internal name in the Code field exactly as the name is defined in your
database.
O Allowing Vacation Rules That Apply to All Item Types

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 49
Use the WF: Vacation Rules - Allow All profile option to determine whether the list of item
types for vacation rules includes the “All” option. The “All” option lets users create a generic
rule that applies to notifications associated with any item type.
• Enabled: The “All” option appears in the list of item types for vacation rules. This is the
default value.
• Disabled: Users must always specify the item type to which a vacation rule applies.
After changing the value of this profile option, you must stop and restart Oracle HTTP Server
for the change to take effect.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 50
Optional Step 8 Setting Up for Electronic Signatures

m y
d e
ca
Setting Up for Electronic Signatures
e A
c l
Implementing Password-based Signatures with Single Sign-On

r a
Oracle Workflow supports password-based signatures for notifications based on Oracle
Application Object Library (FND) passwords. If you maintain your directory service based on
O ly
Oracle Application Object Library users and passwords, no additional setup is required.

must perform the following steps.


l & On
However, if you implement single sign-on for your site through Oracle Internet Directory, you

a e
• Set the Applications SSO Login Types profile option to either Local or Both at user level
n
t e r
for all users who need to enter password-based signatures.

U s
• Ensure that these users have valid passwords defined in Oracle Application Object
Library.
I n
For more information, see: Oracle Single Sign-On Integration, Oracle Applications System

l e
Administrator's Guide - Security.

c
Loading Certificates for Digital Signatures

r a
Before users can sign responses with their X.509 certificates, you must load these certificates
into your Oracle E-Business Suite database using the Workflow Certificate Loader. When you
O load a certificate, you must also specify the Oracle Applications user to whom that certificate is

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 51
assigned. Oracle Workflow uses this information to validate that the user attempting to sign
with a certain certificate is the same user to whom that certificate is assigned.
A user can have more than one certificate assigned to him or her. However, each certificate can
only be assigned to one user. Additionally, after you have loaded a certificate for a user, you
cannot delete it from the database or assign it to a different user. If a certificate is incorrectly
assigned, the user to whom it belongs must revoke it and obtain a new certificate instead.
You must load a user’s personal certificate, the root certificate of the certificate authority that
issued the personal certificate, and any intermediate certificates required for this type of
personal certificate.
Run the loader by running Java against
oracle.apps.fnd.wf.DigitalSignature.loader.CertificateLoader. You can load several certificates
at once by listing the information for all the certificates in a data file for the loader. You can
also load a single certificate by specifying the certificate information in the command line for
the loader.
Note: Oracle Workflow does not provide a framework for certificate provisioning. Oracle
Workflow’s digital signature support assumes that certificate provisioning is already part of
your infrastructure.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 52
Optional Step 9 Customizing the Workflow Web Page Logo

m y
d e
ca
Customizing the Workflow Web Page Logo
e A
c l
Note: /OA_MEDIA/ is a virtual directory mapping defined in your Web server when Oracle
Workflow is installed.
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 53
Optional Step 10 Adding Custom Icons

m y
d e
ca
Adding Custom Icons
e A
c l
If you create custom icons to include in your Oracle Workflow Builder process definition, and

must do the following: r a


you want the custom icons to appear in the Status Monitor when you view the process, you

O ly
1. Convert the custom icon files (.ico) to GIF format (.gif).

l & On
2. Copy the .gif files to the physical directory associated with your Web server’s
/OA_MEDIA/ virtual directory, so that the Status Monitor can access them.
a e
Note: /OA_MEDIA/ is a virtual directory mapping defined in your Web server when Oracle
n
Workflow is installed.

t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 54
Version Compatibility

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 55
Review Questions

m y
d e
ca
Review Questions and Solutions
e A
c l
1. What are the required setup steps for Oracle Workflow?

r a
- Set your global workflow preferences.

O ly
- Ensure that your directory service is set up.
- Set up background engines.

l & On
- Configure the Business Event System for event communication.

a e
2. What are the optional setup steps for Oracle Workflow?

n
t e r
- Partition Workflow tables for performance gain.
- Set up additional languages.
U s
I n
- Set up notification mailers.
- Customize the templates for your e-mail notifications.

l e
- Add Worklist web pages to users’ responsibilities.
c
- Set the WF: Notification Reassign Mode profile option.

r a - Control the item types for which users can define vacation rules and grant worklist

O access.

Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 56
- Set up users to enable electronic signatures in notification responses.
- Customize the company logo that appears in Oracle Workflow Web pages.
- Include custom icons in your Oracle Workflow icons subdirectory.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 57
Summary

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Setting Up Oracle Workflow


Chapter 27 - Page 58
Managing Service
Components
Chapter 28

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 2
Managing Service Components

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 3
Objectives

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 4
Oracle Workflow Manager

m y
d e
ca
Oracle Workflow Manager
e A
c l
To access Oracle Workflow Manager, log in to Oracle Applications Manager, select Workflow

button. r a
Manager from the Navigate To menu on the Applications Dashboard page, and click the Go

O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 5
Service Components

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 6
Service Component Containers

m y
d e
ca
Service Component Containers
e A
c l
Service component containers and their service components are run through Generic Service

a
Management (GSM), which you can control through Oracle Applications Manager.
r
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 7
Service Component Types

m y
d e
ca
Service Component Types
e A
c l
Oracle E-Business Suite also includes the service component type Workflow Web Services

r a
Outbound. These service components process outbound Oracle XML Gateway Web service
messages. See: Oracle XML Gateway User’s Guide.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 8
Accessing Service Components in Oracle Workflow Manager

m y
d e
ca
e
Accessing Service Components in Oracle Workflow Manager
A
c l
If you click the Service Components status icon or link, the Service Components page displays
all types of service components.
r a
If you click the Agent Listeners status icon, the Service Components page automatically filters
O ly
the list to display only PL/SQL agent listeners and Java agent listeners.

l & On
If you click the Notification Mailers status icon, the Service Components page automatically
filters the list to display only notification mailers.
a e
If the status of a service component changes to Stopped with Error or System Deactivated,
n
Applications Manager.
t e r U s
Oracle Workflow posts a system alert to the System Alerts and Metrics page in Oracle

I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 9
Managing Service Components

m y
d e
ca
Managing Service Components
e A
c l
You can also perform the following actions on the Service Components page.

r a
• To manually filter the service components displayed in the list, select a service component
property from the Filter pull-down menu, enter a filter value in the text field, and click the
O ly
Go button. You can filter by the following properties:
- Service component name
l
- Service component status
& On
n a e
- Service component type display name

t e r U s
- Service component type internal name
• You can automate the running of a service component by assigning it an Automatic or On-

I n
Demand startup type, or by scheduling control events in advance. However, if you want to
manually control the running of a service component, select the service component,
l e
choose the command that you want from the command pull-down menu, and click the Go
c
button. You can choose the following control commands:

r a - Refresh

O - Resume

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 10
- Start
- Stop
- Suspend
- Launch Summary Notifications (Workflow Mailer service components only)
• To review details for the container to which a service component belongs, click the
container link in the Container column.
When you choose to create a new service component, a page appears to let you select the type
of service component that you want to create. After you select a service component type, the
configuration wizard for that type appears.
Similarly, when you choose to edit an existing service component, the appropriate
configuration wizard appears.
On the Component Details page, you can review the configuration parameters and scheduled
control events for the selected service component. You can also review the history of control
events scheduled for the service component, review the service component container log,
access the configuration wizard to edit the service component, or perform other actions
appropriate to that type of service component.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 11
Service Component Container Logs

m y
d e
ca
Service Component Container Logs
e A
c l
The default container log level, which is also the recommended setting, is Error. You can

r a
optionally specify a different log level. The log levels that you can select, in order from most
detailed to least detailed, are as follows:
• 1 - Statement O ly
• 2 - Procedure
• 3 - Event l & On
• 4 - Exception
n a e
• 5 - Error
• 6 - Unexpected
t e r U s
I n
To specify a log level for a service component container, click the container link on the Service

l e
Components page, select the container, and click the View Status button to navigate to the
Service Status page. Then select the log level that you want to assign to the container from the
c
r a
Change Log Level To pull-down menu, and click Go.
You can specify a log level for an individual service component in the configuration wizard for

O that component.

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 12
Service Component Startup Modes

m y
d e
ca
Service Component Startup Modes
e A
c l
A service component can have one of three startup modes.

r a
• Automatic: When a component container is started, it will automatically start its automatic
service components. It will also monitor these components and restart them automatically
when necessary. O ly
l & On
• On-Demand: A component container will start its on-demand service components if those
components have messages waiting to be processed. For example, an on-demand
a e
notification mailer service component will be started if there are messages waiting on the
n
t e r
WF_NOTIFICATION_OUT queue. The container will stop an on-demand service
s
component when that component's maximum idle time has been exceeded.
U
I n
• Manual: You must manually start and stop the service component through Oracle
Workflow Manager. The component container does not start or stop its manual service

c l e
components.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 13
Agent Listeners

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 14
Agent Listeners

m y
d e
ca
Agent Listeners
e A
c l
Oracle Workflow provides the following seeded PL/SQL agent listeners:

r a
• Workflow Deferred Agent Listener: Handles messages on WF_DEFERRED to support
deferred subscription processing.
O ly
• Workflow Deferred Notification Agent Listener: Handles notification messages on

l & On
WF_DEFERRED to support outbound notification processing.
• Workflow Error Agent Listener: Handles messages on WF_ERROR to support error
a e
handling for the Business Event System.
n
t e r U s
• Workflow Inbound Notifications Agent Listener: Handles messages on
WF_NOTIFICATION_IN to support inbound e-mail notification processing.

I n
Oracle XML Gateway also provides seeded PL/SQL agent listeners named ECX Inbound
Agent Listener and ECX Transaction Agent Listener. See: Oracle XML Gateway User’s
Guide.
c l e
Oracle Workflow provides the following seeded Java agent listeners:

r a
• Workflow Java Deferred Agent Listener: Handles messages on WF_JAVA_DEFERRED

O to support deferred subscription processing in the middle tier.

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 15
• Workflow Java Error Agent Listener: Handles messages on WF_JAVA_ERROR to
support error handling for the Business Event System in the middle tier.
Oracle XML Gateway also provides a seeded Java agent listener named Web Services IN
Agent. See: Oracle XML Gateway User’s Guide.
You can configure additional agent listeners for other inbound agents that you want to use for
event message propagation, such as the standard WF_IN and WF_JMS_IN agents, or any
custom agents. You can also configure an agent listener that only processes messages on a
particular agent that are instances of a specific event.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 16
Agent Listener Configuration Wizards

m y
d e
ca
Agent Listener Configuration Wizards
e A
c l
Use the Next and Back buttons to navigate among the pages of the configuration wizards.
Define Page
r a
O ly
• ID: When you edit a previously created service component, the configuration wizard
displays the identifier for the service component.

l & On
• Status: When you edit a previously created service component, the configuration wizard
displays the status of the service component.

n a e
• Name: The unique name of the service component.

t e r U s
• Startup Mode: Select Automatic, Manual, or On-Demand.
• Container Type: The container type to which this service component belongs. In Oracle E-

I n
Business Suite, the container type is always Oracle Applications Generic Service
Management (Oracle Applications GSM).
l e
• Inbound Agent: The Business Event System agent that you want to monitor for inbound
c
r a event messages.
• Outbound Agent: Leave this field blank. Agent listeners do not use an outbound agent.

O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 17
• Correlation ID: Optionally specify the Oracle Advanced Queuing (AQ) correlation ID of
the event messages that you want the agent listener to process. The AQ correlation ID for
an event message in the Business Event System is usually specified in the following
format: <event name>
Consequently, by specifying a correlation ID in this attribute, you can dedicate the agent
listener to listen only for messages that are instances of the specified event. You can also
specify a partial value to listen for messages that are instances of any event whose name
begins with the specified value.
Details Page
• ID: When you edit a previously created service component, the configuration wizard
displays the identifier for the service component.
• Status: When you edit a previously created service component, the configuration wizard
displays the status of the service component.
• Name: The configuration wizard displays the name defined for the service component.
• Container: The container to which the service component will belong. The container for
agent listener service components is a predefined container called Workflow Agent
Listener Service.
• Maximum Idle Time: If you selected the On-Demand startup mode for the service
component, enter the maximum time in minutes that the service component can remain
idle before it is stopped. An on-demand component that is stopped in this way will be
restarted by its container when it is needed again to process new messages.
• Max Error Count: The number of consecutive errors the service component can encounter
m y
resolved and processing can continue, the error count is reset.
d e
before its container stops it and changes its status to Stopped with Error. If an error is

ca
• Inbound Thread Count: Set the inbound processing thread count to 1 to enable inbound
message processing with this agent listener. Select 0 to disable this agent listener.
A
• Outbound Thread Count: Leave this parameter set to the default value of 0. Agent listener
e
c l
service components do not perform outbound message processing.
• Log Level: Select the level of detail for the information you want to record in the service
component container log.
r a
• Processor Read Wait Timeout: Specify the amount of time in seconds that the service
O ly
component’s processing thread continues to wait, after reading the last message from its

l & On
assigned queue, before timing out. If another message is received before this time expires,
that message is processed and the timeout period begins again. If the timeout period
a e
expires and no more messages have been received, the service component stops reading
n
t e r
and its sleep time begins.
s
• Processor Min Loop Sleep: Specify the minimum sleep time in seconds during which the
U
I n
service component waits, after its read timeout period expires, before it checks its queue
for messages again.

l e
• Processor Max Loop Sleep: Specify the maximum sleep time in seconds if you want to

c
increase the sleep time between read attempts when no messages are received. If you

r a specify a maximum sleep time that is greater than the minimum sleep time, then the
service component initially waits for the minimum sleep time after it finishes reading
O messages from its queue. If no messages are read in subsequent attempts, then the sleep

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 18
time between read attempts gradually increases until the maximum sleep time is reached.
Increasing the sleep time can help enhance performance if messages are received
infrequently. You can also specify 0 for this parameter to indicate that the sleep time
should not be increased. In this case, the service component always waits for the minimum
sleep time between read attempts.
• Processor Error Loop Sleep: Specify the sleep time in seconds during which the service
component waits, after an error occurs, before it attempts to begin processing again.
• Processor Close on Read Timeout: Select this parameter to specify that the service
component should close its connections after its read timeout period expires, when its
sleep time begins. Deselect this parameter to specify that the connections should remain
open until the processing thread stops.
Scheduling Events Page
You can schedule the following events to be raised to control the running of an agent listener
service component.
• Start
• Refresh
• Suspend
• Resume
• Stop
Click the Add a Row or Add Another Row button to add a new row to the list of events and
enter the information for the event.
• Select the event for the command you want to schedule. m y
• Select the date when you want the event to be raised first.
d e
ca
• Select the hour and minute to specify the time on the specified date when you want the
event to be raised first. The hour values are in a twenty-four hour format. For example,
select 00 for midnight, or 23 for 11 PM.

e A
c l
• If you want to raise the event periodically, enter the time interval in minutes at which you
want to raise the event. If you do not specify a repeating interval, the event is raised only
once.
r a
• If you choose the refresh event, you can optionally enter parameters to refresh the agent
O ly
listener configuration parameters with those values when the event is raised.
Review Page

l & On
If you want to change any of these settings, return to the appropriate step in the agent listener
a e
configuration wizard to make your changes. To save these settings and finish the configuration,
n
click the Finish button.

t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 19
Notification Mailers

m y
d e
ca
Notification Mailers
e A
c l
For example, you can create a notification mailer that processes only messages that belong to a

r a
particular workflow item type, or create additional mailers that process the same types of
message to increase throughput. The correlation ID for a notification mailer can be set to a
O ly
specific item type to determine which messages it can process.

l & On
You can also configure any notification mailer service component to process only inbound
messages, or only outbound messages. You associate inbound and outbound mailers with each

n a e
other by assigning them the same mailer node name. The mailer node name indicates which
inbound mailer can process incoming responses to outbound messages sent by a particular
outbound mailer.
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 20
Outbound Notification Mailer Processing

m y
d e
ca
Outbound Notification Mailer Processing
e A
c l
When the event is dequeued from WF_DEFERRED and the subscription is processed, the

r a
subscription requires the event data for the event, causing the Generate function for the event
to be executed. The Generate function for this event performs the following actions:
O ly
• Resolves the notification recipient role to a single e-mail address, which itself can be a
mail list.

l & On
• Checks the notification preference of the recipient to determine whether an e-mail
a e
notification is required, and in what type of format.
n
t e r U s
• Switches its database session to the recipient role's preferred language and territory as
defined in the directory service.

I n
• Generates an XML representation of the notification message and any optional
attachments using the appropriate message template.

l e
Finally, the subscription places the event message on the standard WF_NOTIFICATION_OUT
agent.
c
r a
A notification mailer service component polls the WF_NOTIFICATION_OUT agent for
messages that must be sent by e-mail. When the notification mailer dequeues a message from
O this agent, it uses a Java-based notification formatter to convert the XML representation of the

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 21
notification into a MIME (Multipurpose Internet Mail Extensions) encoded message and sends
the message by the Simple Mail Transfer Protocol (SMTP).

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 22
Inbound Notification Mailer Processing

m y
d e
ca
Inbound Notification Mailer Processing
e A
c l
A notification mailer processes e-mail responses from users using the Internet Message Access

r a
Protocol (IMAP). The notification mailer uses a Java-based e-mail parser to interpret the text
of each message and create an XML representation of it.
O ly
A notification mailer uses three folders in your response mail account for response processing:

messages.
l & On
one to receive incoming messages, one to store processed messages, and one to store discarded

a e
A notification mailer does the following to process response messages:
n
t e r U s
• Logs into its IMAP e-mail account.
• Checks the inbox folder for messages. If a message exists, the notification mailer reads the

I n
message, checking for the notification ID (NID) and node identifier in the NID line.
• If the message is not a notification response, meaning it does not contain an NID line, the

l e
notification mailer moves the message to the discard folder and treats it as an unsolicited
c
message.

r a• If the message is a notification response, but for the wrong node, the notification mailer
leaves the message in the inbox and adds the e-mail's Unique Message ID (UID) to its
O ignore list.

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 23
• If the message is a notification response for the current node, meaning it contains an NID
line including the node identifier of the current node, the notification mailer processes the
message.
The notification mailer performs the following steps for messages that belong to its node.
• Retrieves the notification ID.
• Checks to see if the message bounced by referring to the tags specified in the
configuration parameters. If the message bounced, the notification mailer reroutes it or
updates the notification's status and stops any further processing, depending on the
specifications of the tag list.
• Checks the Oracle Workflow database for this notification based on the NID line.
- If the notification does not exist, meaning the notification ID or the access key in the
NID line is invalid, the notification mailer moves the message to the discard folder. If
the NID line is incorrectly formatted, the notification mailer moves the message to the
discard folder and treats it as an unsolicited message.
- If the notification exists, but is closed or canceled, the notification mailer moves the
message to the discard folder and sends a Workflow Closed Mail or Workflow
Canceled Mail message to the recipient role, respectively.
- If the notification exists and is open, the notification mailer generates an XML
representation of the message and places it on the WF_NOTIFICATION_IN agent.
The notification mailer then moves the message for the completed notification to the
processed folder.
Finally, if there are no more unprocessed messages in the inbox, the notification mailer logs
m y
out of the mail and database accounts.
When an event message is dequeued from WF_NOTIFICATION_IN, Oracle Workflow
d e
ca
executes a seeded subscription that calls the appropriate notification response function. This
function verifies the response values with the definition of the notification message’s response

e A
attributes in the database. If a response value is invalid, or if no response value is included, the
notification mailer sends a Workflow Invalid Mail message to the recipient role, or, for an

c l
invalid response to a request for more information, the notification mailer sends a Workflow

r a
Invalid Open Mail (More Information Request) message to the recipient role. If the responses
are valid, the notification response function records the response and completes the
notification.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 24
Notification Mailer Setup

m y
d e
ca
Notification Mailer Setup
e A
c l
You should also ensure that the Business Event System status is set to Enabled on the

r a
Configuration page, and that the JOB_QUEUE_PROCESSES database initialization
parameter, which is required for the Business Event System, is set to an appropriate value. The
O ly
Business Event System status is set to Enabled by default, and usually you do not need to

this preference value.


l & On
change the status. If notification processing is not being completed, however, you should check

n a e
You can optionally set the WF: Workflow Mailer Framework Web Agent profile option to the
host and port of the Web server that notification mailers should use to generate the content for

e r s
Oracle Applications Framework regions that are embedded in notifications. If this profile
t U
option is not set, notification mailers will use the same Web agent specified in the Application

I n
Framework Agent profile option. However, if necessary for load balancing purposes, you can
optionally specify a different Web agent for notification mailers to use. The WF: Workflow
l e
Mailer Framework Web Agent profile option should be set at site level.
c
Before a service component can run, the container which manages it must first be started.

r a
Check that the containers for agent listeners and notification mailers are running. Also check

O that the Workflow Deferred Notification Agent Listener, Workflow Error Agent Listener, and
Workflow Inbound Notifications Agent Listener are running.
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 25
By default, the seeded Workflow Notification Mailer has a Launch Summary Notifications
event scheduled to send summary notifications once a day. You can optionally use the
notification mailer configuration wizard to modify the start time and interval for this event's
schedule, or to schedule the Launch Summary Notifications event at the interval you choose
for any notification mailer service component. When this event is processed, a summary
notification is sent to each role with a notification preference of SUMMARY or SUMHTML.
You can optionally configure a notification mailer to connect to the SMTP server and IMAP
server through Secure Sockets Layer (SSL) to encrypt the data exchanged.
You can optionally set the internal mailer parameter named HTML_DELIMITER to specify
which characters the notification mailer uses to delimit response values in response templates
for HTML-formatted e-mail notifications. See: Setting Up a Notification Mailer, Oracle
Workflow Administrator’s Guide.
The seeded Workflow Notification Mailer uses the Automatic startup mode by default and will
be started automatically when you complete its configuration. If you select the Manual startup
mode for a notification mailer service component, use the Service Components page to start
that notification mailer.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 26
Connecting to Mail Servers Through SSL

m y
d e
ca
Connecting to Mail Servers Through SSL
e A
c l
To use SSL, you must have loaded on the SMTP and IMAP servers an X.509 certificate and

the SMTP server and the IMAP server.r a


private key that were issued by a certificate authority. You can use the same certificate for both

O ly
Additionally, to connect to the SMTP server through SSL, you must have an Stunnel process

l & On
running on the SMTP server, with the location of the certificate file specified in the Stunnel
arguments. Stunnel is a program that lets you encrypt connections inside SSL. For more
a e
information, see: http://www.stunnel.org
n
configuration wizard.
t e r
You can then enable SSL for the SMTP and IMAP servers in the notification mailer

U s
I n
After completing the SSL setup, stop and restart the service component container named
Workflow Mailer Service for the changes to take effect.

c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 27
Notification Mailer Basic Configuration

m y
d e
ca
Notification Mailer Basic Configuration
e A
c l
The Basic Configuration page is the first page of the notification mailer configuration wizard.
• Details
r a
O ly
- Name: The unique name of the service component.
• Outbound E-mail Account (SMTP)

l & On
- Server Name: The name of the outbound SMTP mail server.

n a e
- Outbound SSL Enabled: Select this parameter to enable the notification mailer to use
SSL for connections to the SMTP server. You must also complete additional setup
steps to use SSL.
t e r U
• Inbound E-mail Account (IMAP)
s
I n
- Inbound Processing: Select this parameter to enable inbound e-mail processing with

c l e
this notification mailer. Deselect this parameter to disable inbound e-mail processing
for this notification mailer and dedicate the notification mailer solely to outbound

r a processing. If you disable inbound processing, you can leave the other inbound
parameters blank.

O - Server Name: The name of the inbound IMAP mail server.

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 28
- Username: The user name of the mail account that the notification mailer uses to
receive e-mail messages.
- Password: The password for the mail account specified in the Username parameter.
- Reply-To Address: The address of the e-mail account that receives incoming
messages, to which notification responses should be sent.
- Inbound SSL Enabled: Select this parameter to enable the notification mailer to use
SSL for connections to the IMAP server. You must also complete additional setup
steps to use SSL.
To send a test message, click the Test Mailer button. On the Test Notification Mailer page,
select the recipient role to which the message should be sent, and click the Send Test Message
button. Then check the e-mail account for the recipient role to verify that the test message was
received.
To set additional parameters for this notification mailer in the advanced configuration wizard,
click the Advanced button.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 29
Notification Mailer Advanced Configuration

m y
d e
ca
Notification Mailer Advanced Configuration
e A
c l
Use the Next and Back buttons to navigate among the pages of the configuration wizard.
Define Page
r a
O ly
• ID: The configuration wizard displays the identifier for the service component.
• Status: The configuration wizard displays the status of the service component.

l & On
• Name: The unique name of the service component.

a e
• Startup Mode: Select Automatic, Manual, or On-Demand.

n
e r
• Container Type: The container type to which this notification mailer belongs, which is
s
always Oracle Applications Generic Service Management (Oracle Applications GSM).
t U
• Inbound Agent: The Business Event System agent for inbound processing. The inbound
I n
agent for a notification mailer is always WF_NOTIFICATION_IN.

c l e
• Outbound Agent: The Business Event System agent for outbound processing. The
outbound agent for a notification mailer is always WF_NOTIFICATION_OUT.

r a
• Correlation ID: Optionally select an item type to specify that this notification mailer
should only process messages that belong to that item type. If you enter a partial value,
O this notification mailer will process messages that belong to any item type whose internal

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 30
name begins with that value. You can enter an item type as the correlation ID if you want
to increase throughput for that particular item type by dedicating a notification mailer to it.
If you leave the correlation ID blank, this notification mailer will process messages from
any item type. The seeded Workflow Notification Mailer does not have any correlation ID
specified, so that it can operate generally to process all messages.
Details Page
• ID: The configuration wizard displays the identifier for the service component.
• Status: The configuration wizard displays the status of the service component.
• Name: The configuration wizard displays the name defined for the service component.
• Container: The container to which the service component will belong. The container for
notification mailer service components is a predefined container called Workflow Mailer
Service.
• Maximum Idle Time: If you selected the On-Demand startup mode for the service
component, enter the maximum time in minutes that the service component can remain
idle before it is stopped. An on-demand component that is stopped in this way will be
restarted by its container when it is needed again to process new messages.
• Max Error Count: The number of consecutive errors the service component can encounter
before its container stops it and changes its status to Stopped with Error. If an error is
resolved and processing can continue, the error count is reset.
• Inbound Thread Count: Set the inbound processing thread count to 1 to enable inbound
message processing with this notification mailer. Select 0 to disable inbound message
processing for this notification mailer.
m y
• Outbound Thread Count: Specify the number of outbound processing threads you want to
d
execute simultaneously with this notification mailer. You can set the outbound threade
count to 1 or more depending on the volume of outbound messages you need to send.
Specify 0 to disable outbound message processing for this notification mailer. ca
A
• Log Level: Select the level of detail for the information you want to record in the service
e
component container log.

c l
• Processor Read Wait Timeout: Specify the amount of time in seconds that the service

r a
component’s processing thread continues to wait, after reading the last message from its
assigned queue, before timing out. If another message is received before this time expires,
O ly
that message is processed and the timeout period begins again. If the timeout period

and its sleep time begins.


l & On
expires and no more messages have been received, the service component stops reading

a e
• Processor Min Loop Sleep: Specify the minimum sleep time in seconds during which the
n
for messages again.
t e r
service component waits, after its read timeout period expires, before it checks its queue

U s
I n
• Processor Max Loop Sleep: Specify the maximum sleep time in seconds if you want to
increase the sleep time between read attempts when no messages are received. If you

c l e
specify a maximum sleep time that is greater than the minimum sleep time, then the
service component initially waits for the minimum sleep time after it finishes reading

r a messages from its queue. If no messages are read in subsequent attempts, then the sleep
time between read attempts gradually increases until the maximum sleep time is reached.

O Increasing the sleep time can help enhance performance if messages are received

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 31
infrequently. You can also specify 0 for this parameter to indicate that the sleep time
should not be increased. In this case, the service component always waits for the minimum
sleep time between read attempts.
• Processor Error Loop Sleep: Specify the sleep time in seconds during which the service
component waits, after an error occurs, before it attempts to begin processing again.
• Processor Close on Read Timeout: Select this parameter to specify that the service
component should close its connections after its read timeout period expires, when its
sleep time begins. Deselect this parameter to specify that the connections should remain
open until the processing thread stops.
E-mail Servers Page
General
• Mailer Node Name: The node identifier name used by this notification mailer. The
maximum length of the node name is eight characters. The node name is included with the
outgoing notification ID in outbound messages, and is used in inbound messages to
identify the notification mailer that should process the messages.
• Email Parser: The Java class used to parse an incoming notification response e-mail and
create an XML document for the response. The standard default e-mail parser provided by
Oracle Workflow is named oracle.apps.fnd.wf.mailer.TemplatedEmailParser. Usually you
do not need to change this value.
• Alternate Email Parser: The Java class used to parse an incoming notification response e-
mail formatted according to the direct response method and to create an XML document
for the response. The notification mailer uses this parser when the Direct Response
m y
d
named oracle.apps.fnd.wf.mailer.DirectEmailParser. Usually you do not need to changee
parameter is selected. The default alternate e-mail parser provided by Oracle Workflow is

this value.

ca
• Expunge Inbox on Close: Select this parameter to purge deleted messages from the inbox

e A
folder when the notification mailer closes this folder. If you do not select this parameter,
copies of messages that were moved to the discard or processed folders remain in the
l
inbox, in a deleted state, until you manually expunge them using your e-mail application.
c
Inbound E-mail Account
r a
• Inbound Protocol: Oracle Workflow supports the IMAP protocol for inbound e-mail.
O ly
• Inbound Server Name: The name of the inbound mail server.

e-mail messages.
l & On
• Username: The user name of the mail account that the notification mailer uses to receive

a e
• Password: The password for the mail account specified in the Username parameter.
n
t e r U s
• Inbox Folder: The name of the folder from which the notification mailer receives inbound
messages. This value is case-insensitive. The default value is INBOX.

I n
• Inbound Connection Timeout: The maximum amount of time in seconds that the
notification mailer will wait to establish a connection to the inbound server before timing
out.

c l e
• Inbound Message Fetch Size: The maximum number of messages that the notification

r a mailer can fetch from the inbox at one time.

O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 32
• Maximum Ignore List Size: The maximum number of notification IDs that the notification
mailer can store in its ignore list, indicating that this notification mailer will make no
further attempts to process them after encountering errors. Usually you do not need to
change this value.
• Inbound SSL Enabled: Select this parameter to enable the notification mailer to use SSL
for connections to the IMAP server. You must also complete additional setup steps to use
SSL.
Outbound E-mail Account
• Outbound Protocol: Oracle Workflow supports the SMTP protocol for outbound e-mail.
• Outbound Server Name: The name of the outbound mail server.
• Test Address: This parameter has been replaced by the override e-mail address, which is
available through the Component Details page for a notification mailer.
• Outbound Connection Timeout: The maximum amount of time, in seconds, that the
notification mailer will wait to establish a connection to the outbound server before timing
out.
• Outbound SSL Enabled - Select this parameter to enable the notification mailer to use
Secure Sockets Layer (SSL) for connections to the SMTP server. You must also complete
additional setup steps to use SSL.
E-mail Processing
• Processed Folder: The name of the mail folder where the notification mailer places

value is PROCESS.
m y
successfully processed notification messages. This value is case-insensitive. The default

d e
• Discard Folder: The name of the mail folder where the notification mailer places incoming
messages that are not recognized as notification messages. This value is case-insensitive.
The default value is DISCARD.
ca
mail notification that has been forwarded from another role.
e A
• Allow Forwarded Response: Indicate whether to allow a user to respond by e-mail to an e-

Message Generation Page


c l
Send
r a
• From: The value that appears in the From field of the message header of a notification e-
mail.
O ly
l & On
• Reply-to Address: The address of the e-mail account that receives incoming messages, to
which notification responses should be sent.

a e
• HTML Agent: The base URL that identifies the HTML agent that handles HTML
n
attachments.
t e r
notification responses. This URL is required to support e-mail notifications with HTML

U s
• Message Formatter: Oracle Workflow uses the
I n
oracle.apps.fnd.wf.mailer.NotificationFormatter Java class to generate notification

c l e
messages.
• Framework User: The numerical user ID for the user through which a notification mailer

r a accesses Oracle Application Framework content for inclusion in e-mail notifications. The
Framework user must have workflow administrator privileges in order to access the

O content for every user's notifications. If you change the Workflow System Administrator

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 33
preference, check the Framework User parameter to ensure that the user accessed by the
notification mailer has workflow administrator privileges. Set the Framework User
parameter to a user that is a member of the Workflow System Administrator role, or, if
you set the Workflow System Administrator preference to a responsibility, set the
Framework User parameter to a user that has that responsibility.
• Framework Responsibility: The numerical responsibility ID for the responsibility through
which a notification mailer accesses Oracle Application Framework content for inclusion
in e-mail notifications. The user specified in the Framework User parameter must have
this responsibility assigned.
• Framework Application ID: The numerical application ID for the application through
which a notification mailer accesses Oracle Application Framework content for inclusion
in e-mail notifications. The responsibility specified in the Framework Responsibility
parameter must be assigned to this application.
• Framework URL Timeout: The maximum amount of time, in seconds, that the notification
mailer will wait to access a URL for Oracle Application Framework content before timing
out.
• Attach Images to Outbound Emails: Select this parameter to attach any images referenced
in HTML content included in a message, such as Oracle Application Framework content,
to outbound notification e-mail messages. Deselect this parameter to display the image
references as off-page URLs.
• Attach Stylesheet to Outbound Email: Select this parameter to attach any stylesheet
referenced in HTML content included in a message, such as Oracle Application
m
Framework content, to outbound notification e-mail messages. Deselect this parameter to
y

display the stylesheet reference as a URL.
d e
Autoclose FYI: Indicate whether this notification mailer automatically closes notifications

ca
that do not require a response, such as FYI (For Your Information) notifications, after


sending the notifications by e-mail.
A
Direct Response: By default, notification mailers require a response format for plain text
e
response method instead.
c l
notifications called the templated response method. Select this parameter to use the direct


r a
Reset NLS: Indicate whether the notification mailer should convert the NLS codeset for a

O ly
notification message according to the notification recipient's preferences before
composing the message.

& On
Inline Attachments: Select this parameter to set the Content-Disposition MIME header to
l
inline for attachments to notification messages, including the Notification Detail Link,

n a e
HTML Message Body, Notification References containing attached URLs, and attached

t e r U s
PL/SQL documents. Deselect this parameter to set the Content-Disposition MIME header
to attachment for these attachments. For example, if your e-mail application cannot

I n
display HTML content such as the Notification Detail Link inline, deselect this parameter
to display this link as an attachment instead.

l e
Send Warning for Unsolicited E-mail: Select this parameter to allow the notification

c
mailer to send back a warning message the first time it receives an unsolicited e-mail

r a message from a particular e-mail address.

O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 34
• Send E-mails for Canceled Notifications: Select this parameter to allow the notification
mailer to send cancellation messages to users when previously sent notifications are
canceled.
Templates
This region lets you specify the message templates you want to use to generate e-mail
notifications. The template for a particular type of e-mail notification determines the basic
format of the notification, including what header information to include, and whether and
where to include details such as the message due date and priority.
Oracle Workflow provides a set of standard templates in the System: Mailer item type, which
are used by default. It is not recommended to modify the standard templates. However, you can
customize the message templates used to send your e-mail notifications by assigning a
notification mailer alternative templates provided by Oracle Workflow or custom templates
that you create in Oracle Workflow Builder. The templates assigned to a mailer override the
default System: Mailer templates.
Scheduling Events Page
You can schedule the following events to be raised to control the running of a notification
mailer.
• Start
• Refresh
• Suspend
• Resume
• Stop
m y
• Launch Summary Notifications
d e
enter the information for the event.
ca
Click the Add a Row or Add Another Row button to add a new row to the list of events and

• Select the event for the command you want to schedule.

e A
c l
• Select the date when you want the event to be raised first.
• Select the hour and minute to specify the time on the specified date when you want the

r a
event to be raised first. The hour values are in a twenty-four hour format. For example,
select 00 for midnight, or 23 for 11 PM.
O ly
• If you want to raise the event periodically, enter the time interval in minutes at which you

once.
l & On
want to raise the event. If you do not specify a repeating interval, the event is raised only

a e
• If you choose the refresh event, you can optionally enter parameters to refresh the
n
Tags Page
t e r U s
notification mailer configuration parameters with those values when the event is raised.

I n
This page lets you enter patterns of text found in unusual messages and the status you want to
assign to an inbound message if it contains any of those patterns. For example, unusual

l e
messages include bounced or returned messages and auto-reply messages such as those sent by

c
vacation daemons, mass mailing lists, and so on. Since different mail systems vary in how they

r a
identify bounced, undeliverable, or otherwise invalid messages, you can use notification mailer
tags to specify how your mail system identifies those stray messages and how you want the
O notification mailer to handle those messages should it come across them.

Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 35
Oracle Workflow provides several predefined tags for text commonly found in undeliverable
or auto-reply messages. The notification mailer handles messages according to these mail
status values, as follows:
• UNDELVRD: Moves the message to the discard folder and updates the notification's mail
status to FAILED. Additionally, the notification preference of the recipient of the
notification is updated to DISABLED. No error process is initiated for this notification
activity. However, after correcting the issues that prevented the e-mail from being sent,
you can reset the user's notification preference and then run the Resend Failed Workflow
Notifications program to re-enqueue failed notifications on the notification mailer's
outbound queue.
• Unavailable: Moves the message to the discard folder and continues waiting for a reply to
the notification since the notification's status is still OPEN, but its mail status is updated to
UNAVAIL. This status is purely informative, as no further processing occurs with this
notification.
• Ignore: Moves the message to the discard folder and continues waiting for a valid reply to
the open notification. The notification's status is still OPEN and its mail status is still
SENT.
You can define additional tags for other patterns you want the notification mailer to handle
automatically. To add a new tag, click the Add Another Row button, enter the text pattern in
the Pattern column, and select the status you want to assign to messages containing that pattern
in the Action column.
Test Page
This page lets you test the notification mailer configuration by sending a sample notification
m y
d e
message. Select the recipient role to which the message should be sent, and click the Send Test
Message button. Then check the e-mail account for the recipient role to verify that the test
message was received.
ca
Review Page

e A
If you want to change any of these settings, return to the appropriate step in the notification

configuration, click the Finish button. c l


mailer configuration wizard to make your changes. To save these settings and finish the

r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 36
Component Details for Notification Mailers

m y
d e
ca
Component Details for Notification Mailers
e A
c l
Click the Test Mailer button to send a test message. On the Test Notification Mailer page,

r a
select the recipient role to which the message should be sent, and click the Send Test Message
button. Then check the e-mail account for the recipient role to verify that the test message was
received.
O ly
l & On
Click the Set Override Address button to set an override address where you want to send all
outgoing e-mail notifications. Use an override address when you are testing workflow

n a e
definitions or mailer processing so that you can automatically receive all the test notifications
at one e-mail address, instead of having to check or change each individual recipient's e-mail

e r s
address. To ensure that the override address is accessible and that its use is authorized, you
t U
must verify the request before the notification mailer can use the address.

I n
• On the Set Override Address page, review the current override address, if any. Enter the e-

l e
mail address you want to set as the new override address, and select Submit. Then check
the e-mail account that you specified for the verification e-mail message.
c
r a
• On the Verify Override Address page, enter the verification code shown in the e-mail
message, and click Apply. If necessary, you can use the link provided in the verification e-

O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 37
mail message to navigate back to the Verify Override Address page. You must log in to
Oracle Applications Manager before you can access this page.
• To remove the override address, navigate to the Set Override Address page and click the
Clear Override Address button. The notification mailer then resumes sending e-mail
notifications to the individual recipients' e-mail addresses.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 38
Notification Mailer Throughput

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 39
Guided Demonstration - Service Components
1. Access Oracle Applications Manager by connecting to a Workflow administrator
responsibility as a user with workflow administrator privileges and clicking the Workflow
Manager link.

2. On the Workflow System page, click the Service Components status icon and review the
types and statuses of service components that are configured in this instance.

3. Select a service component and click View Log to view the log of the container to which
this service component belongs. Close the log window when you are finished reviewing the
log.

4. Select a service component and click View Details to review the configuration of that
service component. Click OK.

5. Select a service component and click View Event History to review the events that have
been scheduled to control the running of that service component.

6. Click Workflow in the locator links at the top of the page to navigate back to the Workflow
System page.

7. Click the Agent Listeners status icon to navigate to the Service Components page with the
m y
list filtered to show only agent listener service components. Review statuses of the standard

d e
agent listeners provided by Oracle Workflow, such as Workflow Deferred Agent Listener,

ca
Workflow Error Agent Listener, and Workflow Inbound Notifications Agent Listener. You
can also click View Details for these agent listeners to review their configurations.

8. Navigate back to the Workflow System page.


e A
9.
c l
Click the Notification Mailers status icon to navigate to the Service Components page with

a
the list filtered to show only notification mailer service components.
r
O ly
10. Review the status of the standard Workflow Notification Mailer service component provided
by Oracle Workflow. Select this service component and click Edit to review the basic
& On
notification mailer configuration. Review the following parameters:
l
n
SMTP mail server. a e
− Outbound E-mail Account (SMTP): Server Name - The name of the outbound

t e r U s
− Inbound E-mail Account (IMAP): Inbound Processing - Enable or disable inbound
e-mail processing with this notification mailer.

I n
− Inbound E-mail Account (IMAP): Server Name - The name of the inbound IMAP
mail server.

c l e
− Inbound E-mail Account (IMAP): Username - The user name of the mail account
that the notification mailer uses to receive e-mail messages.

r a − Inbound E-mail Account (IMAP): Password - The password for the mail account
that the notification mailer uses.
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 40
− Inbound E-mail Account (IMAP): Reply-To Address - The address of the e-mail
account that receives incoming messages.

11. Select Advanced to access the advanced notification mailer configuration wizard. On the
Define, Details, Email Servers, Message Generation, Scheduling Events, Tags, and Test
pages, review the parameters shown and click Next. On the Review page, click Finish.

12. Navigate back to the Workflow System page.

13. In the Related Links > Throughput region, click the Notification Mailers link to review the
mailer throughput graph.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 41
Handling Notification Mailer Errors

m y
d e
ca
Handling Notification Mailer Errors
e A
c l
For additional information about error handling scripts, diagnostic tests, and concurrent

a
programs, see: Handling Mailer Errors, Oracle Workflow Administrator’s Guide.
r
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 42
Summary

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 43
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing Service Components


Chapter 28 - Page 44
Managing System Status and
Throughput
Chapter 29

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 2
Managing System Status and Throughput

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 3
Objectives

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 4
Workflow System Status

m y
d e
ca
Workflow System Status
e A
c l
The Workflow System page also includes the following:
System Status
r a
O ly
You can also click the Notification Mailers, Agent Listeners, or Service Components status
icons to manage those components.

l & On
Additionally, you can also select an Oracle Workflow feature that runs as a concurrent program
from the Submit Request For pull-down menu and click the Go button. You can submit
a e
requests for background engines, purging, and control queue cleanup.
n
Related Database Parameters

t e r U s
This region lets you review actual and recommended values for the database initialization

I n
parameters that are required for Oracle Workflow.
Workflow Metrics
l e
• Work Items: To view the distribution of item types within a status, either select the bar for
c
r a that status in the graph, or click the status name link.
Note: A work item can be counted in more than one status. For example, all work items

O that do not have an end date are counted as Active work items, including deferred,

Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 5
suspended, and errored work items as well as running work items. Also, if an activity
within an item is deferred, and the work item as a whole is suspended, the work item is
included in the count for both the Deferred and Suspended statuses. Consequently, the
total of the counts for all the statuses is greater than the actual number of work items.
• Agent Activity: To view the distribution of event messages with different statuses on
different agents, either select the bar for a status in the graph, or select an event message
status name link.
Note: Messages are not explicitly assigned a status of Error. The Error bar in the graph
represents messages of any status on the WF_ERROR agent.
Related Links
• Configuration
- Click the Service Components link to configure service components, including
notification mailers and agent listeners.
- Click the Queue Propagation link to view a list of propagation schedules for Business
Event System agents.
• Throughput
- Click the Work Items link to view the distribution of completed work items across
different item types.
- Click the Notification Mailer link to view the notification mailer throughput.
Gathering Oracle Workflow Statistics
Some Oracle Workflow Manager graphs and lists may summarize large volumes of data,
depending on the level of activity in your Oracle Applications instance. To enhance m y
performance in displaying these statistics, Oracle Workflow Manager periodically runs
d e
data from the concurrent programs.
ca
concurrent programs to gather the statistics and displays the graphs and lists based on the latest

A
• Workflow Agent Activity Statistics program: Gathers statistics for the Agent Activity
graph on the Workflow System status page and for the agent activity list on the Agent
e
Activity page.
c l
r a
• Workflow Mailer Statistics program: Gathers statistics for the throughput graph on the
Notification Mailer Throughput page.

O ly
• Workflow Work Items Statistics program: Gathers statistics for the Work Items graph on
the Workflow System status page, for the Completed Work Items list on the Workflow

l & On
Purge page, and for the work item lists on the Active Work Items, Deferred Work Items,

n a e
Suspended Work Items, and Errored Work Items pages.
These concurrent programs are scheduled to run every 24 hours by default. They do not require

t e r U s
any parameters. You can optionally cancel the default scheduled requests and run the programs
with a different schedule if you want to gather statistics at a different frequency.

I n
Each of these graphs and lists displays the date and time when its statistics were last updated, as
well as a refresh icon that you can click to refresh the statistics immediately if necessary.
l e
However, note that if your Oracle Applications instance contains very large volumes of
c
workflow data, you may encounter delays or page timeouts when refreshing the data.

r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 6
Workflow Status in Oracle Applications Manager

m y
d e
ca
Oracle Applications Manager
e A
Diagnostics
c l
r a
Oracle Workflow provides the following diagnostic tests.

O ly
• Duplicate User Test: Checks the Oracle Workflow directory service to verify that there are
no roles in the WF_LOCAL_ROLES table with the same internal name, originating

l & On
system, and originating system ID.
• Notification Preference Validation Test: Checks the Oracle Workflow directory service to
a e
ensure that all roles with a notification preference for receiving e-mail notifications have
n
t e r
an e-mail address defined.

U s
• Rule Function Validation Test: Checks the rule functions defined for subscriptions and the

I n
generate functions defined for events in the Business Event System.
• GSM Setup Test: Checks the Generic Service Management (GSM) setup required for

l e
Oracle Workflow in Oracle Applications Manager.
c
• BES Clone Test: Checks certain standard agents and subscriptions required for internal

r a Business Event System and notification mailer processing to verify that they are enabled
and that their definitions include the correct local system.
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 7
• GSC Control Queue Test: Verifies that the Workflow control queue, WF_CONTROL, is
properly accessible.
• Workflow Advanced Queue Rule Validation Test: Checks the standard WF_ERROR and
WF_DEFERRED queues to verify that only one subscriber rule is defined for each queue.
• Workflow Agents/AQ Status Test: Checks the Business Event System agents for Oracle
Workflow and Oracle XML Gateway, as well as the queues associated with these agents.
• Workflow Objects Validity Test: Checks the Oracle Workflow and Oracle XML Gateway
database objects to verify that all the objects are valid.
• XML Parser Installation Test: Checks your Oracle Applications installation to verify that
the Oracle XML parser is installed and valid.
• Mailer Component Test: Checks your notification mailer service components to verify that
at least one notification mailer has been configured with all the parameters needed to run
it.
• Mailer Component Parameter Test: Checks your notification mailer service components to
validate their configuration parameters.
• Event Diagnostic Test: Reports details about the Business Event System, including the
statuses of the local system and agent listeners, details about the definitions of the
specified event and any subscriptions to that event, and details about the specified instance
of the event if it appears on a standard deferred or error queue.
• Event Raise Test: Checks the basic operation of the Business Event System by raising a
test event from Java and from PL/SQL and executing synchronous and asynchronous
subscriptions to that event.
m y
mailer that sent the notification.
d e
• Mailer Diagnostic Test: Reports details about a notification and about the notification

Logging
ca
Oracle Workflow uses the Oracle Applications Logging framework to standardize and
A
centralize in the database logging activities related to the Oracle Workflow Business Event
e
System and Oracle XML Gateway.
c l
Note: The Java middle tier components of Oracle Workflow, including notification mailers and

r a
agent listeners, also use Oracle Applications Logging; however, due to the high volume of
messages that pass through these components, their information is logged to the file system by
default. O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 8
Oracle Workflow Administration

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 9
Work Items

m y
d e
ca
Work Items
e A
c l
Review the number of work items in different statuses to monitor Workflow Engine processing

r a
and identify any possible bottlenecks. For example, an abnormal number of activities with a
deferred status may indicate that there are not enough background engines available.
O ly
Information about completed work items is available through the Workflow Purge page.

l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 10
Work Items

m y
d e
ca
Work Items
e A
Work Items
c l
r a
To filter the item types displayed in the list, select an item type property and an operator from
the Filter pull-down menus, enter a filter value in the text field, and click the Go button. You
O ly
can filter by the following properties:
• Work item type display name
• Work item type internal namel & On
n a e
• Number of work items of this type

t e r U s
Note: When you drill down to active work items, all work items that do not have an end date
are counted as active work items in this page, including deferred, suspended, and errored work

I n
items as well as running work items.
Work Item Details
l e
By default, the lists of active or deferred work items show only work items that started within
c
r a
the last 30 days, because there may be large numbers of work items in these statuses. However,
the lists of suspended or errored work items show work items that started at any time, by

O default.

Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 11
To view work items that started within a specific period, enter a number of days in the Filter:
Start Date Within Last _ Days option and click the Go button.
Note: When you drill down to active work items, only activities with a status of Active,
Waiting, or Notified are included on this page. Activities with a status of Deferred, Suspended,
or Error are not included on this page, although the work items to which they belong are
counted as active work items.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 12
Work Items

m y
d e
ca
Work Items
e A
Work Item Activity Details
c l
r a
By default, the lists of active or deferred work items show only work items that started within
the last 30 days, because there may be large numbers of work items in these statuses. However,
O ly
the lists of suspended or errored work items show work items that started at any time, by
default.

l & On
To filter the work items displayed in the list, select an activity property from the Filter By pull-
a e
down menu, enter a filter value in the text field, and click the Go button. You can filter by the
n
following properties:

t e r U s
• Internal name of the work item activity

I n
• Start date within a specified number of days
• Due date within a specified number of days

l e
• User assigned to perform the activity
c
r a
• Item key of the work item
Note: When you drill down to active work items, only activities with a status of Active,

O Waiting, or Notified are included on this page. Activities with a status of Deferred, Suspended,

Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 13
or Error are not included on this page, although the work items to which they belong are
counted as Active work items.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 14
Oracle Workflow Administration

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 15
Purging Workflow Data

m y
d e
ca
Purging Workflow Data
e A
c l
Note: The Purge APIs are provided to let developers and administrators perform manual

r a
purging when necessary. However, it is recommended that you submit purge requests from
Oracle Workflow Manager because this tool centralizes workflow management functionality
O ly
and lets you review the completed work items eligible for purging before you perform the
purge.

l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 16
Purging Workflow Data

m y
d e
ca
Purging Workflow Data
e A
c l
The persistence type of an item type controls when runtime status information for work items

r a
of that type becomes eligible for purging. The persistence values are:
• Temporary: Item will be eligible to be deleted in n days
O ly
• Permanent: Item will be deleted only when forced

l & On
Note: For a work item to be considered eligible for purging, all activities must be complete.
This requirement includes FYI notifications, which must be closed.

n a e
The Purge Obsolete Workflow Runtime Data program purges obsolete run-time information

t e r U s
associated with work items, including status information and any associated notifications and
Oracle XML Gateway transactions. By default, it also purges obsolete design information, such

I n
as activities that are no longer in use and expired ad hoc users and roles, and obsolete run-time
information not associated with work items, such as notifications or Oracle XML Gateway

l e
transactions that were not handled through a workflow process. You can optionally choose to

c
purge only core run-time information associated with work items for performance gain during

r a
periods of high activity, and purge all obsolete information as part of your routine maintenance
during periods of low activity.
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 17
To preserve electronic signature evidence for future reference, this program by default does not
delete any notifications that required signatures or their associated signature information. If
you do not need to maintain signature evidence, you can choose to delete signature-related
information as well.
Note: You can also use the Purge Obsolete ECX Data concurrent program to purge Oracle
XML Gateway transactions according to Oracle XML Gateway-specific parameters. See:
Purge Obsolete ECX Data Concurrent Program, Oracle XML Gateway User's Guide.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 18
Purging Workflow Data

m y
d e
ca
Purging in Oracle E-Business Suite
e A
c l
You can also access the Workflow Purge page from the Workflow System page by selecting
the Purge status icon.
r a
You can also submit a request for the Purge Obsolete Workflow Runtime Data concurrent
O ly
program by selecting Purge from the Submit Request For pull-down menu on the Workflow

Parameters
l & On
System page and clicking the Go button.

a e
• Item Type: Specify the item type to purge. Leave this field blank to purge the run-time
n
t e r
data for all item types.

U s
• Item Key: Specify the item key to purge. The item key is a unique identifier for an item

I n
within an item type. Leave this field blank to purge the run-time data for all items of the
specified item type.

l e
• Age: Specify the minimum age of data to purge, in days, if you are purging items with a
c
Temporary persistence type. The default is 0 days.

r a
• Persistence Type: Specify the persistence type of the data you want to purge, either
Permanent or Temporary. The default is Temporary.
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 19
• Core Workflow Only: Enter Y to purge only obsolete run-time data associated with work
items, or N to purge all obsolete run-time data as well obsolete design data. The default is
N.
• Commit Frequency: Enter the number of records to purge before the program commits
data. To reduce rollback size and improve performance, set this parameter to commit data
after a smaller number of records. The default is 500 records.
• Signed Notifications: Enter N to preserve signature evidence, including notifications that
required electronic signatures and their associated signature information. Enter Y to purge
signature-related information. The default is N.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 20
Completed Work Items

m y
d e
ca
Completed Work Items
e A
c l
Note: These pages show information for completed work items that have not yet been purged.

r a
Work items that have already been purged will no longer appear, because their information is
no longer stored in the Oracle Workflow tables.
Completed Work Items O ly
l & On
To filter the item types displayed in the list, select an item type property and an operator from
the Filter pull-down menus, enter a filter value in the text field, and click the Go button. You
a e
can filter by the following properties:
n
t e r
• Work item type display name
• Work item type internal name
U s
I
• Persistence type
• Retention period
n
l e
• Number of completed work items of this type
c
r a
• Number of items of this type available for purging
You can also drill down by clicking the item type link in the Work Item Type column.
O Completed Work Item Details

Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 21
By default, the list shows unpurged, completed work items that ended within the last 30 days,
because there may be large numbers of work items in this status. To view unpurged, completed
work items that ended within a different period, enter a number of days in the Filter: End Date
Within Last _ Days option and click the Go button.
You can also drill down by clicking the activity stage link in the Work Item Activity Stage
column.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 22
Completed Work Items

m y
d e
ca
Completed Work Items
e A
c l
Note: This page shows information for completed work items that have not yet been purged.

r a
Work items that have already been purged will no longer appear, because their information is
no longer stored in the Oracle Workflow tables.
Completed Work Item Activity DetailsO ly
l & On
By default, the list shows unpurged, completed work items that ended within the last 30 days,
because there may be large numbers of work items in this status.
a e
To filter the work items displayed in the list, select an activity property from the Filter pull-
n
following properties:
t e r U s
down menu, enter a filter value in the text field, and click the Go button. You can filter by the

I n
• Internal name of the activity at which the work item ended
• Start date within a specified number of days

l e
• End date within a specified number of days
c
r a
• User assigned to perform the activity
• Item key of the work item

O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 23
Workflow Purge APIs

m y
d e
ca
Workflow Purge APIs
e A
c l
Many of the purge APIs in the WF_PURGE package accept the following parameters:

r a
• Item Type: The item type associated with the obsolete run-time data that you want to
delete. Leave this parameter null to delete obsolete data for all item types.
O ly
• Item Key: The string generated from the application object’s primary key that uniquely

specified item type.


l & On
identifies the item within an item type. Leave this parameter null to purge all items in the

n a e
• End Date: A specified date to delete up to.

t e r U s
Note: Most of the WF_PURGE APIs only purge data associated with Temporary item types
whose persistence, in days, has expired. Use the WF_PURGE.TotalPERM API to delete all

Permanent. I n
eligible obsolete run-time data associated with item types of with a persistence type of

c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 24
Oracle Workflow Administration

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 25
Background Engines

m y
d e
ca
Background Engines
e A
c l
You can set up as many background engines as you need, but if you set up only one, then that

processes. r a
background engine must handle both deferred and timed out activities as well as stuck

O ly
Generally, you should run a separate background engine to check for stuck processes at less

l & On
frequent intervals than the background engine that you run for deferred or timed out activities,
normally not more often than once a day. Run the background engine to check for stuck

n a e
processes when the load on the system is low. Do not run more background engines
concurrently than your server has CPU processors.

t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 26
Background Engines

m y
d e
ca
Background Engines
e A
c l
When you start a new background engine, you can restrict the engine to handle activities

r a
associated with specific item types, and within specific cost ranges. You can submit the
Workflow Background Process concurrent program several times to schedule different
O ly
background engines to run at different times.
Parameters

l & On
• Item Type: Specify an item type to restrict this engine to activities associated with that
a e
item type. If you do not specify an item type, the engine processes any activity regardless
n
of its item type.

t e r U s
• Minimum Threshold: Specify the minimum cost that an activity must have for this

I n
background engine to execute it, in hundredths of a second.
• Maximum Threshold: Specify the maximum cost that an activity can have for this

l e
background engine to execute it, in hundredths of a second. By using Minimum Threshold

c
and Maximum Threshold you can create multiple background engines to handle very

r a specific types of activities. For example, if you only want to process activities with a
certain cost, you can set both the Minimum Threshold and the Maximum Threshold to that
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 27
value. The default values for these arguments are 0 and 100 so that the background engine
runs activities regardless of cost.
• Process Deferred: Specify whether this background engine checks for deferred activities.
• Process Timeout: Specify whether this background engine checks for activities that have
timed out.
• Process Stuck: Specify whether this background engine checks for stuck processes.

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 28
Oracle Workflow Administration

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 29
Control Queue Cleanup

m y
d e
ca
Control Queue Cleanup
e A
c l
The recommended frequency for performing cleanup is every 12 hours.

r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 30
Control Queue Cleanup

m y
d e
ca
Control Queue Cleanup
e A
c l
The Workflow Control Queue Cleanup concurrent program is automatically scheduled to run

r a
every 12 hours by default. You can optionally submit this program with a different schedule.
This program does not require any parameters.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 31
Oracle Workflow Administration

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 32
Queue Propagation

m y
d e
ca
Queue Propagation
e A
c l
You should schedule propagation for your local outbound Business Event System agents to

r a
send event messages to their destinations. A propagation schedule is defined for an outbound
queue and a specified destination, which can be either a remote database link or the local
O ly
system. If you want to use the standard WF_OUT and WF_JMS_OUT agents or custom agents

l & On
for event message propagation, ensure that you schedule propagation for those agents.
Note: You do not need to schedule propagation for the WF_CONTROL or

n a e
WF_NOTIFICATION_OUT agents, however, because the middle tier processes that use
WF_CONTROL dequeue messages directly from its queue, and a notification mailer sends

e r s
messages placed on the WF_NOTIFICATION_OUT queue.
t U
The Queue Propagation page shows information to let you determine the status of a

I n
propagation schedule, including the job queue process executing the schedule, whether the

e
schedule is enabled or disabled, and the error date and error message of the last unsuccessful
l
execution. For example, if no process is allocated to execute the schedule, you may need to
c
increase the JOB_QUEUE_PROCESSES database initialization parameter to ensure that

r a
processes are available for propagation. If the propagation schedule is disabled, you must

O enable it before it can be executed.

Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 33
Oracle Workflow Administration

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 34
Agent Activity

m y
d e
ca
Agent Activity
e A
c l
Review the number of messages in different statuses on your local agents to monitor event

r a
message processing and identify any possible bottlenecks. For example, if an inbound agent
has an abnormally large number of messages with a status of Ready, you may need to check
O ly
the status of the agent listener processing message for that agent, or configure a new agent

l & On
listener service component for that agent. Similarly, if an outbound agent has an abnormally
large number of messages with a status of Ready, you may need to check the status of the

n a e
propagation schedule for that agent’s queue, or schedule propagation if necessary.
Note: The Agent Activity page displays event messages on the WF_ERROR agent according

e r s
to their explicitly assigned status on the WF_ERROR queue, unlike the Agent Activity graph
t U
in the Workflow System page which summarizes all messages on the WF_ERROR agent in an
Error status.
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 35
Searching Messages on an Agent

m y
d e
ca
Searching Messages on an Agent
e A
c l
The icon in the View XML column is disabled if the event data for a message is empty.

r a
You can also search Oracle XML Gateway queues with these payload types:
• SYSTEM.ECXMSG
• SYSTEM.ECX_INENGOBJ O ly
l & On
For the Oracle XML Gateway payload types, the Search Queue page provides different filter

a e
criteria and message details that are specific to Oracle XML Gateway messages.

n
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 36
Guided Demonstration - System Status and Throughput
1. Access Oracle Applications Manager by connecting to a Workflow administrator
responsibility as a user with workflow administrator privileges and clicking the Workflow
Manager link.

2. On the Workflow System page, click the Show link for the Work Items graph in the
Workflow Metrics region.

3. Drill down to Active work items by selecting the Active bar in the graph.

4. Select a work item type and click View Details. If necessary, enter a value in the Filter Start
Date Within Last _ Days field and click Go to display details that are not displayed by
default.

5. Select a work item activity stage and click View Details.

6. Select a work item activity and click Suspend. Click OK on the confirmation pages.

7. Select Suspended Work Items from the View menu and click Go.

8.

9.
Select the same work item type and click View Details.

Select the same work item activity stage and click View Details.
m y
d
10. Select the same work item activity and click Resume. Click OK on the confirmation pages.e
11. Select Deferred Work Items from the View menu and click Go. Drill down to view the
ca
run more background engines.
e A
further details. Note that large numbers of deferred work items may indicate that you need to

c l
12. Click Workflow in the locator links at the top of the page to navigate back to the Workflow
System page.
r a
O ly
13. Select Background Engines from the Submit Request For menu and click Go to submit the

& On
concurrent request through Oracle Self-Service Web Applications.
l

n a e
Click Next and enter the following parameters:

t e r
− Item Type: <select an item type display name>
− Process Deferred: Yes
U s
I n
− Process Timeout: No
− Process Stuck: No

• l e
Click Next on each remaining page of the wizard until the Summary page, and then click
c
r a Submit.

O14. Navigate back to the Workflow System status page.

Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 37
15. Select the Error bar in the Work Items graph. Drill down to view the further details.

16. Navigate back to the Workflow System status page.

17. In the Related Links > Throughput region, select Work Items.

18. In the Completed Work Items region, select a work item type and click View Details. If
necessary, enter a value to in the Filter End Date Within Last _ Days field and click Go to
display details that are not displayed by default.

19. Select a work item activity stage and click View Details.

20. Select Completed Work Items from the View menu and click Go to return to the Workflow
Purge page.

21. Click the Purge button to submit a request for the Purge Obsolete Workflow Runtime Data
concurrent program through Oracle Self-Service Web Applications.

• Click Next and select the item type to purge in the Item Type parameter. Leave the other
parameters blank.

• Click Next on each remaining page of the wizard until the Summary page, and then click
Submit.

22. Navigate back to the Workflow Purge page and check for the item type that you purged in
m y
purged.
d e
the Completed Work Items region to confirm that the eligible items of that type have been

ca
23. You can also use SQL*Plus to manually review and purge work items. In SQL*Plus, review
the contents of a Workflow run-time table such as WF_ITEM_ACTIVITY STATUSES. For
example:
e A
c l
FROM WF_ITEM_ACTIVITY_STATUSES
r a
SELECT ITEM_TYPE,ITEM_KEY, PROCESS_ACTIVITY, ACTIVITY_STATUS

WHERE ITEM_TYPE LIKE ‘WF%’;


O ly
item type. For example:
l & On
24. In SQL*Plus, run the WF_PURGE.Total API with appropriate parameters to purge another

n a e
t e r
Exec WF_PURGE.Total('<itemtype>');

U s
25. In SQL*Plus, review the contents of the WF_ITEM_ACTIVITY STATUSES table again to

I n
show that the data has been purged.

l e
26. Navigate back to the Workflow System page in Oracle Workflow Manager.

c
r a
27. Select Control Queue Cleanup from the Submit Request For menu and click Go to submit
the concurrent request through Oracle Self-Service Web Applications.

O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 38
• Click Next on each page of the wizard until the Summary page, and then click Submit.
This program does not require any parameters.

28. Navigate back to the Workflow System page.

29. Click the Show link for the Agent Activity graph in the Workflow Metrics region.

30. Drill down by selecting a status bar in the graph.

31. Click an agent link in the Agent column to view details about the queue associated with that
agent. Then click OK.

32. Select an agent with messages on it and select Search Agent Entry Details.

33. Select a time period in the Enqueue Date field in the Search Criteria region, and click Go.

34. Click the icon in the View XML column for a message. Note that the View XML icon is
disabled if the event data within the event message is empty.

35. Navigate back to the Workflow System page.

36. In the Related Links > Configuration region, click the Queue Propagation link.

37. Select a queue schedule and click View Details.

m y
38. Navigate back to the Workflow System page and review the overall status as shown by the
status icons at the beginning of the page.
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 39
Summary

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Managing System Status and Throughput


Chapter 29 - Page 40
Sample Solutions
Chapter 30

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 1
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 2
Sample Solutions

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 3
Overview

m y
d e
ca
Overview
e A
• wfvacxx.html: HTML message body
c l
r a
• wfvacxxc.sql: Script to create the WFVACXX_VACATION_SCHEDULE table and its
index
O ly
• wfvacxxs.sql: Script to create the WFVACXX package specification

& On
• wfvacxxb.sql: Script to create the WFVACXX package body
l
and the WFVACXX package
n a e
• wfvacxxd.sql: Script to drop the WFVACXX_VACATION_SCHEDULE table, its index,

t e r U s
• wfslctxx.sql: Script to launch work items without specifying the process to start

I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 4
Vacation Proposal Process Sketch

m y
d e
ca
Vacation Proposal Process Sketch
e A
c l
This sketch shows a sample plan for the Vacation Proposal process as described in the
Planning a Workflow Process practice.
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 5
wfvacxx.html

m y
d e
ca
wfvacxx.html
e A
<TABLE>
c l
r a
<TR><TD><img SRC="/OA_MEDIA/calendar.gif"></TD></TR>

O ly
<TR><TD>Vacation Proposal from <B>&REQUESTOR</B> for
<B>&FROM_DATE</B> to <B>&TO_DATE</B></TD></TR>
</TABLE>

l & On
a e
Please approve vacation as proposed or suggest alternate dates.

r n s
n t e U
e I
c l
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 6
wfvacxxc.sql

m y
d e
ca
wfvacxxc.sql
e A
c l
r a
/*=======================================================================+

O ly
| Copyright (c) 1995 Oracle Corporation Redwood Shores, California, USA|
| All rights reserved. |

| FILENAME
l & On
+=======================================================================+

| wfvacxxc.sql

n a e
|
| DESCRIPTION

t e r U s
| NOTES
I n
| Create Workflow Vacation Schedule table and index

|
|
l e
This file is a SAMPLE that should be modified with your own

c
names before installing. Names that include

r a
|
|
XX should be replaced with values for your implementation.

O *=======================================================================*/

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 7
/* $Header$ */
whenever sqlerror continue;

drop table WFVACXX_VACATION_SCHEDULE;


create table WFVACXX_VACATION_SCHEDULE
( requestor_username varchar2(30) not null,
approver_username varchar2(30) not null,
from_date date not null,
to_date date not null);
--
create index WFVACXX_VACATION_SCHEDULE_N1 on WFVACXX_VACATION_SCHEDULE
(requestor_username,approver_username);
--
commit;

--exit

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 8
wfvacxxs.sql

m y
d e
ca
wfvacxxs.sql
e A
c l
r a
/*=======================================================================+

O ly
| Copyright (c) 1995 Oracle Corporation Redwood Shores, California, USA|
| All rights reserved. |

| FILENAME
l & On
+=======================================================================+

| wfvacxxs.sql

n a e
|
| DESCRIPTION

t e r U s
|
|
n
CLASS SAMPLE PL/SQL spec for package WFVACXX

I
| NOTES
|
c l e
This file is a SAMPLE that should be modified with your own

r a
|
|
package and procedure names before installing.
The script is written so that you can simply replace XX with the

O | unique number assigned to your station.

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 9
|
| It may be convenient to use the following naming standard
| - package name is equivalent to the item type internal name
| - procedure names are equivalent to the workflow activity
| internal name that the procedure implements.
*=======================================================================*/

whenever sqlerror exit failure rollback;

create or replace package WFVACXX as


/* $Header$ */

-- PROCEDURE SCHEDULE_UPDATE
--
-- <describe the activity here>
--
-- IN
-- itemtype - type of the current item
-- itemkey - key of the current item
-- actid - process activity instance id
-- funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...)
-- OUT
-- resultout
m y
--
--
- COMPLETE[:<result>]
activity has completed with the indicated result
d e
--
--
- WAITING
activity is waiting for additional transitions
ca
-- - DEFERED

e A
--
--
c l
execution should be deferred to background
- NOTIFIED[:<notification_id>:<assigned_user>]
--
--
r a
activity has notified an external entity that this
step must be performed. A call to wf_engine.CompleteActivity
--
O ly
will signal when this step is complete. Optional
--
--
l
- ERROR[:<error_code>] & On
return of notification ID and assigned user.

--
a e
function encountered an error.

n
e r
procedure SCHEDULE_UPDATE(
itemtype in varchar2,
itemkey
t
in varchar2,
U s
actid
I n
in number,

e
funcmode in varchar2,

c l
resultout in out varchar2);

r a
-- PROCEDURE NTF_VACATION_PROPOSAL

O --
-- <describe the activity here>

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 10
--
-- IN
-- itemtype - type of the current item
-- itemkey - key of the current item
-- actid - process activity instance id
-- funcmode - post-notification function execution mode
-- ('RESPOND','FORWARD','TRANSFER','RUN', 'CANCEL', 'TIMEOUT')
-- OUT
-- resultout
-- - COMPLETE[:<result>]
-- activity has completed with the indicated result
-- - WAITING
-- activity is waiting for additional transitions
-- - DEFERED
-- execution should be deferred to background
-- - NOTIFIED[:<notification_id>:<assigned_user>]
-- activity has notified an external entity that this
-- step must be performed. A call to wf_engine.CompleteActivty
-- will signal when this step is complete. Optional
-- return of notification ID and assigned user.
-- - ERROR[:<error_code>]
-- function encountered an error.
procedure NTF_VACATION_PROPOSAL(
m y
itemtype in varchar2,
itemkey in varchar2,
d e
actid in number,
funcmode in varchar2,
ca
resultout in out varchar2);

e A
-- PROCEDURE VACATION_SCHEDULED
c l
--
--
r a
Report vacation scheduled for the current Vacation Proposal requestor
--
O ly
--
--
IN
document_id -
l & On
string that uniquely identifies the document
-- display_type -
a e
text/html or text/plain

n
--
--
--
OUT
document -
document_type-
t e r s
outbound text buffer

U
outbound document type of text/html, text/plain, or ''

I n
e
procedure VACATION_SCHEDULED(

c l
document_id in varchar2,

a
display_type in varchar2,

O r document in out varchar2,


document_type in out varchar2);

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 11
-- PROCEDURE CHECK_APPROVER
--
-- Compares the value of the Vacation Proposal Requestor to the Approver.
-- If the Approver = Requestor, return result Y (Yes)
-- If the Approver <>Requestor, return result N (No)
--
-- IN
-- itemtype - type of the current item
-- itemkey - key of the current item
-- actid - process activity instance id
-- funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...)
-- OUT
-- resultout
-- - COMPLETE[:<result>]
-- activity has completed with the indicated result
-- - WAITING
-- activity is waiting for additional transitions
-- - DEFERED
-- execution should be deferred to background
-- - NOTIFIED[:<notification_id>:<assigned_user>]
-- activity has notified an external entity that this
--
--
step must be performed. A call to wf_engine.CompleteActivity
will signal when this step is complete. Optional
m y
--
--
return of notification ID and assigned user.
- ERROR[:<error_code>]
d e
-- function encountered an error.
procedure CHECK_APPROVER(
ca
itemtype in varchar2,

e A
itemkey
actid
in varchar2,
in number,
c l
funcmode in varchar2,
resultout in out varchar2);
r a
O ly
--
--
PROCEDURE SELECTOR

l & On
--
a e
Examines the value of item attribute TIMEOUT_CHOICE to select

n
--
--
--
which process to run

e r s
If TIMEOUT_CHOICE = LOOP COUNTER, then run WFVACXX_PROCESS

t U
If TIMEOUT_CHOICE = SELF LOOP, then run WFVACXX_ALTERNATE_PROCESS
--
I n
e
-- IN
--

c l
itemtype - type of the current item

a
-- itemkey - key of the current item

O r--
--
--
actid
command
OUT
-
-
process activity instance id
execution mode ('RUN', 'SET_CTX','TEST_CTX',...)

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 12
-- resultout
-- - name of process to run
-- - ERROR[:<error_code>]
-- function encountered an error.
procedure SELECTOR(
itemtype in varchar2,
itemkey in varchar2,
actid in number,
command in varchar2,
resultout in out varchar2);

end WFVACXX;
/

show errors package WFVACXX


commit;
--exit;

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 13
wfvacxxb.sql

m y
d e
ca
wfvacxxb.sql
e A
c l
/*=======================================================================+

|
r a
| Copyright (c) 1995 Oracle Corporation Redwood Shores, California, USA|
All rights reserved. |

O ly
+=======================================================================+
| FILENAME
| wfvacxxb.sql
l & On
|

n a e
| DESCRIPTION
|
e r s
CLASS SAMPLE PL/SQL spec for package WFVACXX

t U
n
|
| NOTES
|
e I
This file is a SAMPLE that should be modified with your own
|

c l
names and procedures before installing.

r a
|
|
The script is written so that you can simply replace XX with the
unique number assigned to your station.

O |
| It may be convenient to use the following naming standard

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 14
| - package name is equivalent to the item type internal name
| - procedure names are equivalent to the workflow activity
| internal name that the procedure implements.
*=======================================================================*/

whenever sqlerror exit failure rollback;

create or replace package body WFVACXX as


/* $Header$ */

-- PROCEDURE SCHEDULE_UPDATE
--
-- Insert a row into an employee based vacation schedule table
--
-- IN
-- itemtype - type of the current item
-- itemkey - key of the current item
-- actid - process activity instance id
-- funcmode - function execution mode. this is set by the engine
-- as either 'RUN', 'CANCEL', 'TIMEOUT'
-- OUT
--
--
resultout
- COMPLETE[:<result>]
m y
--
--
activity has completed with the indicated result
- WAITING
d e
--
--
activity is waiting for additional transitions
- DEFERED
ca
-- execution should be deferred to background

e A
--
--
c l
- NOTIFIED[:<notification_id>:<assigned_user>]
activity has notified an external entity that this
--
--
r a
step must be performed. A call to wf_engine.CompleteActivity
will signal when this step is complete. Optional
--
O ly
return of notification ID and assigned user.
--
--
- ERROR[:<error_code>]

l & On
function encountered an error.
procedure SCHEDULE_UPDATE(

n a e
itemkey
actid e r
itemtype in varchar2,
in varchar2,

t
in number,
U s
I n
funcmode in varchar2,

e
resultout in out varchar2)
is

c l
a
lrequestor_username varchar2(30);

O r lapprover_username
lfrom_date
lto_date
varchar2(30);
date;
date;

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 15
begin

--
-- RUN mode - normal process execution
--
if (funcmode = 'RUN') then

-- retrieve requestor, approver, from, and to dates


lrequestor_username := wf_engine.GetItemAttrText(itemtype => itemtype,
itemkey => itemkey,
aname => 'REQUESTOR');
lapprover_username := wf_engine.GetItemAttrText(itemtype => itemtype,
itemkey => itemkey,
aname => 'APPROVER');
lfrom_date := wf_engine.GetItemAttrDate(itemtype => itemtype,
itemkey => itemkey,
aname => 'FROM_DATE');
lto_date := wf_engine.GetItemAttrDate(itemtype => itemtype,
itemkey => itemkey,
aname => 'TO_DATE');

-- insert row into vacation schedule table


m y
insert into WFVACXX_VACATION_SCHEDULE
(REQUESTOR_USERNAME,
d e
APPROVER_USERNAME,
FROM_DATE,
ca
TO_DATE)

e A
values (lrequestor_username,
lapprover_username,
c l
lfrom_date,
lto_date);
r a
O ly
-- no result needed

l & On
resultout := wf_engine.eng_completed||':'||wf_engine.eng_null;
return;

n a e
end if;

t e r U s
--
I n
e
-- CANCEL mode - activity 'compensation'
--

c l
a
-- This is in the event that the activity must be undone,

O r --
--
--
for example when a process is reset to an earlier point
due to a loop back.

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 16
if (funcmode = 'CANCEL') then

-- retrieve requestor, approver, from, and to dates


lrequestor_username := wf_engine.GetItemAttrText(itemtype => itemtype,
itemkey => itemkey,
aname => 'REQUESTOR');
lapprover_username := wf_engine.GetItemAttrText(itemtype => itemtype,
itemkey => itemkey,
aname => 'APPROVER');
lfrom_date := wf_engine.GetItemAttrDate(itemtype => itemtype,
itemkey => itemkey,
aname => 'FROM_DATE');
lto_date := wf_engine.GetItemAttrDate(itemtype => itemtype,
itemkey => itemkey,
aname => 'TO_DATE');

-- delete row from vacation schedule table


delete from WFVACXX_VACATION_SCHEDULE
where REQUESTOR_USERNAME = lrequestor_username
and APPROVER_USERNAME = lapprover_username
and FROM_DATE = lfrom_date
and TO_DATE = lto_date;
m y
-- no result needed
d e
resultout := wf_engine.eng_completed||':'||wf_engine.eng_null;
return;
ca
end if;

e A
c l
--

r a
-- Other execution modes may be created in the future. Your

O ly
-- activity will indicate that it does not implement a mode
-- by returning null
--
l & On
a e
resultout := wf_engine.eng_null;

n
return;

exception
t e r U s
I
when others then
n
e
-- The line below records this function call in the error system

c l
-- in the case of an exception.

a
wf_core.context('WFVACXX', 'SCHEDULE_UPDATE',

O r raise;
end SCHEDULE_UPDATE;
itemtype, itemkey, to_char(actid), funcmode);

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 17
-- PROCEDURE NTF_VACATION_PROPOSAL
--
-- <describe the activity here>
--
-- IN
-- itemtype - type of the current item
-- itemkey - key of the current item
-- actid - process activity instance id
-- funcmode - post-notification function execution mode
-- ('RESPOND','FORWARD','TRANSFER','RUN', 'CANCEL', 'TIMEOUT')
-- OUT
-- resultout
-- - COMPLETE[:<result>]
-- activity has completed with the indicated result
-- - WAITING
-- activity is waiting for additional transitions
-- - DEFERED
-- execution should be deferred to background
-- - NOTIFIED[:<notification_id>:<assigned_user>]
-- activity has notified an external entity that this
--
--
step must be performed. A call to wf_engine.CompleteActivity
will signal when this step is complete. Optional
m y
--
--
return of notification ID and assigned user.
- ERROR[:<error_code>]
d e
-- function encountered an error.
procedure NTF_VACATION_PROPOSAL(
ca
itemtype in varchar2,

e A
itemkey
actid
in varchar2,
in number,
c l
funcmode in varchar2,
resultout in out varchar2)
r a
is
O ly
nid
ntf_responder
number;

l & On
varchar2(30);
ntf_result
a e
varchar2(30);

n
ntf_alt_to_date

t e r
ntf_alt_from_date date := '';

s
date := '';

U
begin
I n
--

c l e
a
-- RESPOND mode - recipient has supplied a response to the notification

O r --
if (funcmode = 'RESPOND') then

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 18
-- get notification id and responder from wf_engine context variables
nid := WF_ENGINE.CONTEXT_NID;
ntf_responder := WF_ENGINE.CONTEXT_TEXT;

-- if the approver rejects the vacation proposal then he/she must


-- provide an alternate date window

-- retrieve the notification result


ntf_result := wf_notification.GetAttrText(nid,'RESULT');
if (ntf_result = 'REJECTED') then

-- retrieve the alternate vacation dates


ntf_alt_from_date :=
wf_notification.GetAttrDate(nid,'ALT_FROM_DATE');

ntf_alt_to_date :=
wf_notification.GetAttrDate(nid,'ALT_TO_DATE');

if (ntf_alt_from_date is null
or ntf_alt_to_date is null) then
-- raise an error
resultout := wf_engine.eng_error||':'||wf_engine.eng_null;
wf_core.Raise('Provide Alternate Dates');
m y
return;
end if;
d e
if (ntf_alt_from_date > ntf_alt_to_date) then
-- raise an error
ca
resultout := wf_engine.eng_error||':'||wf_engine.eng_null;

e A
return;
c l
wf_core.Raise('From Date before To Date');

end if;
end if;
r a
O ly
resultout := wf_engine.eng_completed||':'||ntf_result;
return;
end if;
l & On
n a e
--

e r s
-- TRANSFER mode - recipient attempting to Transfer notification
--
t U
I n
if (funcmode = 'TRANSFER') then

c l e
-- don't allow transfer

a
-- raise an error

O r resultout := wf_engine.eng_error||':'||wf_engine.eng_null;
wf_core.Raise('Transfer not allowed');
return;

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 19
end if;

--
-- FORWARD mode - recipient attempting to Delegate notification
--
if (funcmode = 'FORWARD') then

-- delegate allowed
null;
-- set resultout to null to indicate that the mode is not implemented
resultout := wf_engine.eng_null;
return;
end if;

--
-- RUN mode - in post-notification function, response to notification
-- already processed and accepted
--
if (funcmode = 'RUN') then
-- if implemented, your run code goes here
null;
-- set resultout to null to indicate that the mode is not implemented
resultout := wf_engine.eng_null;
m y
return;
end if;
d e
--
ca
-- TIMEOUT mode - recipient has allowed the notification to timeout

e A
--
if (funcmode = 'TIMEOUT') then
c l
r a
-- if implemented, your timeout code goes here
null;

O ly
-- set resultout to null to indicate that the mode is not implemented

return;
l & On
resultout := wf_engine.eng_null;

end if;

n a e
--
t e r U s
--
I n
CANCEL mode - activity 'compensation'

e
--
--

c l
This is in the event that the activity must be undone,

a
-- for example when a process is reset to an earlier point

O r --
--
if
due to a loop back.

(funcmode = 'CANCEL') then

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 20
-- if implemented, your cancel code goes here
null;
-- set resultout to null to indicate that the mode is not implemented
resultout := wf_engine.eng_null;
return;
end if;

--
-- Other execution modes may be created in the future. Your
-- activity will indicate that it does not implement a mode
-- by returning null
--
resultout := wf_engine.eng_null;
return;

exception
when others then
-- The line below records this function call in the error system
-- in the case of an exception.
wf_core.context('WFVACXX', 'NTF_VACATION_PROPOSAL',

raise;
itemtype, itemkey, to_char(actid), funcmode);

m y
end NTF_VACATION_PROPOSAL;

d e
--
--
PROCEDURE VACATION_SCHEDULED

ca
-- Report vacation scheduled for the current Vacation Proposal requestor

e A
--
-- IN
c l
--
--
document_id -
display_type -
r a
string that uniquely identifies the document
text/html or text/plain
-- OUT
O ly
--
--
document -
document_type- & On
outbound text buffer

l
outbound document type of text/html, text/plain, or ''

n a e
document_id
e r
procedure VACATION_SCHEDULED(
in varchar2,

t
display_type in varchar2,
U s
document
I n
in out varchar2,

e
document_type in out varchar2) is

c l
a
cursor vacation_schedule (xrequestor in varchar2) is

O r select approver_username,
to_char(from_date,'Day DD Month YYYY') from_displayed,
to_char(to_date,'Day DD Month YYYY') to_displayed

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 21
from wfvacxx_vacation_schedule
where requestor_username in
(select name from wf_users
where display_name = xrequestor)
order by from_date, to_date;

begin
if display_type = 'text/html' then
document_type := 'text/html';
document :=
'<BR><BR><LEFT><TABLE BORDER CELLPADDING=5 BGCOLOR=#FFFFFF>'||
'<TR BGCOLOR=#83C1C1>'||
'<TH>From Date</TH>'||
'<TH>To Date</TH>'||
'<TH>Approver</TH>'||
'</TR>';
else
document_type := 'text/plain';
document :=
chr(10)||rpad('From Date',28)||
rpad('To Date',28)||
rpad('Approver',30)||
chr(10);
m y
end if;

d e
-- build table body with data
for schedule_rec in vacation_schedule(document_id) loop
ca
if display_type = 'text/html' then

e A
document := document||
'<TR>'||
c l
r a
'<TD>'||schedule_rec.from_displayed||'</TD>'||
'<TD>'||schedule_rec.to_displayed||'</TD>'||
'<TD>'||
O ly
||'</TD>'||
l & On
wf_directory.getroledisplayname(schedule_rec.approver_username)

'</TR>';

n a e
else

e r
document := document||

t U s
rpad(schedule_rec.from_displayed,28)||

I n
rpad(schedule_rec.to_displayed,28)||

e
rpad(

c l wf_directory.getroledisplayname(schedule_rec.approver_username)

a
,30)||

O r chr(10);
end if;
end loop;

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 22
-- close the table
if display_type = 'text/html' then
document := document||
'</TABLE></LEFT><BR>';
end if;

return;

exception
when others then
-- The line below records this procedure call in the error system
-- in the case of an exception.
wf_core.context('WFVACXX', 'VACATION_SCHEDULED',
document_id, display_type);
raise;
end VACATION_SCHEDULED;

-- PROCEDURE CHECK_APPROVER
--
-- Compares the value of the Vacation Proposal Requestor to the Approver.
-- If the Approver = Requestor, return result Y (Yes)
-- If the Approver <>Requestor, return result N (No)
m y
--
-- IN
d e
--
--
itemtype - type of the current item
itemkey - key of the current item
ca
-- actid - process activity instance id

e A
--
l
funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...)
-- OUT
c
--
--
resultout
- COMPLETE[:<result>]
r a
--
O ly
activity has completed with the indicated result
--
--
- WAITING

l & On
activity is waiting for additional transitions
-- - DEFERED

n a e
--
--
--
r
execution should be deferred to background

e s
- NOTIFIED[:<notification_id>:<assigned_user>]

t U
activity has notified an external entity that this
--
I n
step must be performed. A call to wf_engine.CompleteActivity

e
-- will signal when this step is complete. Optional
--

c l return of notification ID and assigned user.

a
-- - ERROR[:<error_code>]

O r-- function encountered an error.


procedure CHECK_APPROVER(
itemtype in varchar2,

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 23
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout in out varchar2)
is
lrequestor_username varchar2(30);
lapprover_username varchar2(30);
wf_yes varchar2(1) := 'Y';
wf_no varchar2(1) := 'N';
begin

--
-- RUN mode - normal process execution
--
if (funcmode = 'RUN') then

-- retrieve requestor, approver


lrequestor_username := wf_engine.GetItemAttrText(itemtype => itemtype,
itemkey => itemkey,
aname => 'REQUESTOR');
lapprover_username := wf_engine.GetItemAttrText(itemtype => itemtype,
itemkey => itemkey,
aname => 'APPROVER');
m y
if lrequestor_username <> lapprover_username then
d e
resultout := wf_engine.eng_completed||':'||wf_no;
else
ca
resultout := wf_engine.eng_completed||':'||wf_yes;

e A
end if;
return;
c l
end if;

r a
O ly
--
--
l & On
CANCEL mode - activity 'compensation'
--

n a e
--
--
--
r
This is in the event that the activity must be undone,

e s
for example when a process is reset to an earlier point

t
due to a loop back.
U
--
I n
e
if (funcmode = 'CANCEL') then

c l
a
-- no result needed

O r resultout := wf_engine.eng_completed||':'||wf_engine.eng_null;
return;
end if;

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 24
--
-- Other execution modes may be created in the future. Your
-- activity will indicate that it does not implement a mode
-- by returning null
--
resultout := wf_engine.eng_null;
return;

exception
when others then
-- The line below records this function call in the error system
-- in the case of an exception.
wf_core.context('WFVACXX', 'CHECK_APPROVER',
itemtype, itemkey, to_char(actid), funcmode);
raise;
end CHECK_APPROVER;

-- PROCEDURE SELECTOR
--
-- Examines the value of item key to select
-- which process to run.
m y
-- If the first four characters of itemkey:
-- is 'CNTR', then run WFVACXX_PROCESS
d e
-- is 'SELF', then run WFVACXX_ALTERNATE_PROCESS
-- Note: This logic is contrived for class practice only.
ca
-- The selector function is expected to use the itemkey as

e A
--
--
c l
the primary key to retrieve supporting application data.
The Application data retrieved would be used to determine
--
--
r a
which process is appropriate to start.

-- IN
O ly
--
-- itemkey
l & On
itemtype - type of the current item
- key of the current item
-- actid
a e
- process activity instance id

n
-- command
-- OUT
-- resultout
t e r
- execution mode ('RUN', 'SET_CTX','TEST_CTX',...)

U s
--
I n
- name of process to run

e
-- - ERROR[:<error_code>]
--

c l function encountered an error.

a
procedure SELECTOR(

O r itemtype in varchar2,
itemkey
actid
in varchar2,
in number,

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 25
command in varchar2,
resultout in out varchar2)
is
litemkey varchar2(30) := itemkey;
begin

--
-- RUN mode - determine which process to run
--
if (command = 'RUN') then

if UPPER(substr(litemkey,1,4)) = 'CNTR' then


resultout := 'WFVACXX_PROCESS';
elsif UPPER(substr(litemkey,1,4)) = 'SELF' then
resultout := 'WFVACXX_ALTERNATE_PROCESS';
else
resultout := wf_engine.eng_error||':'||wf_engine.eng_null;
wf_core.Raise('Invalid item key');
end if;
return;
end if;

m y
--
-- SET_CTX mode
d e
--
if (command = 'SET_CTX') then
ca
e A
-- no result needed
resultout := wf_engine.eng_null;
c l
return;
end if;
r a
O ly
if (command = 'TEXT_CTX') then

l & On
-- no result needed

n a e
return;
end if;
t e r
resultout := wf_engine.eng_null;

U s
I n
e
--

c l
-- Other execution modes may be created in the future. Your

a
-- selector will indicate that it does not implement a mode

O r -- by returning null
--
resultout := wf_engine.eng_null;

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 26
return;

exception
when others then
-- The line below records this function call in the error system
-- in the case of an exception.
wf_core.context('WFVACXX', 'SELECTOR',
itemtype, itemkey, to_char(actid), command);
raise;
end SELECTOR;

end WFVACXX;
/

show errors package body WFVACXX


commit;
--exit;

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 27
wfvacxxd.sql

m y
d e
ca
wfvacxxd.sql
e A
c l
r a
/*=======================================================================+

O ly
| Copyright (c) 1995 Oracle Corporation Redwood Shores, California, USA|
| All rights reserved. |

| FILENAME
l & On
+=======================================================================+

| wfvacxxd.sql

n a e
|
| DESCRIPTION

t e r U s
| NOTES
I n
| Drop Workflow Vacation Schedule index, table and package.

|
|
l e
This file is a SAMPLE that should be modified with your own

c
names before installing. Names that include

r a
|
|
XX should be replaced with values for your implementation.

O *=======================================================================*/

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 28
/* $Header$ */
whenever sqlerror continue;
--
drop index WFVACXX_VACATION_SCHEDULE_N1;
--
drop table WFVACXX_VACATION_SCHEDULE;
--
drop package WFVACXX;

commit;

--exit

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 29
wfslctxx.sql

m y
d e
ca
wfslctxx.sql
e A
c l
r a
/*=======================================================================+

O ly
| Copyright (c) 2004 Oracle Corporation Redwood Shores, California, USA|
| All rights reserved. |

| FILENAME
l & On
+=======================================================================+

| wfslctxx.sql

n a e
|
| DESCRIPTION

t e r U s
|
I n
| Launch three work items without specifying the process to start,
to test the selector function in the Defining a Selector Function
|
|
l e
practice

c
r a
| NOTES
| This file is a SAMPLE that should be modified with your own

O | values before running. Names that include

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 30
| XX should be replaced with values for your implementation.
| Additionally, you should replace the following with appropriate
| values for your tests:
|
| <requestor_username> - Vacation requestor
| <approver_username> - Vacation approver
| <from_date> - Vacation from date
| <to_date> - Vacation to date
|
*=======================================================================*/

/* $Header$ */
whenever sqlerror continue;

--
-- Create and start a work item with an item key that begins with CNTR
--

Exec WF_ENGINE.CreateProcess('WFVACXX', 'CNTR211XX');

Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'CNTR211XX', 'REQUESTOR',


'<requestor_username>');

m y
Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'CNTR211XX', 'APPROVER',
'<approver_username>');
d e
Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'CNTR211XX', 'FROM_DATE',
ca
'<from_date>');

e A
'<to_date>');
c l
Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'CNTR211XX', 'TO_DATE',

r a
Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'CNTR211XX', 'VACEVENTKEY',
'211XXE1');
O ly
l & On
Exec WF_ENGINE.StartProcess('WFVACXX', 'CNTR211XX');

n a e
r
--

--
t e U s
-- Create and start a work item with an item key that begins with SELF

I n
e
Exec WF_ENGINE.CreateProcess('WFVACXX', 'SELF211XX');

c l
a
Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'SELF211XX', 'REQUESTOR',

O r '<requestor_username>');

Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 31
Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'SELF211XX', 'APPROVER',
'<approver_username>');

Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'SELF211XX', 'FROM_DATE',


'<from_date>');

Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'SELF211XX', 'TO_DATE',


'<to_date>');

Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'SELF211XX', 'VACEVENTKEY',


'211XXE2');

Exec WF_ENGINE.StartProcess('WFVACXX', 'SELF211XX');

--
-- Create and start a work item with an item key that begins with TEST
--
-- If you use the selector function provided in the sample solutions,
-- the CreateProcess procedure should return a ORA-20002: [Invalid itemkey]
-- error, and the following procedures should also error out
-- because the work item does not exist.
--

Exec WF_ENGINE.CreateProcess('WFVACXX', 'TEST211XX');


m y
Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'TEST211XX', 'REQUESTOR',
d e
'<requestor_username>');

ca
Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'TEST211XX', 'APPROVER',

e A
l
'<approver_username>');

a c
Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'TEST211XX', 'FROM_DATE',
'<from_date>');
r
O ly
Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'TEST211XX', 'TO_DATE',
'<to_date>');

l & On
n a e
Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'TEST211XX', 'VACEVENTKEY',
'211XXE3');

t e r U s
n
Exec WF_ENGINE.StartProcess('WFVACXX', 'TEST211XX');

--
e I
commit;

c l
r a
--exit

O
Copyright © Oracle, 2007. All rights reserved.

Sample Solutions
Chapter 30 - Page 32

You might also like