oracle workflow student guide

436

Click here to load reader

Upload: lingesh6b

Post on 26-Dec-2015

197 views

Category:

Documents


25 download

TRANSCRIPT

Page 1: Oracle Workflow Student Guide

Oracle WorkflowStudent Guide

14467GC10

Production 1.0

July 2000

M0-11868

Page 2: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

This documentation contains proprietary information of Oracle Corporation. It is provided under a licenseagreement containing restrictions on use and disclosure and is also protected by copyright law. Reverseengineering of the software is prohibited. If this documentation is delivered to a U.S. Government Agency of theDepartment of Defense, then it is delivered with Restricted Rights and the following legend is applicable:

Restricted Rights Legend

Use, duplication or disclosure by the Government is subject to restrictions for commercial computer softwareand shall be deemed to be Restricted Rights software under Federal law, as set forth in subparagraph (c)(1)(ii)of DFARS 252.227-7013, Rights in Technical Data and Computer Software (October 1988).

This material or any portion of it may not be copied in any form or by any means without the express priorwritten permission of the Education Products group of Oracle Corporation. Any other copying is a violation ofcopyright law and may result in civil and/or criminal penalties.

If this documentation is delivered to a U.S. Government Agency not within the Department of Defense, then it isdelivered with “Restricted Rights,” as defined in FAR 52.227-14, Rights in Data-General, including Alternate III(June 1987).

The information in this document is subject to change without notice. If you find any problems in thedocumentation, please report them in writing to Worldwide Education Services, Oracle Corporation, 500 OracleParkway, Box SB-6, Redwood Shores, CA 94065. Oracle Corporation does not warrant that this document iserror-free.

Oracle and all references to Oracle Products are trademarks or registered trademarks of Oracle Corporation.

All other products or company names are used for identification purposes only, and may be trademarks of theirrespective owners.

Authors

Paula Baldock

Robin Seiden

Technical Contributors and Reviewers

Siu Chang

Kevin Hudson

Clara Jaeckel

Page 3: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsi

Table of Contents

Oracle Workflow Release 2.5 Introduction .........................................................................1-1Oracle Workflow Release 2.5 ..............................................................................................1-2Objectives ............................................................................................................................1-3Agenda.................................................................................................................................1-4Overview .............................................................................................................................1-5

Why Workflow?.....................................................................................................................2-1Why Workflow? ..................................................................................................................2-2Objectives ............................................................................................................................2-3All Businesses Must Become E-Businesses .......................................................................2-4Oracle Workflow .................................................................................................................2-5Workflow Driven Business Processes .................................................................................2-6Example Workflow Processes .............................................................................................2-7Designing Business Processes for Change...........................................................................2-8Workflow is Essential..........................................................................................................2-9Expense Report Processing..................................................................................................2-10Common Expense Reports Questions..................................................................................2-11Expense Report Processing..................................................................................................2-13Expense Report Processing @ Oracle .................................................................................2-14New Hire Processing ...........................................................................................................2-15New Hire Process @ Oracle ................................................................................................2-16Workflow Enabled e-business Suite ....................................................................................2-20Workflow.............................................................................................................................2-22

Overview of Oracle Workflow..............................................................................................3-1Overview of Oracle Workflow ............................................................................................3-2Objectives ............................................................................................................................3-3Overview .............................................................................................................................3-4Workflow Architecture ........................................................................................................3-5Oracle Workflow Features and Definitions .........................................................................3-6Oracle Workflow Builder ....................................................................................................3-7Workflow Process Definition ..............................................................................................3-8Supported Process Constructs..............................................................................................3-9Workflow Engine.................................................................................................................3-11Workflow Definitions Loader..............................................................................................3-12Notification System .............................................................................................................3-13Notification Worklist Web Page..........................................................................................3-14Notification Details Web Page ............................................................................................3-15Email Notifications..............................................................................................................3-16Email Notifications - Response Template ...........................................................................3-17Directory Services ...............................................................................................................3-18Oracle Workflow Monitor ...................................................................................................3-19Demonstration......................................................................................................................3-22

Planning a Workflow Process...............................................................................................4-1Planning a Workflow Process..............................................................................................4-2Objectives ............................................................................................................................4-3Process Components............................................................................................................4-4Oracle Workflow Builder ....................................................................................................4-5Oracle Workflow Builder (continued) .................................................................................4-6Planning a Workflow Process..............................................................................................4-7Planning a Workflow Process (continued) ..........................................................................4-8Activities and Lookup Types...............................................................................................4-9

Page 4: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsii

Creating a New Process from Bottom Up............................................................................4-11Creating a New Process from Top Down ............................................................................4-12Demonstration......................................................................................................................4-13

Defining Item Types, Item Attributes, and Lookup Types ................................................5-1Defining Item Types, Item Attributes, and Lookup Types ..................................................5-2Objectives ............................................................................................................................5-3Create a New Workflow Process Definition........................................................................5-4Top-Down Design ...............................................................................................................5-5Quick Start Wizard ..............................................................................................................5-6Quick Start Wizard (Continued) ..........................................................................................5-7Define an Item Type ............................................................................................................5-9Item Type Selector/Callback Function ................................................................................5-10Define Item Type Attributes ................................................................................................5-11Define Item Type Attributes (continued).............................................................................5-12Form Attributes....................................................................................................................5-14Document Attributes............................................................................................................5-15URL Attributes ....................................................................................................................5-16Activities and Lookup Types...............................................................................................5-17Define Lookup Types ..........................................................................................................5-18Define Lookup Codes ..........................................................................................................5-19

Defining a Notification Activity ............................................................................................6-1Defining a Notification Activity ..........................................................................................6-2Objectives ............................................................................................................................6-3Workflow Terms..................................................................................................................6-4Create a New Workflow Process Definition........................................................................6-5Define a Message.................................................................................................................6-6Define a Message (Continued) ............................................................................................6-7Define a Message Attribute .................................................................................................6-8Define a Respond Attribute .................................................................................................6-9Respond Attributes in an E-mail Notification......................................................................6-10Respond Attributes in the Notifications Web Page .............................................................6-11Define a Notification Activity .............................................................................................6-12Standard PL/SQL API for Calling Functions ......................................................................6-13Execution Modes .................................................................................................................6-14Standard Voting Activity .....................................................................................................6-16Define Notification Activity Details ....................................................................................6-17Define a Dynamic Priority for a Notification ......................................................................6-18Practice Les 6-1 Overview...................................................................................................6-19Practice Les 6-1 Overview Continued .................................................................................6-20Guided Practice Les 6-1: Planning a Notification Only Process .........................................6-21Guided Practice Les 6-1: Using the Quick Start Wizard .....................................................6-22Guided Practice Les 6-1: Designing a Process Top Down ..................................................6-23Guided Practice Les 6-1: Creating Supporting Item Attributes ...........................................6-24Guided Practice Les 6-1: Creating Supporting Messages....................................................6-25Guided Practice Les 6-1: Creating Supporting Messages Continued ..................................6-26Guided Practice Les 6-1: Setting Selected Node Properties ................................................6-27Guided Practice Les 6-1: Saving Your Process ...................................................................6-28Les 6-1 Summary.................................................................................................................6-29

Overview of the Workflow Directory Service .....................................................................7-1Overview of the Workflow Directory Service.....................................................................7-2Objectives ............................................................................................................................7-3Terms...................................................................................................................................7-4Directory Service Views......................................................................................................7-5WF_USERS View ...............................................................................................................7-6WF_USERS View (continued) ............................................................................................7-7

Page 5: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsiii

WF_ROLES View...............................................................................................................7-8WF_ROLES View (continued)............................................................................................7-9WF_USER_ROLES View...................................................................................................7-10WF_USER_ROLES View (continued)................................................................................7-11Oracle Workflow Local Tables............................................................................................7-12Implementing Global User Preferences ...............................................................................7-13User Preference Information................................................................................................7-14Ad Hoc Users/Roles ............................................................................................................7-15Directory Service for Oracle Applications...........................................................................7-16Directory Services for Oracle Workflow Standalone Version.............................................7-17

Defining Function and Process Activities ............................................................................8-1Defining Function and Process Activities............................................................................8-2Objectives ............................................................................................................................8-3Create a New Workflow Process Definition........................................................................8-4Define a Function Activity ..................................................................................................8-5Assigning a Cost to a Function Activity ..............................................................................8-7Standard PL/SQL API for Calling Functions ......................................................................8-8Execution Modes .................................................................................................................8-9Notification Activities Revisited .........................................................................................8-10Execution Modes .................................................................................................................8-13Post-Notification Function...................................................................................................8-15Exception Handling .............................................................................................................8-16Exception Handling Example ..............................................................................................8-17Defining a Function Activity Attribute................................................................................8-18Defining a Process Activity .................................................................................................8-19Defining Activity Details.....................................................................................................8-20Looping................................................................................................................................8-21Self-Looping Transitions .....................................................................................................8-23Default Error Process...........................................................................................................8-24Error Handling.....................................................................................................................8-25Error Handling (Continued).................................................................................................8-26Practice Les 8-1 Overview...................................................................................................8-27Practice Les 8-1 Overview Continued .................................................................................8-28Guided Practice Les 8-1 Creating a Vacation Schedule Table ............................................8-29Guided Practice Les 8-1 Creating a PL/SQL Procedure......................................................8-30Guided Practice Les 8-1 RUN processing ...........................................................................8-31Guided Practice Les 8-1 CANCEL processing....................................................................8-32Guided Practice Les 8-1 Adding a Function Activity..........................................................8-33Guided Practice Les 8-1 Adding a Function Activity Continued ........................................8-34Les 8-1 Summary.................................................................................................................8-35Practice Les 8-2 Overview Optional....................................................................................8-36Practice Les 8-2 Overview Continued .................................................................................8-37Guided Practice Les 8-2 Creating a PL/SQL Procedure.....................................................8-39Guided Practice Les 8-2 RESPOND processing..................................................................8-40Guided Practice Les 8-2 RESPOND processing continued .................................................8-41Guided Practice Les 8-2 FORWARD processing...............................................................8-43Guided Practice Les 8-2 FORWARD, RUN, TIMEOUT processing.................................8-44Guided Practice Les 8-2 Adding a Post-Notification Function............................................8-45Les 8-2 Summary.................................................................................................................8-46

Diagramming a Workflow Process.......................................................................................9-1Diagramming a Workflow Process......................................................................................9-2Objectives ............................................................................................................................9-3Create a New Workflow Process Definition........................................................................9-4Loading Roles......................................................................................................................9-5Diagramming a Process .......................................................................................................9-6

Page 6: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsiv

Quick Start Wizard ..............................................................................................................9-7Diagramming a Process (continued)....................................................................................9-8Show Label in Designer Menu Option ................................................................................9-9Display Modes .....................................................................................................................9-10Diagramming a Process (continued)....................................................................................9-11Self-Looping Transitions .....................................................................................................9-13<Any> Transitions ...............................................................................................................9-14Top Down Design................................................................................................................9-15Validation Performed by the Verify Command...................................................................9-17Validation Performed by the Verify Command (continued)................................................9-18Editing a Transition .............................................................................................................9-19Editing a Transition (continued) ..........................................................................................9-20Customizing a Process Node ...............................................................................................9-21Setting Activity Attribute Values.........................................................................................9-22Deleting Item Attributes ......................................................................................................9-23Standard Activities...............................................................................................................9-24Saving the Process Definition..............................................................................................9-25Reviewing the Process Definition........................................................................................9-26Version Compatibility..........................................................................................................9-27Display Name Conflicts.......................................................................................................9-28Practice Les 9-1 Overview...................................................................................................9-29Practice Les 9-1 Overview Continued .................................................................................9-30Guided Practice Les 9-1 Adding a Timeout.........................................................................9-32Guided Practice Les 9-1 Adding a Self-Timeout Transition................................................9-33Guided Practice Les 9-1 Adding a Loop Counter Function Activity...................................9-34Guided Practice Les 9-1 Adding a Loop Counter Function Activity Continued .................9-35Guided Practice Les 9-1 Adding a Timeout transition to Loop Counter ............................9-36Guided Practice Les 9-1 Adding a Timeout transition to Loop Counter Continued...........9-37Guided Practice Les 9-1 Assigning a Process Result and Error Process ............................9-38Guided Practice Les 9-1 Labeling End nodes with Result...................................................9-39Les 9-1 Summary.................................................................................................................9-40

Overview of the Workflow Engine .......................................................................................10-1Overview of the Workflow Engine......................................................................................10-2Objectives ............................................................................................................................10-3Overview of the Workflow Engine......................................................................................10-4Overview of the Workflow Engine (continued) ..................................................................10-5Workflow Engine Features ..................................................................................................10-6Initiating a Workflow Process .............................................................................................10-7Workflow Engine Processing ..............................................................................................10-8Activity Statuses ..................................................................................................................10-9Calling the Workflow Engine ..............................................................................................10-10Oracle Workflow APIs ........................................................................................................10-11Oracle Workflow APIs (continued) .....................................................................................10-12Workflow Engine APIs........................................................................................................10-13Background Engine .............................................................................................................10-18Deferred Processing.............................................................................................................10-20Timed Out Notification Activities .......................................................................................10-21Error Processing...................................................................................................................10-22

Completing Workflow Notification Activities .....................................................................11-1Completing Workflow Notification Activities ....................................................................11-2Objectives ............................................................................................................................11-3Oracle Workflow Home Page..............................................................................................11-4Find Notifications Web Page...............................................................................................11-5Notifications Worklist .........................................................................................................11-6Notification Details..............................................................................................................11-8

Page 7: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsv

Reassigning Notifications ....................................................................................................11-9Launching Oracle Application Forms..................................................................................11-11E-Mail Notification..............................................................................................................11-12E-Mail Notification (continued) ..........................................................................................11-14E-Mail Summary of Notifications .......................................................................................11-15Automatic Notification Processing ......................................................................................11-16Listing Notification Processing Rules .................................................................................11-17Creating a New Notification Processing Rule .....................................................................11-18Creating a New Notification Processing Rule (continued) ..................................................11-19

Monitoring Workflow Processes ..........................................................................................12-1Monitoring Workflow Processes .........................................................................................12-2Objectives ............................................................................................................................12-3Workflow Monitor...............................................................................................................12-4Process Title ........................................................................................................................12-5Process Diagram Window ...................................................................................................12-6Detail Tab Window..............................................................................................................12-7Administration Buttons........................................................................................................12-8Application-Controlled Access to the Workflow Monitor...................................................12-9Application-Controlled Access to the Workflow Monitor (Continued) ..............................12-10Direct Access to the Workflow Monitor..............................................................................12-11Find Processes Web Page ....................................................................................................12-12Reviewing the Process List..................................................................................................12-13Reviewing the Notifications List .........................................................................................12-14Filtering Activities in the Activities List .............................................................................12-16Filtering Activities in the Activities List (continued) ..........................................................12-17Child/Parent Instances .........................................................................................................12-18Practice Les 12-1 Overview.................................................................................................12-19Practice Les 12-1 Overview Continued ...............................................................................12-20Guided Practice Les 12-1 Initiating a Work Item................................................................12-21Guided Practice Les 12-1: Monitoring the Results ..............................................................12-22Guided Practice Les 12-1 Timing out Vacation Proposal notification ................................12-23Guided Practice Les 12-1 Testing Schedule Vacation Function..........................................12-24Guided Practice Les 12-1 Testing Schedule Vacation Function Continued ........................12-25Guided Practice Les 12-1 Testing Post-Notification Function ............................................12-26Guided Practice Les 12-1 Testing Post-Notification Function Continued...........................12-27Les 12-1 Summary...............................................................................................................12-28

PL/SQL Documents ...............................................................................................................13-1PL/SQL Documents.............................................................................................................13-2Objectives ............................................................................................................................13-3Integrating PL/SQL Documents in Workflow Processes.....................................................13-4Defining Procedures to Generate a PL/SQL Document ......................................................13-5Defining Procedures to Generate a PL/SQL Document (continued) ...................................13-7PL/SQL Document Attachments .........................................................................................13-8Practice Les 13-1 Overview.................................................................................................13-9Guided Practice Les 13-1 Creating a PL/SQL Document Procedure ..................................13-10Guided Practice Les 13-1 Using a PL/SQL Document Attribute ........................................13-13Guided Practice Les 13-1 Setting a Document Attribute Value ..........................................13-16Guided Practice Les 13-1 Testing a PL/SQL Document (HTML) ......................................13-17Les 13-1 Summary...............................................................................................................13-18Practice Les 13-2 Overview.................................................................................................13-19Guided Practice Les 13-2 Creating a PL/SQL Procedure with Result.................................13-20Guided Practice Les 13-2 RUN processing .........................................................................13-21Guided Practice Les 13-2 CANCEL processing..................................................................13-22Guided Practice Les 13-2 Adding a Function Activity........................................................13-23Guided Practice Les 13-2 Adding a Function Activity Continued ......................................13-24

Page 8: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsvi

Les 13-2 Summary...............................................................................................................13-25

Selector Functions..................................................................................................................14-1Selector Functions ...............................................................................................................14-2Objectives ............................................................................................................................14-3Item Type Selector Function................................................................................................14-4Standard API for the Selector/Callback Function................................................................14-5Standard API for the Selector/Callback Function (continued).............................................14-6Defining a Selector/Callback Function................................................................................14-7Defining a Selector/Callback Function (continued).............................................................14-8Calling a Selector/Callback Function ..................................................................................14-9Practice Les 14-1 Overview.................................................................................................14-10Guided Practice Les 14-1 Duplicating a Process .................................................................14-11Guided Practice Les 14-1 Assigning a Selector Function....................................................14-12Guided Practice Les 14-1 Creating a Selector Procedure ...................................................14-13Guided Practice Les 14-1 RUN processing .........................................................................14-14Guided Practice Les 14-1 Testing a Selector Function........................................................14-15Guided Practice Les 14-1: Monitoring the Results ..............................................................14-16Les 14-1 Summary...............................................................................................................14-17

External System Integration .................................................................................................15-1External System Integration.................................................................................................15-2Objectives ............................................................................................................................15-3Oracle Workflow Terms ......................................................................................................15-4External Function Activity Support .....................................................................................15-5Advanced Queues Processing..............................................................................................15-6Advanced Queue Integration ...............................................................................................15-7Block Activity......................................................................................................................15-14CompleteActivity.................................................................................................................15-15

Forced Synchronous Processing ...........................................................................................16-1Forced Synchronous Processing ..........................................................................................16-2Objectives ............................................................................................................................16-3Forced Synchronous Processes ............................................................................................16-4Process Definition Restrictions............................................................................................16-5Process Definition Restrictions (continued) ........................................................................16-6

Purge.......................................................................................................................................17-1Purge....................................................................................................................................17-2Objectives ............................................................................................................................17-3Purging Obsolete Workflow Data........................................................................................17-4Purging Obsolete Workflow Data in Oracle Applications...................................................17-5Purging Obsolete Workflow Data in Oracle Applications (continued) ...............................17-6Demonstration......................................................................................................................17-7

Document Management Integration ....................................................................................18-1Document Management Integration ....................................................................................18-2Objectives ............................................................................................................................18-3Document Management Integration ....................................................................................18-4Document Management.......................................................................................................18-5Defining Document Management Repositories...................................................................18-6Document Management Integration in Notifications...........................................................18-7Accessing a DM Document Sent by a Notification .............................................................18-8Responding to a Notification with a DM Document ...........................................................18-9

Setting Up Oracle Workflow ................................................................................................19-1Setting Up Oracle Workflow ...............................................................................................19-2Objectives ............................................................................................................................19-3Required Set Up Steps .........................................................................................................19-4

Page 9: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsvii

Step 1 Setting Global User Preferences ...............................................................................19-5Step 2 Setting Up an Oracle Workflow Directory Service ..................................................19-6Step 3 Verifying the WF_LANGUAGES View..................................................................19-7Step 4 Setting the http_proxy Environment Variable ..........................................................19-8Step 5 Setting the WF_RESOURCES Environment Variable.............................................19-9Step 6 Setting Up Background Workflow Engines..............................................................19-10Optional Setup Steps............................................................................................................19-11Optional Step 1 Document Management Repositories .......................................................19-12Optional Step 2 Notification Mailer ....................................................................................19-13Optional Step 2 Notification Mailer Overview....................................................................19-14Optional Step 2 continued Notification Mailer...................................................................19-15Optional Step 2 continued Running the Notification Mailer ..............................................19-16Optional Step 2 continued Notification Mailer Arguments ................................................19-18Optional Step 3 Message Templates....................................................................................19-20Optional Step 3 continued Message Templates ...................................................................19-21Optional Step 4 Workflow Web Page Logo ........................................................................19-22Optional Step 5 Custom Icons .............................................................................................19-23Oracle Workflow Access Protection....................................................................................19-24Access Levels ......................................................................................................................19-25Setting Access Level............................................................................................................19-26Setting Access, Protection, and Customization Levels........................................................19-27Example of Access Protection .............................................................................................19-28Workflow Definitions Loader..............................................................................................19-29Transferring Workflow Definitions: Oracle Workflow Standalone....................................19-30Transferring Workflow Definitions: Oracle Workflow embedded in Oracle Applications 19-32

Master/Detail Coordination Activities .................................................................................20-1Master/Detail Coordination Activities.................................................................................20-2Objectives ............................................................................................................................20-3Master/Detail Coordination Activities.................................................................................20-4Master/Detail Coordination Activities (continued)..............................................................20-5Example of Master Process..................................................................................................20-6Example of Detail Process...................................................................................................20-7

Extra Practices .......................................................................................................................21-1Extra Practices .....................................................................................................................21-2Extra Practice 1 Overview ...................................................................................................21-3Extra Practice 2 Overview ...................................................................................................21-4Extra Practice 3 Overview ...................................................................................................21-5

Page 10: Oracle Workflow Student Guide
Page 11: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsix

Preface

Profile

Before You Begin This Course

Before you begin this course, you should have the following qualifications:

• Thorough knowledge of Oracle8 and/or Oracle 8i and Oracle WebDB,Oracle Web Application Server, and/or Oracle Application Servertechnology; and, if you plan to use Oracle Workflow with OracleApplications, a thorough knowledge of Oracle Applications

• Working experience with PL/SQL

Prerequisites

• Introduction to Oracle: SQL and PL/SQL

• Overview of Oracle Workflow

How This Course Is Organized

Oracle Workflow is an instructor-led course featuring lecture and hands-onexercises. Online demonstrations and written practice sessions reinforce theconcepts and skills introduced.

Page 12: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsx

Related Publications

Oracle Publications

Title Part Number

Oracle Workflow Guide Release 2.5 A75397

Additional Publications

• System release bulletins

• Installation and user’s guides

• read.me files

• Oracle Applications User’s Group (OAUG) articles

• Oracle Magazine

Page 13: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsxi

Typographic Conventions

Typographic Conventions in Text

Convention Element ExampleBold italic Glossary term (if

there is a glossary)The algorithm inserts the new key.

Caps andlowercase

Buttons,check boxes,triggers,windows

Click the Executable button.Select the Can’t Delete Card check box.Assign a When-Validate-Item trigger to theORD block.Open the Master Schedule window.

Courier new,case sensitive(default islowercase)

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

Code output: debug.set (‘I”, 300);Directory: bin (DOS), $FMHOME (UNIX)Filename: Locate the init.ora file.Password: User tiger as your password.Pathname: Open c:\my_docs\projectsURL: Go to http://www.oracle.comUser input: Enter 300Username: Log on as scott

Initial cap Graphics labels(unless the term is aproper noun)

Customer address (but Oracle Payables)

Italic Emphasized wordsand phrases,titles of books andcourses,variables

Do not save changes to the database.For further information, see Oracle7 ServerSQL Language Reference Manual.Enter [email protected],where user_id is the name of the user.

Quotationmarks

Interface elementswith long namesthat have onlyinitial caps;lesson and chaptertitles in cross-references

Select “Include a reusable module component”and click Finish.

This subject is covered in Unit II, Lesson 3,“Working with Objects.”

Uppercase SQL columnnames, commands,functions, schemas,table names

Use the SELECT command to viewinformation stored in the LAST_NAMEcolumn of the EMP table.

Page 14: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsxii

Convention Element ExampleArrow Menu paths Select File—> Save.Brackets Key names Press [Enter].

Commas Key sequences Press and release keys one at a time:[Alternate], [F], [D]

Plus signs Key combinations Press and hold these keys simultaneously:[Ctrl]+[Alt]+[Del]

Typographic Conventions in Code

Convention Element ExampleCaps andlowercase

Oracle Formstriggers

When-Validate-Item

Lowercase Column names,table names

SELECT last_nameFROM s_emp;

Passwords DROP USER scottIDENTIFIED BY tiger;

PL/SQL objects OG_ACTIVATE_LAYER(OG_GET_LAYER

(‘prod_pie_layer’))

Lowercaseitalic

Syntax variables CREATE ROLE role

Uppercase SQL commands andfunctions

SELECT useridFROM emp;

Typographic Conventions in Navigation Paths

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

(N) Invoice > Entry > Invoice Batches Summary (M) Query > Find (B) Approve

This simplified path translates to the following:

1. (N) From the Navigator window, select Invoice > Entry > Invoice BatchesSummary.

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

3. (B) Click the Approve button.

Page 15: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsxiii

Notations :

(N) = Navigator

(M) = Menu

(T) = Tab

(I) = Icon

(H) = Hyperlink

(B) = Button

Typographical Conventions in Help System Paths

This course uses a “navigation path” convention to represent actions you performto 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 GeneralLedger 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 thehelp system window.

Page 16: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Table of Contentsxiv

Page 17: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 IntroductionChapter 1 - Page 1

Oracle Workflow Release 2.5IntroductionChapter 1

Page 18: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 IntroductionChapter 1 - Page 2

Oracle Workflow Release 2.5

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow Release 2.5Oracle Workflow Release 2.5

IntroductionIntroduction

Page 19: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 IntroductionChapter 1 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectivesAfter this course, you should be able to:• Explain why you would use Workflow• Design a workflow process using Oracle Workflow

Builder• Define your Oracle Workflow users and roles• View and respond to notification activities• Monitor and administer the status of a workflow

process• Write custom PL/SQL procedures that can be

executed as automated functions in a workflowprocess

• Set up Oracle Workflow for your site

After this course, you should be able to:• Explain why you would use Workflow• Design a workflow process using Oracle Workflow

Builder• Define your Oracle Workflow users and roles• View and respond to notification activities• Monitor and administer the status of a workflow

process• Write custom PL/SQL procedures that can be

executed as automated functions in a workflowprocess

• Set up Oracle Workflow for your site

Page 20: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 IntroductionChapter 1 - Page 4

Agenda

Copyright Oracle Corporation, 2000. All rights reserved.®

AgendaAgenda

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

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

Page 21: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 IntroductionChapter 1 - Page 5

Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

OverviewOverview

• This course provides detailed information aboutOracle Workflow and its components so that youcan use its technology to workflow-enable anyapplication based on Oracle

• This course provides detailed information aboutOracle Workflow and its components so that youcan use its technology to workflow-enable anyapplication based on Oracle

Page 22: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Oracle Workflow Release 2.5 IntroductionChapter 1 - Page 6

Page 23: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 1

Why Workflow?Chapter 2

Page 24: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 2

Why Workflow?

Copyright Oracle Corporation, 2000. All rights reserved.®

Why Workflow?Why Workflow?

Page 25: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

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

Page 26: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 4

All Businesses Must Become E-Businesses

Copyright Oracle Corporation, 2000. All rights reserved.®

All BusinessesMust Become E-Businesses

All BusinessesMust Become E-Businesses

Streamlined business processes plays a critical rolewith the transformation to e-business

The wiring fore-businessOracle Workflow

Page 27: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 5

Oracle Workflow

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow Oracle Workflow

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

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

The heart of e-business

Page 28: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 6

Workflow Driven Business Processes

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Driven Business ProcessesWorkflow Driven Business Processes

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

process definition• Adapt your processes as your business changes

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

process definition• Adapt your processes as your business changes

Manage the process, not the transactions

Page 29: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 7

Example Workflow Processes

Copyright Oracle Corporation, 2000. All rights reserved.®

Example Workflow ProcessesExample Workflow Processes

Unre s e rve

Clos e - LineCre a te Supply -Line

Sche dule - Line He a de r Le ve lInvoice - Line ,

De fe rre d

Ente r - Line EndShip - Line ,Ma nua l

Line Flow - Generic with Header Level Invoicing

EndHe a de r le ve lInvoice - Orde r

Book - Orde r,Ma nua l

Clos e - Orde rEnte r

Order Flow - Generic with Header Level Invoicing

Page 30: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 8

Designing Business Processes for Change

Copyright Oracle Corporation, 2000. All rights reserved.®

Designing Business Processes forChange

• Business processes will change– No artificial constraints on the business

process– Enabling dynamic processes sympathetic to

change– Change business processes without changing

code (reduced cost of ownership)• Requires visual overview of business processes

– You can only fix what you can see– Visual documentation of the business process

Page 31: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 9

Workflow is Essential

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow is EssentialWorkflow is Essential

• Complete process representation– Crosses organizational, company boundaries– Build in management metrics, performance

goals• Adaptable workflow processes

– Provides alternatives– Allow for refinement

• Analyze time and costs of entire processes withmultidimensional analysis– Reducing costs and time

• Complete process representation– Crosses organizational, company boundaries– Build in management metrics, performance

goals• Adaptable workflow processes

– Provides alternatives– Allow for refinement

• Analyze time and costs of entire processes withmultidimensional analysis– Reducing costs and time

Workflow enables continuous process improvement

Page 32: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 10

Expense Report Processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Expense Report ProcessingExpense Report ProcessingFast and efficient payment of expensereports that conform to corporatepolicyWorkflow enabled Self ServiceExpense Reports

Goal:

Technique:

• Accounts Payables professionals should spendtheir time:– Entering expense reports– Responding to the telephone queries

regarding the status of an expense report– Defining and enforcing corporate policy,

saving the company money

• Accounts Payables professionals should spendtheir time:– Entering expense reports– Responding to the telephone queries

regarding the status of an expense report– Defining and enforcing corporate policy,

saving the company money

Page 33: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 11

Common Expense Reports Questions

Copyright Oracle Corporation, 2000. All rights reserved.®

Common Expense Reports QuestionsCommon Expense Reports Questions

• Has my expense report been approved?• Which manager is holding up my expense report?• Has the Accounts Payable department verified my

receipts?• When will I get paid?• Why am I always short paid?

• Has my expense report been approved?• Which manager is holding up my expense report?• Has the Accounts Payable department verified my

receipts?• When will I get paid?• Why am I always short paid?

Workflow empowers the process participants

Page 34: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 12

Common Expense Reports Questions

Copyright Oracle Corporation, 2000. All rights reserved.®

Common Expense Reports QuestionsCommon Expense Reports Questions

• Has my expense report been approved?• Which manager is holding up my expense?• Has the Accounts Payable department verified my

receipts?• When will I get paid?• Why am I always short paid?

• Has my expense report been approved?• Which manager is holding up my expense?• Has the Accounts Payable department verified my

receipts?• When will I get paid?• Why am I always short paid?

Workflow empowers the process participants

Let’s take a look at the process

Page 35: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 13

Expense Report Processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Expense Report ProcessingExpense Report Processing

Approve d

ShortPa y

AP Approva l

Ma na ge r Approva l

Se rve r Va lida tion Approve

Re je ct

Re submit Re port Abort

AP Approva lProce s s

End (Approve )

End (Re je ct)

Sta rt De te rmineWhich Proce s sTo Sta rt From

Ma na ge r(Spe nding)Approva lProce s s

Re je ctionProce s s

Se rve r SideVa lida tionProce s s

Shortpa yUnve rifie d

Re ce ipt Ite ms

AP Standard Expense Report Process

Page 36: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 14

Expense Report Processing @ Oracle

Copyright Oracle Corporation, 2000. All rights reserved.®

Expense Report Processing @ OracleExpense Report Processing @ Oracle

No

Ye s

No

Ye s

No

Ye s

No

Ye sAP Adjus tme ntMa de Due To

Spe nding PolicyNonComplia nce

Approve d(Automa tic)

Ma rk Expe nseRe port AsApprove d(Ma nua l)

End (ShortPa y)

Sta rt AP Expe ns eRe port Re vie w

Comple te

End (Approve d)

Inform Pre pa re rTha t Expe ns eRe port Ha s

Be e n Adjus te d

Ge t Adjus tme ntTe xt

Any J us tifica tionRe quire d for

Expe nse Re port

Any Re ce iptRe quire d For

Expe nse Re port

Re que s t AP ToRe vie w For

complia nce WithSpe nding Policy

All Expe ns eLine s Pa s s AP

Approva l

Page 37: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 15

New Hire Processing

Copyright Oracle Corporation, 2000. All rights reserved.®

• Hiring Managers should spend their time:– Determining whose approval is required– Chasing the HR department to mail offer

letters– Interviewing candidates, hiring the

best people

• Hiring Managers should spend their time:– Determining whose approval is required– Chasing the HR department to mail offer

letters– Interviewing candidates, hiring the

best people

New Hire ProcessingNew Hire Processing

Empower managers in the hiringEmpower managers in the hiringprocess and hiring the best peopleprocess and hiring the best peopleWorkflow enable Self Service HiringWorkflow enable Self Service Hiring

Goal:

Technique:

Page 38: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 16

New Hire Process @ Oracle

Copyright Oracle Corporation, 2000. All rights reserved.®

New Hire Process @ OracleNew Hire Process @ Oracle

Approve d

Re je cte d

<De fa ult>

Acce pte d

De cline d

Initia lize Offe rProce ss

Obta in Offe rApprova l

Proce s s Offe r

End (De cline d)

End (Acce pte d)

End (De cline d)

End (De cline d)

Enabling e-business at Oracle

Page 39: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 17

New Hire Process @ Oracle

Copyright Oracle Corporation, 2000. All rights reserved.®

New Hire Process @ OracleNew Hire Process @ OracleEnabling e-business at Oracle

Approved

Reje cted

<De fa ult>

Declined

Initia lize Offe rProcess

Obta in Offe rApprova l

Process Offe r

End (Declined)

End (Accepted)

End (De clined)

End (De clined)

Page 40: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 18

New Hire Process @ Oracle

Copyright Oracle Corporation, 2000. All rights reserved.®

New Hire Process @ OracleNew Hire Process @ OracleEnabling e-business at Oracle

Approve d

Re je cte d

<De fa ult>

De cline d

Initia lize Offe rProce ss

Obta in Offe rApprova l

Proce ss Offe r

End (Decline d)

End (Acce pte d)

End (De cline d)

End (De cline d)

Notify Fa cilitie sof Ne w Hire

Page 41: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 19

New Hire Process @ Oracle

Copyright Oracle Corporation, 2000. All rights reserved.®

New Hire Process @ OracleNew Hire Process @ OracleEnabling e-business at Oracle

Approved

Rejected

<Default>

Declined

Accepted

Initia lize Offe rProcess

Obta in Offe rApprova l

Process Offe r

End (Declined)

End (Accepted)

End (Declined)

End (Declined)

Notify Facilitie sof New Hire

Page 42: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 20

Workflow Enabled e-business Suite

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow enabled

Workflow Enabled e-business SuiteWorkflow Enabled e-business Suite

Page 43: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 21

Workflow Enabled e-business Suite

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Enabled e-business SuiteWorkflow Enabled e-business Suite

Self-Service

Professional .Workflow

Workflow enforces a common set of business rules

Page 44: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Why Workflow?Chapter 2 - Page 22

Workflow

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflowis much morethan approvals

WorkflowWorkflow

Page 45: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 1

Overview of Oracle WorkflowChapter 3

Page 46: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 2

Overview of Oracle Workflow

Copyright Oracle Corporation, 2000. All rights reserved.®

Overview of Oracle WorkflowOverview of Oracle Workflow

Page 47: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

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

Page 48: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 4

Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

OverviewOverview

• Routes Information• Defines any rule• Delivers electronic notifications

• Routes Information• Defines any rule• Delivers electronic notifications

Oracle Workflow accomplishes three important business requirements:Routes Information

Routes information through Oracle Application.These attachments include self-service Web page and Application forms.

Defines Any RuleOracle Workflow Builder lets you graphically define the business rules of

your process.PL/SQL lets you express those rules as automated activities.

Delivers Electronic NotificationsDelivers electronic notifications to any Oracle Applications user.Delivers electronic notifications to any e-mail or Internet user.

Page 49: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 5

Workflow Architecture

Copyright Oracle Corporation, 2000. All rights reserved.®

RolesUsers

Directory Services

Notification Services

Send

Respond

Forward

Cancel

Query

Oracle Workflow Enabled Application

Oracle Server

Engine

Execution

Definition

Administration

Monitoring

Query

WorkflowBuilder

WorkflowLoader

WorkflowDefinition

Files

WorkflowDevelopment

Client

OracleApplication

Serveror

WebDB

NotificationMailer

ApplicationServer

WebNotification

Worklist

WebProcessMonitor

WebAnalysis

Tools

End-UserClient

MailApplications

Workflow Architecture Workflow Architecture

Workflow Development ClientThe development client is a PC running Windows95 or Windows NT. It isa platform that will be used to create and modify the Oracle Workflowdefinitions.

Oracle ServerThe Oracle Server platform is the Oracle RDBMS. This hosts the businessapplication, integrated with Oracle Workflow.

Application ServerThe Application Server is the environment outside of the RDBMS. Thisincludes ancillary services such as Oracle Web Application Server,WebDB, and the Notification Mailer.

End-User ClientThe End-User Client is the workstation or PC that the end user uses toperform their daily tasks. This will include support for reviewing andresponding to notifications and using the Oracle Workflow Monitor.

Page 50: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 6

Oracle Workflow Features and Definitions

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow Features and DefinitionsOracle Workflow Features and Definitions

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

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

Page 51: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 7

Oracle Workflow Builder

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow BuilderOracle Workflow Builder

• Development tool for Oracle Workflow– Used to graphically define and customize the

workflow definitions– Requires a PC running Windows 95, 98, 2000

or Windows NT• Workflow definitions: you can save them to a

database or a flat file• There are two parts to the Workflow Builder:

– Object Navigator– Process Diagram

• Development tool for Oracle Workflow– Used to graphically define and customize the

workflow definitions– Requires a PC running Windows 95, 98, 2000

or Windows NT• Workflow definitions: you can save them to a

database or a flat file• There are two parts to the Workflow Builder:

– Object Navigator– Process Diagram

Workflow BuilderSaving the workflow definition on the local file system enables thedesigner to back up their work and provides source control.

Object NavigatorThe Navigator provides a tree structure with the highest level being thedata store. The lower levels are the workflow objects, for example,messages, notifications, functions. All of these objects are organized intotheir respective categories.

Process DiagramThe diagram is built by dragging the objects from the navigator anddropping them onto the process diagram.

Page 52: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 8

Workflow Process Definition

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Process DefinitionWorkflow Process Definition

Oracle Workflow Process DefinitionA workflow process definition must be saved to the same database as theWorkflow Engine.

A process definition is composed of activities and the transitions betweenthem.

A completed application transaction or event can initiate a workflow processfor an item by calling a series of Workflow Engine APIs.

The Workflow Engine locates the ‘Start’ activity in the process definition.The Workflow Engine drives the item through the process, performing all

automated steps until a notification or blocking activity occurs.The Workflow Engine calls the Notification System to deliver the notification

message to an appropriate role.Once a user of that role completes the notification response, the Workflow

Engine continues to drive the item through the remaining activities in theprocess.

If a blocking activity is encountered, the Workflow Engine waits for anexternal program to complete and call the appropriate WorkflowEngine API before it proceeds to the next activity.

The process completes when the Workflow Engine encounters an ‘End’activity.

Page 53: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 9

Supported Process Constructs

Copyright Oracle Corporation, 2000. All rights reserved.®

Supported Process ConstructsSupported Process Constructs

•• LoopingLooping•• Results-basedResults-based

branchingbranching

•• Parallel flowsParallel flows•• RendezvousRendezvous

Workflow EngineThe Workflow Engine supports sophisticated workflow rules including looping,branching, parallel flows and subflows.

Page 54: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 10

Supported Process Constructs

Copyright Oracle Corporation, 2000. All rights reserved.®

Supported Process ConstructsSupported Process Constructs

•• VotingVoting

•• TimeoutsTimeouts–– EscalationEscalation–– AutomaticAutomatic

forwardingforwarding

•• SubprocessesSubprocesses(unlimited(unlimitedhierarchy)hierarchy)

Page 55: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 11

Workflow Engine

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow EngineWorkflow Engine

• Is embedded in the Oracle8i server• Uses the process definition created with Oracle

Workflow Builder to coordinate the routing ofactivities for the process

• Monitors the state of each activity in a workflowprocess

• Signals any changes in the workflow state to theengine using calls to PL/SQL or Java API’s

• Guarantees consistency between the applicationand the workflow state because of Oracle8itransactional integrity

• Is embedded in the Oracle8i server• Uses the process definition created with Oracle

Workflow Builder to coordinate the routing ofactivities for the process

• Monitors the state of each activity in a workflowprocess

• Signals any changes in the workflow state to theengine using calls to PL/SQL or Java API’s

• Guarantees consistency between the applicationand the workflow state because of Oracle8itransactional integrity

Page 56: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 12

Workflow Definitions Loader

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Definitions LoaderWorkflow Definitions Loader

WorkflowBuilder

Oracle 8 or higher

WorkflowEngine

WorkflowLoader

ProcessDefinitions

WorkflowLoader

Process Definition

Loading Workflow DefinitionsWorkflow Definitions Loader is a utility program that lets you transfer processdefinitions between a database and a flat file. The Workflow Definitions Loader:

• Runs on the server machine• Lets you upgrade a database with new versions of process definitions orupload existing process definitions after a database upgrade• Is also integrated into Oracle Workflow Builder• Allows process definitions to be source-controlled as flat files

Page 57: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 13

Notification System

Copyright Oracle Corporation, 2000. All rights reserved.®

Notification SystemNotification System

e.g. UNIX Sendmaile.g. UNIX Sendmailor MAPI compliantor MAPI compliant

Mail SystemMail System

Application

NotificationMailer

OracleApplications

Screens

WorkflowWorklist

WorkflowEngine

NotificationSystem

DirectoryServices

Oracle 8 or higher

Notification System Features• Routes notifications to a role, which can be a single user or group ofusers• Enables users to receive and respond to notifications using an e-mailapplication or Web browser of choice• Allows users with access to the Internet to be included in a workflowprocess• Access to Notification Worklist from Oracle Applications• Enables users to drill down to any URL or Oracle Applications screen torespond to a notification from the Notification Worklist

Page 58: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 14

Notification Worklist Web Page

Notification Worklist Web PageNotification Worklist Web Page

Notification WorklistThe Notification Worklist is a facility that provides a list of the opennotifications to a particular user. The Worklist is viewable through theOracle Workflow Web Agent or through Oracle Applications. You canalso configure the Notification Mailer to send an e-mail summarizing theoutstanding notifications. From the Worklist the user can view thenotifications as well as respond to those that require a response.Viewing Notifications from a Web Page

Requires Oracle WebDB 2.0 or higher, Oracle Web ApplicationServer 3.0.1 or higher, or Oracle Application Server 4.0.7 or higherRequires a Web browser that supports Frames and JavaScript

Note: Notification System has an Oracle Web Agent interface thatdynamically generates the list of notifications for a user.

Page 59: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 15

Notification Details Web Page

Copyright Oracle Corporation, 2000. All rights reserved.®

Notification Details Web PageNotification Details Web Page

Extended HTML message formats

Research and make a decisionthrough online inquiry

Viewing Notifications from a Web PageRequires Oracle WebDB 2.0 or higher, Oracle Web ApplicationServer 3.0.1 or higher, or Oracle Application Server 4.0.7 or higherRequires a Web browser that supports Frames and JavaScript

Note: Notification System has an Oracle Web Agent interface thatdynamically generates each notification for a user.

Page 60: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 16

Email Notifications

Email NotificationsEmail Notifications

Automatic generation ofresponse template

E-Mail Notification OverviewThe Notification System interfaces with the Notification Mailerprogram to send e-mail notifications to users and roles.There are three versions of the Notification Mailer program tointegrate with Oracle InterOffice Messaging Option, UNIXSendmail, or Windows NT MAPI-compliant mail applications.E-mail notifications can be delivered to users on other mailsystems if the appropriate Oracle InterOffice or UNIX gatewaysoftware is also installed.

Page 61: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 17

Email Notifications - Response Template

Copyright Oracle Corporation, 2000. All rights reserved.®

Email Notifications - Response TemplateEmail Notifications - Response Template

Page 62: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 18

Directory Services

Copyright Oracle Corporation, 2000. All rights reserved.®

Directory ServicesDirectory Services

• WF_USERS– Contains information on the user names,

display names for the users, their notificationpreference and their e-mail addresses

• WF_USER_ROLES– Contains information on the association of the

users to the roles• WF_ROLES

– Contains information on the roles of whichusers can be members

• WF_USERS– Contains information on the user names,

display names for the users, their notificationpreference and their e-mail addresses

• WF_USER_ROLES– Contains information on the association of the

users to the roles• WF_ROLES

– Contains information on the roles of whichusers can be members

Directory ServicesThe directory service for Oracle Workflow is implemented as a set ofviews that are mapped across the user tables of the underlying application.The above slide lists the three views.Users can be associated with more than one role and a role may containmore than one user. The Engine and Notification System utilize theDirectory Services to determine who should receive Notifications and inwhat format. Notifications can be delivered to an individual user or to allmembers of a particular role.

Page 63: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 19

Oracle Workflow Monitor

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow MonitorOracle Workflow Monitor

Workflow Monitor Notifications ListDisplays all the current notifications that have been sent for aprocess that require a responseShows the decision makers in the process as well as the currentowner of any outstanding notifications

Note: The Find Processes Web page lets you search for the processinstance to display in the Workflow Monitor Notifications List.Workflow Monitor Requirements

Requires Oracle WebDB 2.0 or above, or Oracle Web ApplicationServer 3.0.1 or above, or Oracle Application Server 4.0.7 or aboveRequires a Web browser that supports Frames, JavaScript, JavaDevelopment Kit (JDK) Version 1.1.4 and Abstract WindowingToolkit (AWT), such as Netscape Communicator 4.04 and aboveor Internet Explorer 4.0 and above

Page 64: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 20

Oracle Workflow Monitor

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow Monitor

Workflow Monitor DiagramThe Workflow Monitor Diagram is a Java applet that displays status informationfor a single workflow process instance.Workflow Monitor Features

• Graphically depicts the status of a workflow process instance in its upperframe• Displays detailed information about individual activities, as well as aboutthe process as a whole in the lower tabbed frame• Runs in “USER” mode to display end-user information or “ADMIN”mode to display administrator information and functionality

Note: The Find Processes web page lets you search for the process instance todisplay in the Workflow Monitor.Workflow Monitor Requirements

• Requires Oracle WebDB 2.0 or above, or Oracle Web ApplicationServer 3.0.1 or above, or Oracle Application Server 4.0.7 or above• Requires a web browser that supports Frames, JavaScript, JavaDevelopment Kit (JDK) Version 1.1.4 and Abstract Windowing Toolkit(AWT), such as Netscape Communicator 4.04 and above or InternetExplorer 4.0 and above

Page 65: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 21

Oracle Workflow Monitor

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow Monitor

Page 66: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of Oracle WorkflowChapter 3 - Page 22

Demonstration

Copyright Oracle Corporation, 2000. All rights reserved.®

DemonstrationDemonstration

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

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

Using Oracle Workflow we will demonstrate how to:Using Oracle Workflow we will demonstrate how to:

Page 67: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 1

Planning a Workflow ProcessChapter 4

Page 68: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 2

Planning a Workflow Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Planning a Workflow ProcessPlanning a Workflow Process

Page 69: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

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

Page 70: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 4

Process Components

Copyright Oracle Corporation, 2000. All rights reserved.®

Process ComponentsProcess ComponentsItem Type

Process

Functions Notifications Subprocesses

...

...

...LookupTypes,

Attributes

Messages,LookupTypes,

Attributes

Functions,Notifications,

LookupTypes

...

Oracle Workflow Process Components• Item Type: A grouping of workflow components. All components of aworkflow process must be associated with a specific item type.• Item Type Attribute: Attributes of the item type that can be globallyreferenced by any activity in a process.• Process Activity: The working diagram of a business process. Includesfunction, notification, and process activities (that represent subprocesses)and the transitions between these activities.• Function Activity: Automated unit of work defined as a PL/SQL storedprocedure.• Notification Activity: Activity that sends a message to a performer.• Message: The message may request the performer, the role receiving themessage, to do some work or may simply provide information.• Lookup Type: List of values that can be referenced by any component.

Page 71: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 5

Oracle Workflow Builder

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow BuilderOracle Workflow Builder

Page 72: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 6

Oracle Workflow Builder (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow Builder (continued)Oracle Workflow Builder (continued)

• Is used to create the components of the process• Consists of a navigator tree which lists all process

components• Groups all components into an Item Type• Each Item Type includes the following branches

– Attributes– Processes (Subprocesses)– Notifications– Functions– Messages– Lookup Types

• Is used to create the components of the process• Consists of a navigator tree which lists all process

components• Groups all components into an Item Type• Each Item Type includes the following branches

– Attributes– Processes (Subprocesses)– Notifications– Functions– Messages– Lookup Types

Page 73: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 7

Planning a Workflow Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Planning a Workflow ProcessPlanning a Workflow Process

1. Identify your business needs2. Identify the activities that will accomplish those

needs. For example:a. What is the activity’s type: Function,

Notification, or Process?b. Will an activity’s result affect the transition that

the Workflow Engine takes? If so, define the activity’s possible results as lookup codes in alookup type

1. Identify your business needs2. Identify the activities that will accomplish those

needs. For example:a. What is the activity’s type: Function,

Notification, or Process?b. Will an activity’s result affect the transition that

the Workflow Engine takes? If so, define the activity’s possible results as lookup codes in alookup type

Page 74: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 8

Planning a Workflow Process (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Planning a Workflow Process (continued)Planning a Workflow Process (continued)

3. Identify how the process will be initiated. Forexample:a. What condition initiates the process? Is it a

completed transaction, a database exception, a button on a form, or some other condition?

b. Will there be an interface to initiate the process? For example, the Web Requisition Approvals process in Oracle Web Employees

4. Identify the possible results of the process. Definethe possible results as lookup codes in a lookup type

3. Identify how the process will be initiated. Forexample:a. What condition initiates the process? Is it a

completed transaction, a database exception, a button on a form, or some other condition?

b. Will there be an interface to initiate the process? For example, the Web Requisition Approvals process in Oracle Web Employees

4. Identify the possible results of the process. Definethe possible results as lookup codes in a lookup type

Page 75: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 9

Activities and Lookup Types

Copyright Oracle Corporation, 2000. All rights reserved.®

Activities and Lookup TypesActivities and Lookup Types

S

E

E

Result A

Result BProcess:

Function: PL/SQL codereturns Result Result F

Result T

YN

TF

Notification: MessageFYI

ResponseRequired

‘Send’ Attributes

‘Send’ and‘Respond’ Attributes

RESULT

Resp 1

Result Type =Lookup Type

}

}

Result NResult Y}

Resp 2...

Process ActivitiesA process activity can be completed with a specific result that is defined ina lookup type. For example, the New Hire Process can be completed witha final result of Accepted or Declined, both of which are codes defined inthe Applicant Response lookup type.

Function ActivitiesThe PL/SQL procedure for a function activity can return some result thatdetermines the next transition the Workflow Engine takes. That resultshould be defined as a code in a lookup type.

Notification ActivitiesThe message sent by a notification activity can simply convey informationor it can require a response:

If the message only provides information (such as an “FYI”), thencreate and include “Send” message attributes in the message asnecessary.If the message requires a response, then create “Send” messageattributes that provide enough information for the recipient torespond and also create “Respond” message attributes that prompta response.If a particular response defines the actual result of the notificationactivity, then complete the Result tab for the message. The

Page 76: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 10

information you enter creates a special “Respond” messageattribute that has an internal name of “RESULT”. The “RESULT”attribute has a datatype of lookup and must reference a lookup typethat defines the possible result codes and matches the result typefor the notification activity.

Page 77: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 11

Creating a New Process from Bottom Up

Copyright Oracle Corporation, 2000. All rights reserved.®

Creating a New Process from Bottom UpCreating a New Process from Bottom Up

1. Define the item type of the process.2. Define the item type attributes for the process.3. Define lookup types and lookup codes.4. Define messages.5. Define message attributes.6. Define the activities in the process as Function,

Notification, or Process.7. Diagram the relationship of the activities.

1. Define the item type of the process.2. Define the item type attributes for the process.3. Define lookup types and lookup codes.4. Define messages.5. Define message attributes.6. Define the activities in the process as Function,

Notification, or Process.7. Diagram the relationship of the activities.

Page 78: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 12

Creating a New Process from Top Down

Copyright Oracle Corporation, 2000. All rights reserved.®

Creating a New Process from Top DownCreating a New Process from Top Down

1. Use the QuickStart Wizard to create the processframework.

2. Define activities without underlying dependencies.3. Diagram the relationship of the activities.4. Define item type attributes for the process.5. Define lookup types and lookup codes.6. Define messages.7. Define message attributes.8. Update processes, functions, and notifications

with underlying components.

1. Use the QuickStart Wizard to create the processframework.

2. Define activities without underlying dependencies.3. Diagram the relationship of the activities.4. Define item type attributes for the process.5. Define lookup types and lookup codes.6. Define messages.7. Define message attributes.8. Update processes, functions, and notifications

with underlying components.

Page 79: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 13

Demonstration

Copyright Oracle Corporation, 2000. All rights reserved.®

DemonstrationDemonstration

• Samples of Oracle Applications R11i workflowprocesses

• Samples of Oracle Applications R11i workflowprocesses

In Oracle Workflow we will show :In Oracle Workflow we will show :

Page 80: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Planning a Workflow ProcessChapter 4 - Page 14

Page 81: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 1

Defining Item Types, ItemAttributes, and Lookup TypesChapter 5

Page 82: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 2

Defining Item Types, Item Attributes, and Lookup Types

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining Item Types, Item Attributes, andLookup Types

Defining Item Types, Item Attributes, andLookup Types

Page 83: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

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

Page 84: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 4

Create a New Workflow Process Definition

Copyright Oracle Corporation, 2000. All rights reserved.®

Create a New Workflow ProcessDefinition

Create a New Workflow ProcessDefinition

To create a new workflow process:To create a new workflow process:•• Define the item type of the processDefine the item type of the process•• Define item type attributes for the processDefine item type attributes for the process•• Define lookup types and lookup codesDefine lookup types and lookup codes•• Define messagesDefine messages•• Define message attributesDefine message attributes•• Define the activities in the process as Function,Define the activities in the process as Function,

Notification, or ProcessNotification, or Process•• Diagram the relationship of the activitiesDiagram the relationship of the activities

Page 85: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 5

Top-Down Design

Copyright Oracle Corporation, 2000. All rights reserved.®

Top-Down DesignTop-Down Design

• Draw the process diagram first and then define theunderlying components.

• Create new activities while drawing a processdiagram.

• View activity and process activity property pagesfrom one dialogue.

• Property page includes all tabs for base activity ofthe node and the usage of the individual node.

• Save a partially completed or errored process andcomplete or correct later.

• Draw the process diagram first and then define theunderlying components.

• Create new activities while drawing a processdiagram.

• View activity and process activity property pagesfrom one dialogue.

• Property page includes all tabs for base activity ofthe node and the usage of the individual node.

• Save a partially completed or errored process andcomplete or correct later.

Page 86: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 6

Quick Start Wizard

Copyright Oracle Corporation, 2000. All rights reserved.®

Quick Start WizardQuick Start Wizard

The steps listed on the earlier slide were the required The steps listed on the earlier slide were the required steps for previous versions of Oracle Workflow. steps for previous versions of Oracle Workflow. While these steps are still valid for Release 2.5 theyWhile these steps are still valid for Release 2.5 theyare no longer required. A new Workflow Builder menuare no longer required. A new Workflow Builder menuoption guides you through building a workflow option guides you through building a workflow process. process.

Quick Start WizardThe Quick Start Wizard is initiated from the Builder File menu option orfrom the Builder Navigator Toolbar Quick Start Wizard icon. The QuickStart Wizard prompts for the minimum information necessary to create anew item type and process.

Page 87: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 7

Quick Start Wizard (Continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

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

Quick Start Wizard ToolEnter unique internal and display names for the item type and process.The persistence type controls when the run-time process statusinformation is eligible for purge after the process is complete.

Page 88: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 8

Quick Start Wizard (Continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

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

Quick Start Wizard Tool (continued)The Quick Start Wizard creates a process and opens the process diagram.The start and end nodes are automatically created. The workflowdeveloper uses the process diagram toolbar icons to create additionalactivity nodes.

Page 89: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 9

Define an Item Type

Copyright Oracle Corporation, 2000. All rights reserved.®

Define an Item TypeDefine an Item Type

Item Type Properties PageItem types are defined in the navigator tree within a data store or workspace.Select a data store or workspace, then select “New Item Type...” from the Editmenu to create a new item type.1. Specify an internal name with a maximum of eight characters that has nocolons or spaces.2. Specify a display name and description.3. Specify the persistence type for this item type4. Specify the name of the selector/callback function for this item type.

The Item Type selector/callback function is a PL/SQLprocedure that the Workflow Engine can call beforeexecuting an activity.An item type can have multiple workflow processesassociated with it. If it does, the selector/callback function(a PL/SQL stored procedure) can identify the appropriateprocess to run.The selector/callback function can also reset or test contextinformation for an item type before performing an activity.Associating a selector/callback function to an item typemakes the item type better suited to future customizations.

Page 90: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 10

Item Type Selector/Callback Function

Copyright Oracle Corporation, 2000. All rights reserved.®

Item Type Selector/Callback FunctionItem Type Selector/Callback Function

• The Workflow Engine can call the selector/callbackfunction with one of three commands:– RUN: selects the appropriate process to start– SET_CTX: sets any item type context

information needed for a function activity,prior to executing the function activity in a newdatabase session

– TEST_CTX: determines whether a form can belaunched with the current item type contextinformation just before the Notification DetailWeb page launches a reference form

• The Workflow Engine can call the selector/callbackfunction with one of three commands:– RUN: selects the appropriate process to start– SET_CTX: sets any item type context

information needed for a function activity,prior to executing the function activity in a newdatabase session

– TEST_CTX: determines whether a form can belaunched with the current item type contextinformation just before the Notification DetailWeb page launches a reference form

Note: Launching a form from the Notification Detail Web page is onlyavailable when Workflow is embedded in Oracle Applications.

Page 91: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 11

Define Item Type Attributes

Copyright Oracle Corporation, 2000. All rights reserved.®

Define Item Type AttributesDefine Item Type Attributes

• What should be considered an item type attribute?– Information required by notification messages,

such as the display format of a currency value– Information required by function activities,

such as values that link back to applicationsdata like a person_ID

– Information maintained by a workflow activity,such as activities that identify who to forwardinformation to and from in a loop construct

• What should be considered an item type attribute?– Information required by notification messages,

such as the display format of a currency value– Information required by function activities,

such as values that link back to applicationsdata like a person_ID

– Information maintained by a workflow activity,such as activities that identify who to forwardinformation to and from in a loop construct

Note: Do not use item type attributes as a denormalized data store.Always refer back to the base application to retrieve up-to-date values.There is a trade-off between the convenience of storing global processdata in item type attributes and the overhead incurred loading item typeattributes when a process instance is created. Minimize the number ofitem type attributes to improve the performance of your workflow process.

Page 92: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 12

Define Item Type Attributes (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

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

Attributes Properties PageItem type attributes are defined in the navigator tree beneath a given itemtype. Select the item type, then select New Attribute from the Edit menu tocreate a new item type attribute.

Specify an internal name, display name, and description for theattribute.Specify the attribute’s type (and format/default value ifapplicable):

Text: A string of text of specified character lengthNumber: A number with an optional format maskDate: A date with an optional format maskLookup: A lookup code value from a specified lookup typeRole: A role name from the list of roles defined in thedirectory serviceAttribute: The name of another existing item type attributein a process that you need for maintaining referencesURL: A Universal Resource Locator (URL) to a networklocation that you want a user to be able to access from theNotifications Web pageForm: The internal function name and any optional formparameters of an Oracle Applications form that you want a

Page 93: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 13

user to be able to access from the Notification Detail WebpageDocument: An attached document, as specified by thedocument type (the name of the document managementsystem and a document reference)

Page 94: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 14

Form Attributes

Copyright Oracle Corporation, 2000. All rights reserved.®

Form AttributesForm Attributes

Click on form icon to launch Oracle Applications form

Form Type AttributeThe Notification Detail Web page supports form attributes. They appear ina notification message as a form icon. When you open your notificationyou can click on the attached form icon which drills down to thereferenced form.Form Attribute ValuesThe value of a form parameter can be a text string enclosed in quotes (“ “)or can be token substituted with another predefined item type attribute inany of the following ways:

parameterN = “&item_type_attribute” parameterN = “Value &item_type_attribute”, where&item_type_attribute represents the rest of the value

Note: This attribute type is not relevant for the standalone version ofOracle Workflow.

Page 95: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 15

Document Attributes

Copyright Oracle Corporation, 2000. All rights reserved.®

Document AttributesDocument Attributes

• PL/SQL document: a document representing datafrom the database, generated from a PL/SQLprocedure.– Ideal for use when document content varies– For example, purchase orders with variable

number of lines or sales orders with variablelines, discounts, and shipping addresses

• DM document: a document managed by anexternal document management system

• PL/SQL document: a document representing datafrom the database, generated from a PL/SQLprocedure.– Ideal for use when document content varies– For example, purchase orders with variable

number of lines or sales orders with variablelines, discounts, and shipping addresses

• DM document: a document managed by anexternal document management system

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

Document Type AttributesThe Notification Detail Web page supports document attributes. Theyappear in a notification message as an inline link or as an attachment icon.When you open your notification you can click on a link or an attachmenticon to open the referenced document.

Document Attribute ValuesThe value of a document attribute can be a text string or can be tokensubstituted.

A PL/SQL document value is specified in the format:PLSQL:<procedure>/<document identifier>A DM document value is specified in the format:DM:<document management node id>:<document identifier asassigned by the DM system>

Page 96: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 16

URL Attributes

Copyright Oracle Corporation, 2000. All rights reserved.®

URL AttributesURL Attributes

URL Message Attribute TargetIf the item attribute type you create is URL, specify a Frame Target. Whenyou reference this item attribute as the default value of a message attributein a message, the URL frame opens according to what you specified as theframe target. The options are:

New Window: The URL loads in a new, unnamed browserwindow.Same Frame: The URL loads in the same frame as the element thatreferences the URL attribute.Parent Frameset: The URL loads into the immediate FRAMESETparent of the current frame. This value is equivalent to SameFrame, if the current frame has no parent.Full Window: The URL loads into the full, original window, thuscanceling all other frames. This value is equivalent to Same Frame,if the current frame has no parent.

Page 97: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 17

Activities and Lookup Types

Copyright Oracle Corporation, 2000. All rights reserved.®

Activities and Lookup TypesActivities and Lookup Types

S

E

E

Result A

Result BProcess:

Function: PL/SQL codereturns Result Result F

Result T

YN

TF

Notification: MessageFYI

ResponseRequired

‘Send’ Attributes

‘Send’ and‘Respond’ Attributes

RESULT

Resp 1

Result Type =Lookup Type

}

}

Result NResult Y}

Resp 2...

Lookup TypesLookup types can be referenced by activities, attributes, and messages in aprocess to provide a predefined list of values.

Page 98: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 18

Define Lookup Types

Copyright Oracle Corporation, 2000. All rights reserved.®

Define Lookup TypesDefine Lookup Types

Lookup Types Property PageAlthough lookup types must be associated with a given item type and are definedin the navigator tree beneath Lookup Types branches of that item type, lookuptypes can be referenced by components in other item types. Select the item type,then select New Lookup Type from the Edit menu to create a new lookup type.1. Enter an internal and display name for the lookup type.2. Enter a description.

Page 99: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 19

Define Lookup Codes

Copyright Oracle Corporation, 2000. All rights reserved.®

Define Lookup CodesDefine Lookup Codes

Lookup Codes Property PageThe lookup codes for a lookup type are defined in the navigator tree beneath thatbranch of the lookup type. Select the lookup type, then select New Lookup Codefrom the Edit menu to create a new lookup code.1. Enter an internal and display name for the lookup code.2. Enter a thorough description.

Page 100: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Item Types, Item Attributes, and Lookup TypesChapter 5 - Page 20

Page 101: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 1

Defining a NotificationActivityChapter 6

Page 102: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 2

Defining a Notification Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining a Notification ActivityDefining a Notification Activity

Page 103: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

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

Page 104: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 4

Workflow Terms

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow TermsWorkflow Terms

• Notification Activity– A task that requires human intervention. A

notification activity sends a message to a usercontaining the information needed to completethe work.

• Notification Activity– A task that requires human intervention. A

notification activity sends a message to a usercontaining the information needed to completethe work.

Page 105: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 5

Create a New Workflow Process Definition

Copyright Oracle Corporation, 2000. All rights reserved.®

Create a New Workflow ProcessDefinition

Create a New Workflow ProcessDefinition

To create a new workflow process:To create a new workflow process:•• Define the item type of the processDefine the item type of the process•• Define item type attributes for the processDefine item type attributes for the process•• Define lookup types and lookup codesDefine lookup types and lookup codes•• Define messagesDefine messages•• Define message attributesDefine message attributes•• Define the activities in the process as Function,Define the activities in the process as Function,

Notification, or ProcessNotification, or Process•• Diagram the relationship of the activitiesDiagram the relationship of the activities

Page 106: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 6

Define a Message

Copyright Oracle Corporation, 2000. All rights reserved.®

Define a MessageDefine a Message

Message Property PageMessages must be associated with an item type and are created in the navigatortree under the Messages branch of the item type. Select the item type, thenselect New Message... from the Edit menu.1. Enter an internal name, display name and description for the message.2. Specify a priority for the message.

The priority entered here is specific to the message.Recipients of this message can sort their notifications based on this priority.

Note: The 1 to 99 message priority scale of previous releases is now obsolete.The notification priority values are: High, Normal and Low.

Body Property PageSelect the Body tab to display the Body property page.1. Specify the message subject and body. The message body can be enteredusing text or HTML formatting.2. Optionally include message attributes in the subject or body.

Define a message attribute using the Message Attributes property page.Specify the internal name of the message attribute and precede that internal

name with an “&” in the subject or body of the message.Message attributes are token substituted with a runtime value when the

message is sent.

Page 107: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 7

Define a Message (Continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Define a Message (Continued)Define a Message (Continued)

Message ResultCreate a “result” for a message when you wish to send a message thatprompts for a response and then uses that response as the result of itsnotification activity.

Select the Result tab of the Message Property page.Enter a Display Name. This will be the response prompt.Select a Lookup Type. This will provide the possible result values.The lookup type associated with the message result should be thesame as the result type of the notification activity that sends thenotification message.The icon for messages in the navigator tree includes a red questionmark in its bottom left corner when a message has a Resultdefined.

Note: In version 2.0.3 of Oracle Workflow it was necessary to define amessage attribute which had an internal name of RESULT. This isimplemented through the message Result property tab in version 2.5.

Page 108: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 8

Define a Message Attribute

Copyright Oracle Corporation, 2000. All rights reserved.®

Define a Message AttributeDefine a Message Attribute

Attribute Property PageMessage attributes must be associated with a message and are created in thenavigator tree beneath that message. Select a message, then select “NewAttribute...” from the Edit menu to create a new message attribute.

The Attributes property page for message attributes is identical tothe Attributes property page for Item type attributes but includesone additional field, called “source.”Set the value of Source to “Send” for any message attributes thatyou include in the message subject and message body for tokensubstitution. These are called Send attributes.Set the default value of Send attributes to reference a constant orthe runtime value of an item type attribute.

Page 109: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 9

Define a Respond Attribute

Copyright Oracle Corporation, 2000. All rights reserved.®

Define a Respond AttributeDefine a Respond Attribute

Respond AttributesIf you wish to create a message that prompts a response from the recipient, thendefine a message attribute that has Source set to “Respond.”

The Notification System uses a message's Respond attributes togenerate the response section of the notification.A message can have multiple Respond attributes.The icon for Respond attributes in the navigator tree includes a redquestion mark in its bottom left corner to distinguish it from Sendattributes.

Page 110: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 10

Respond Attributes in an E-mail Notification

Copyright Oracle Corporation, 2000. All rights reserved.®

Respond Attributes in an E-mailNotification

Respond Attributes in an E-mailNotification

Respond Attributes as Reflected in an E-mail NotificationThe response section of an e-mail notification is generated by the followingboilerplate text and information drawn from the properties of the Respondattribute:

Enter the <Display Name> on line <Sequence>.<Description>. <Type Hint>

Display Name: Comes from the property page and specifies the responsevalue expected.

Sequence: The sequence order that this Respond attribute is listed in theNavigator tree among all the Respond attributes of the message.

Description: Comes from the property page and provides optional informationon how to complete a response.

Type Hint: A standard hint that is provided based on the attribute’s type: Type Type Hint

Lookup Value must be one of the following: <list of lookup codes>

Date Value must be a date in the form “<format>“. Number Value must be a number in the form “<format>“. Text Value must be <format> bytes or less.

Page 111: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 11

Respond Attributes in the Notifications Web Page

Copyright Oracle Corporation, 2000. All rights reserved.®

Respond Attributes in the NotificationsWeb Page

Respond Attributes in the NotificationsWeb Page

Respond Attributes as Reflected in a Notifications Web PageThe response section of a Web notification is generated by informationdrawn from the properties of the Respond attribute:

The response prompt comes from the Display Name field of theProperty page and specifies the response value expected.The response prompt also links to information about the propertiesof that Respond attribute.A single Respond attribute of type “URL” lets you replace thenotification response section and processing with that of anotherWeb page. Multiple URL Respond attributes lets you provide therecipient with multiple links to other Web pages. However, thisbehavior appears only if the notification is viewed from theNotifications Web page.

Page 112: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 12

Define a Notification Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

Define a Notification ActivityDefine a Notification Activity

Notification ActivitiesNotification activities must be associated with an item type and are created inthe navigator tree beneath the Notifications branch of the item type. Select theitem type, then select New Notification... from the Edit menu.Activity Property PageThe procedure for defining a notification activity is as follows:1. Specify an internal name, display name, and description for thenotification activity.2. Specify the lookup type that contains the possible results that the activitycan return.3. Choose a descriptive icon for the notification activity.4. Choose a message to send from the list of predefined messages.5. If a message includes a Result, then the result type of the notificationactivity must be the same as the lookup type that the message Result references.6. If you want to send this notification to a multi-user role, ensuring eachuser receives an individual copy of the notification, select the Expand Rolescheck box.7. You can optionally specify a PL/SQL stored procedure in the Functionfield. The procedure is known as a post-notification function and can be used tocouple processing logic to the notification activity.8. Always select the Expand Roles check box for FYI-type notifications.

Page 113: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 13

Standard PL/SQL API for Calling Functions

Copyright Oracle Corporation, 2000. All rights reserved.®

Standard PL/SQL API for CallingFunctions

Standard PL/SQL API for CallingFunctions

• All PL/SQL stored procedures called bynotification activities in an Oracle Workflowprocess should follow the standard API format sothat the Workflow Engine can properly execute theactivity.

• All PL/SQL stored procedures called bynotification activities in an Oracle Workflowprocess should follow the standard API format sothat the Workflow Engine can properly execute theactivity.

Standard APIif (funcmode=‘RESPOND’) then

<your RESPOND executable statements>resultout:=‘COMPLETE’;return;

endif;if (funcmode=‘FORWARD’) then

<your FORWARD executable statements>resultout:=‘COMPLETE’;return;

endif;

if (funcmode=‘TRANSFER’) then<your TRANSFER executable statements>resultout:=‘COMPLETE’;return;

endif;if (funcmode=‘TIMEOUT’) then

<your TIMEOUT executable statements>resultout:=‘COMPLETE’;return;

endif;...Note: the sections on this page are only needed for post-notification functions.

Page 114: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 14

Execution Modes

Copyright Oracle Corporation, 2000. All rights reserved.®

Execution ModesExecution Modes

• Notification activity with a post-notificationfunction modes are:– RESPOND– FORWARD– TRANSFER– RUN– TIMEOUT

• Notification activity with a post-notificationfunction modes are:– RESPOND– FORWARD– TRANSFER– RUN– TIMEOUT

Post-Notification Function ModesRESPOND: The performer responded to the notification. The post-notification function can interpret the result and perform post-response processing. The function can reject the response with anerror.FORWARD: The performer delegates the notification to anotheruser. The function can audit or reject the delegation request with anerror. This state corresponds to the Delegate Authority option inthe user interface.TRANSFER: The performer transfers the notification to anotheruser. The function can audit or reject the transfer request with anerror.RUN: Called after RESPOND, FORWARD, or TRANSFERmodes. The post-notification function in RUN mode can performadditional processing associated with the notification event.TIMEOUT: If a notification activity does not complete within acertain period of time then Oracle Workflow marks that activity astimed out and then cancels any notification associated with thetimed out activity. The Notification System sends a cancellationmessage to the performer only if the cancelled notification wasexpecting a response and the performer's notification preference isto receive e-mail.

Page 115: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 15

Note: If the post-notification function in RESPOND, FORWARD orTRANSFER mode returns ERROR:<errcode> as a result or raises anexception, the Workflow Engine aborts the respond, forward, or transferoperation.

Page 116: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 16

Standard Voting Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

Standard Voting ActivityStandard Voting Activity

Vote Yes/NoVote Yes/No is a notification activity associated with the Standard item type. Thisactivity can be customized. Use this activity to send a notification to all users in arole and tally the Yes/No responses of the users. The tallied responses determinethe final result of the notification activity.

The activity sends a message called “Default Voting MessageYes/No” that includes message Result. The message prompts therecipient to reply with “Yes” or “No.”The possible results of this notification activity are stored in thelookup type called Yes/No.Choose the “Expand Roles” to ensure that all users in the rolereceive a copy of the notification.When the activity receives responses, it executes a PL/SQLprocedure called WF_STANDARD.VOTEFORRESULTTYPE totally the Yes/No responses.Vote Yes/No has three activity attributes associated with it:

Voting Option: Specifies when and how to tally the votesPercent Yes: Specifies what percentage of Yes responsesare required for a Yes resultPercent No: Specifies what percentage of No responses arerequired for a No result

Page 117: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 17

Define Notification Activity Details

Copyright Oracle Corporation, 2000. All rights reserved.®

Define Notification Activity DetailsDefine Notification Activity Details

Details Property PageSelect the Details tab to display the Details property page.

Optionally specify the internal name of the item type that owns theerror process and then specify the internal name of the errorprocess activity to execute.

You can model a workflow process that specificallyhandles unexpected errors and associate that error-handlingprocess with an activity.If the activity encounters an error, the Workflow Engineexecutes that error process.

Note: Notification Timeout has been moved to the Notification Nodeproperties.

Page 118: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 18

Define a Dynamic Priority for a Notification

Copyright Oracle Corporation, 2000. All rights reserved.®

Define a Dynamic Priority for aNotification

Define a Dynamic Priority for aNotification

Dynamic Priority for a Notification ActivityBy default, the Notification System assigns a priority to a notificationbased on the priority value set for the message associated with thenotification.When you drag and drop a notification activity into a process diagram as anode, you can set a new priority for that node that overrides the defaultpriority of the message it sends. At runtime, the message has the overridepriority.You can set the overriding priority as a constant or from an item attribute.The item attribute must be of type number and the following ranges apply:High : 0-33Normal : 34-66Low : 67-99Note: Notification Priority is available on the Notification Nodeproperties.

Page 119: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 19

Practice Les 6-1 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Practice Les 6-1 OverviewPractice Les 6-1 Overview

This practice covers the following topics:• Planning a Notification Only Process• Using the QuickStart Wizard• Designing a Process Top Down• Creating Item Attributes and Messages• Setting Node Properties

(message, performer, Start/End)• Saving a Process

This practice covers the following topics:• Planning a Notification Only Process• Using the QuickStart Wizard• Designing a Process Top Down• Creating Item Attributes and Messages• Setting Node Properties

(message, performer, Start/End)• Saving a Process

Page 120: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 20

Practice Les 6-1 Overview Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

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

Create a process that:• Starts.• Sends a vacation proposal from an employee to

his manager prompting the manager to approve orreject. Allows the manager to respond withalternate vacation dates and comments.

• If the proposal is approved, sends a notification tothe requestor reporting the vacation is approved.

• If the proposal is rejected, gives the requestor theoption to resubmit another vacation proposal tothe same manager.

• Ends.

Create a process that:• Starts.• Sends a vacation proposal from an employee to

his manager prompting the manager to approve orreject. Allows the manager to respond withalternate vacation dates and comments.

• If the proposal is approved, sends a notification tothe requestor reporting the vacation is approved.

• If the proposal is rejected, gives the requestor theoption to resubmit another vacation proposal tothe same manager.

• Ends.

Page 121: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 21

Guided Practice Les 6-1: Planning a Notification OnlyProcess

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

1. Start with a rough sketch of a process that:a. sends a vacation proposal from an employee

to his manager and prompts him to approve orreject

b. on manager approval, sends a notification tothe requestor reporting the vacation proposalis rejected

c. on manager reject, gives the requestor theoption to resubmit another vacation proposalto the same manager

d. has two end points reflecting the approve andreject paths through the process

1. Start with a rough sketch of a process that:a. sends a vacation proposal from an employee

to his manager and prompts him to approve orreject

b. on manager approval, sends a notification tothe requestor reporting the vacation proposalis rejected

c. on manager reject, gives the requestor theoption to resubmit another vacation proposalto the same manager

d. has two end points reflecting the approve andreject paths through the process

Page 122: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 22

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

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

2. Create a new Item Type with an internal name of“WFVACXX” where XX is the unique numberassigned to your station. The display nameshould also include “XX” to make it easy for youto identify your Item Type. For example, theinternal name may be “WFVAC02” and the displayname may be “02 Vacation Proposal”.

Hint: Use menu option File -> Quick Start Wizard

2. Create a new Item Type with an internal name of“WFVACXX” where XX is the unique numberassigned to your station. The display nameshould also include “XX” to make it easy for youto identify your Item Type. For example, theinternal name may be “WFVAC02” and the displayname may be “02 Vacation Proposal”.

Hint: Use menu option File -> Quick Start Wizard

Page 123: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 23

Guided Practice Les 6-1: Designing a Process TopDown

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

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

In the Builder Process diagram, use the NewNotification tool bar icon to create notificationactivity nodes. Draw transitions between nodesaccording to your process sketch.– Hint: Make use of the Approval and Yes/No

lookup types provided in the Standard itemtype.

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

In the Builder Process diagram, use the NewNotification tool bar icon to create notificationactivity nodes. Draw transitions between nodesaccording to your process sketch.– Hint: Make use of the Approval and Yes/No

lookup types provided in the Standard itemtype.

Page 124: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 24

Guided Practice Les 6-1: Creating Supporting ItemAttributes

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 6-1:Creating Supporting Item Attributes

Guided Practice Les 6-1:Creating Supporting Item Attributes

4. In the Builder Navigator, create the item attributesto support your process.– Hint: Create Role type item attributes for the

Vacation Requestor and Vacation Approver.Create Date type item attributes for theVacation Start and End dates.

4. In the Builder Navigator, create the item attributesto support your process.– Hint: Create Role type item attributes for the

Vacation Requestor and Vacation Approver.Create Date type item attributes for theVacation Start and End dates.

Page 125: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 25

Guided Practice Les 6-1: Creating SupportingMessages

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 6-1:Creating Supporting Messages

Guided Practice Les 6-1:Creating Supporting Messages

5. In the Builder Navigator, create the messages tosupport your process.a. Create a proposal message that includes the

name of the requestor and the start and enddates of the proposed vacation. As well as theApprove/Reject result, the message shouldinclude respond attributes for comments andallow the manager to suggest an alternatevacation date window.– Hint: Drag and drop the appropriate item

attributes to the message to createmessage attributes.

5. In the Builder Navigator, create the messages tosupport your process.a. Create a proposal message that includes the

name of the requestor and the start and enddates of the proposed vacation. As well as theApprove/Reject result, the message shouldinclude respond attributes for comments andallow the manager to suggest an alternatevacation date window.– Hint: Drag and drop the appropriate item

attributes to the message to createmessage attributes.

Page 126: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 26

Guided Practice Les 6-1: Creating SupportingMessages Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 6-1:Creating Supporting Messages Continued

Guided Practice Les 6-1:Creating Supporting Messages Continued

b. Create a proposal rejected message thatallows the vacation requestor to resubmit thevacation proposal to the same manager withthe original or modified date window.– Hint: Use the Yes/No lookup type provided

in the Standard item type.– Hint: Make from date and to date respond

message attributes.c. Create a proposal accepted FYI message.

b. Create a proposal rejected message thatallows the vacation requestor to resubmit thevacation proposal to the same manager withthe original or modified date window.– Hint: Use the Yes/No lookup type provided

in the Standard item type.– Hint: Make from date and to date respond

message attributes.c. Create a proposal accepted FYI message.

Page 127: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 27

Guided Practice Les 6-1: Setting Selected NodeProperties

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 6-1:Setting Selected Node Properties

Guided Practice Les 6-1:Setting Selected Node Properties

6. In the Builder Process Diagram, set Properties tocomplete your process.a. Assign a Message to each Notification Node.b. Set the Performer for each Notification Node

– the Vacation Proposal recipient should bethe manager

– the Proposal Rejected and ProposalApproved recipients should be the vacationrequestor

c. Set the Start/End on each End Node.

6. In the Builder Process Diagram, set Properties tocomplete your process.a. Assign a Message to each Notification Node.b. Set the Performer for each Notification Node

– the Vacation Proposal recipient should bethe manager

– the Proposal Rejected and ProposalApproved recipients should be the vacationrequestor

c. Set the Start/End on each End Node.

Page 128: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 28

Guided Practice Les 6-1: Saving Your Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 6-1:Saving Your Process

Guided Practice Les 6-1:Saving Your Process

7. In the Builder Navigator,a. Verify the definition using File -> Verify.b. Save your new data store and Item Type to a

workflow definition file.c. Save your Item Type and process definition to

a test database.

7. In the Builder Navigator,a. Verify the definition using File -> Verify.b. Save your new data store and Item Type to a

workflow definition file.c. Save your Item Type and process definition to

a test database.

Page 129: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 29

Les 6-1 Summary

Copyright Oracle Corporation, 2000. All rights reserved.®

Les 6-1 SummaryLes 6-1 Summary

In this practice, you should have learned how to:• plan a simple notification only approval process• use the Quick Start Wizard to create an Item Type

and Process• find, drag and drop activities into a process• design a process top down within the Process

Window• create item attributes and messages• set node properties• save a process to a workflow definition file and to

a database

In this practice, you should have learned how to:• plan a simple notification only approval process• use the Quick Start Wizard to create an Item Type

and Process• find, drag and drop activities into a process• design a process top down within the Process

Window• create item attributes and messages• set node properties• save a process to a workflow definition file and to

a database

Sample SolutionsRefer to workflow definition file wfvacxx_61.wft for a sample solution.

To Copy a Sample Item Type1. Open the sample workflow definition file data store in the Workflow Buildernavigator.2. Drag the item type, holding down your select mouse button, to the same datastore.3. You will be prompted to enter a new internal name and display name for theitem type in the Item Type property page. This is because every item type musthave unique internal and display names. Change internal name WFVACXX anddisplay name ‘XX Vacation Proposal’, replacing ‘XX’ with the unique numberassigned to your work station.4. Create a new data store using navigator menu option File -> New , ctrl+N, orthe New Store icon from the navigator tool bar.5. Drag and drop the Standard item type into your new data store. Drag and dropyour copied and renamed WFVACXX item type into your new data store.6. Select File -> Save As … from the navigator menu. Enter a descriptive filename for your new data store.7. Close data store wfvacxx_61.wft without saving your changes.

Page 130: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining a Notification ActivityChapter 6 - Page 30

Page 131: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 1

Overview of the WorkflowDirectory ServiceChapter 7

Page 132: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 2

Overview of the Workflow Directory Service

Copyright Oracle Corporation, 2000. All rights reserved.®

Overview of theWorkflow Directory Service

Overview of theWorkflow Directory Service

Page 133: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

After this lesson, you should be able to:• Explain how Oracle Workflow receives information

about a role• Map Oracle Workflow to your directory repository

After this lesson, you should be able to:• Explain how Oracle Workflow receives information

about a role• Map Oracle Workflow to your directory repository

Page 134: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 4

Terms

Copyright Oracle Corporation, 2000. All rights reserved.®

TermsTerms

• Role• Directory Repository• Role• Directory Repository

Workflow DefinitionsRole: A grouping of one or more users who share a common responsibilityDirectory Repository: A set of database tables that contain user information

Page 135: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 5

Directory Service Views

Copyright Oracle Corporation, 2000. All rights reserved.®

Directory Service ViewsDirectory Service Views

• WF_USERS• WF_ROLES• WF_USER_ROLES

• WF_USERS• WF_ROLES• WF_USER_ROLES

Oracle Workflow Directory ServiceOracle Workflow does not maintain its own repository of users androles.The Oracle Workflow directory service consists of three views thatmap to a designated data repository of users and roles information.Each view contains the columns that Oracle Workflow needs toreference to get information about a user or a role.

Page 136: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 6

WF_USERS View

Copyright Oracle Corporation, 2000. All rights reserved.®

WF_USERS ViewWF_USERS View

• Name: Internal name of a user• Display Name: Display name of a user• Description: Description of a user• Notification Preference: A value of MAILTEXT,

MAILATTH, MAILHTML, QUERY or SUMMARY toindicate how user prefers to receive notifications

• Language: NLS_LANGUAGE initializationparameter that specifies the default language-dependent behavior

• Territory: NLS_TERRITORY initialization parameterthat specifies the default language-dependent dateand numeric formatting used

• Name: Internal name of a user• Display Name: Display name of a user• Description: Description of a user• Notification Preference: A value of MAILTEXT,

MAILATTH, MAILHTML, QUERY or SUMMARY toindicate how user prefers to receive notifications

• Language: NLS_LANGUAGE initializationparameter that specifies the default language-dependent behavior

• Territory: NLS_TERRITORY initialization parameterthat specifies the default language-dependent dateand numeric formatting used

Columns in WF_USERS contain the followingColumns in WF_USERS contain the followinginformation:information:

Page 137: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 7

WF_USERS View (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

WF_USERS View (continued)WF_USERS View (continued)

• Email_Address: Valid email address for the user ormail distribution list

• Fax: A fax number for the user• Orig_System: Name identifying the base tables of

this view• Orig_System_ID: Primary key that identifies this

user in the base tables• Status: ACTIVE, EXTLEAVE, INACTIVE,

TMPLEAVE are the status choices• Expiration_date: Date at which the user is no

longer valid in the directory service

• Email_Address: Valid email address for the user ormail distribution list

• Fax: A fax number for the user• Orig_System: Name identifying the base tables of

this view• Orig_System_ID: Primary key that identifies this

user in the base tables• Status: ACTIVE, EXTLEAVE, INACTIVE,

TMPLEAVE are the status choices• Expiration_date: Date at which the user is no

longer valid in the directory service

Note: The Oracle Workflow Directory Service APIs use theORIG_SYSTEM_ID stored in the views to allow indexed access back tothe directory service base tables.

Page 138: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 8

WF_ROLES View

Copyright Oracle Corporation, 2000. All rights reserved.®

WF_ROLES ViewWF_ROLES View

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

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

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

Page 139: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 9

WF_ROLES View (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

WF_ROLES View (continued)WF_ROLES View (continued)

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

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

Note:Every user must also be defined as a role.The Oracle Workflow Directory Service APIs use theORIG_SYSTEM_ID stored in the views to allow indexed access back tothe directory service base tables.If the e-mail address is null for a given role, the Notification Mailer sendsan individual e-mail to each user within the role.

Page 140: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 10

WF_USER_ROLES View

Copyright Oracle Corporation, 2000. All rights reserved.®

WF_USER_ROLES ViewWF_USER_ROLES View

• User_Name: Internal name of the user as listed inWF_USERS view

• User_Orig_System: Name assigned to thedirectory repository that WF_USERS is based on

• User_Orig_System_ID: Primary key that identifiesthis user in the user directory repository

• User_Name: Internal name of the user as listed inWF_USERS view

• User_Orig_System: Name assigned to thedirectory repository that WF_USERS is based on

• User_Orig_System_ID: Primary key that identifiesthis user in the user directory repository

WF_USER_ROLES is an intersection of the users andWF_USER_ROLES is an intersection of the users androles in WF_USER and WF_ROLES.roles in WF_USER and WF_ROLES.

Page 141: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 11

WF_USER_ROLES View (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

WF_USER_ROLES View (continued)WF_USER_ROLES View (continued)

• Role_Name: Internal name of the user as listed inWF_ROLES view

• Role_Orig_System: Name assigned to thedirectory repository that WF_ROLES is based on

• Role_Orig_System_ID: Primary key that identifiesthis role in the role directory repository

• Role_Name: Internal name of the user as listed inWF_ROLES view

• Role_Orig_System: Name assigned to thedirectory repository that WF_ROLES is based on

• Role_Orig_System_ID: Primary key that identifiesthis role in the role directory repository

Page 142: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 12

Oracle Workflow Local Tables

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow Local TablesOracle Workflow Local Tables

• WF_LOCAL_USERS• WF_LOCAL_ROLES• WF_LOCAL_USER_ROLES

• WF_LOCAL_USERS• WF_LOCAL_ROLES• WF_LOCAL_USER_ROLES

Local Directory Service TablesUse Oracle Workflow Local tables to add information about usersand roles not included in your existing directory repository.Oracle Workflow Local tables include the same columns as theWF_USERS, WF_ROLES and WF_USER_ROLES viewsrespectively.

Page 143: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 13

Implementing Global User Preferences

Copyright Oracle Corporation, 2000. All rights reserved.®

Implementing Global User PreferencesImplementing Global User Preferences

• Interaction with Oracle Workflow• Access to the Global Preferences Web page• Override a default user preference

• Interaction with Oracle Workflow• Access to the Global Preferences Web page• Override a default user preference

Setting Global User PreferencesControl interaction with Oracle Workflow by globally settingdefault user preference values for the entire enterprise.Only the workflow administrator has access to the GlobalPreferences Web page.An individual user can override a default user preference at anytime by changing the value of the user preference in the UserPreferences Web page.

Page 144: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 14

User Preference Information

Copyright Oracle Corporation, 2000. All rights reserved.®

User Preference InformationUser Preference Information

Overriding Global User PreferencesThe values that you specify in the User Preferences Web pageoverride the default global values set by your workflowadministrator in the Global Preferences Web page.

Note:The Language, Territory, and Notification preference settings in theGlobal Preferences and User Preferences Web pages are valid only if yourdirectory service views map these columns to the Oracle Workflowpreference functions.Please note the above is the screen in the standalone version of OracleWorkflow not Workflow embedded in applications.

Page 145: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 15

Ad Hoc Users/Roles

Copyright Oracle Corporation, 2000. All rights reserved.®

Ad Hoc Users/RolesAd Hoc Users/Roles

• You can create and manage ad hoc users androles in a workflow process.

• Use server PL/SQL APIs to dynamically create newuser and role definitions in the directory service.The new APIs store the information in theWF_LOCAL_* tables.

• The WF_USERS and WF_ROLES views use theEXPIRATION_DATE.

• WF_LOCAL_USER_ROLES keeps track of theoriginating system of the users and roles.

• You can create and manage ad hoc users androles in a workflow process.

• Use server PL/SQL APIs to dynamically create newuser and role definitions in the directory service.The new APIs store the information in theWF_LOCAL_* tables.

• The WF_USERS and WF_ROLES views use theEXPIRATION_DATE.

• WF_LOCAL_USER_ROLES keeps track of theoriginating system of the users and roles.

WF_DIRECTORY package APIs supporting ad hoc users/roles are:CreateAdHocUser()CreateAdHocRole()AddUsersToAddHocRole()GetRoleDisplayName()SetAdHocUserStatus()SetAdHocRoleStatus()SetAdHocUserExpiration()SetAdHocRoleExpiration()SetAdHocUserAttr()SetAdHocRoleAttr()RemoveUsersFromAdHocRole()

Page 146: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 16

Directory Service for Oracle Applications

Copyright Oracle Corporation, 2000. All rights reserved.®

Directory Service for Oracle ApplicationsDirectory Service for Oracle Applications

• Oracle Workflow ships a unified directory servicefor Oracle Applications—wfdirhrv.sql. The unifieddirectory service maps:– WF_USERS to Oracle HRMS employees,

Oracle Application/Oracle Self-ServiceApplication users, Oracle Receivablescustomer contacts and WF_LOCAL_USERS.

– WF_ROLES to users in WF_USERS, OracleHRMS positions, Oracle Federal HR groupboxes, Oracle Applications responsibilities,Oracle Engineering approval lists, andWF_LOCAL_ROLES.

• Oracle Workflow ships a unified directory servicefor Oracle Applications—wfdirhrv.sql. The unifieddirectory service maps:– WF_USERS to Oracle HRMS employees,

Oracle Application/Oracle Self-ServiceApplication users, Oracle Receivablescustomer contacts and WF_LOCAL_USERS.

– WF_ROLES to users in WF_USERS, OracleHRMS positions, Oracle Federal HR groupboxes, Oracle Applications responsibilities,Oracle Engineering approval lists, andWF_LOCAL_ROLES.

Page 147: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 17

Directory Services for Oracle Workflow StandaloneVersion

Copyright Oracle Corporation, 2000. All rights reserved.®

Directory Services for Oracle WorkflowStandalone Version

Directory Services for Oracle WorkflowStandalone Version

• Two sample Directory Services scripts are locatedin the Oracle Workflow sql subdirectory:– wfdirouv.sql maps workflow users and roles to

the native users and roles defined in theOracle RDBMS.

– wfdircsv.sql maps workflow users and roles tothe users and roles stored in the OracleWorkflow local tables.

• Two sample Directory Services scripts are locatedin the Oracle Workflow sql subdirectory:– wfdirouv.sql maps workflow users and roles to

the native users and roles defined in theOracle RDBMS.

– wfdircsv.sql maps workflow users and roles tothe users and roles stored in the OracleWorkflow local tables.

wfdirouv.sqlThis script creates three views based on the following native Oracle tables:

DBA_USERSDBA_ROLESDBA_ROLE_PRIVS

wfdircsv.sqlThis script creates three views based on the following tables:

WF_LOCAL_USERSWF_LOCAL_ROLESWF_LOCAL_USER_ROLES

Note: You can use WF_LOCAL_* tables to store users and roles notincluded in your central data repository. When you create your directoryservice views, you will need to select from the tables in your centralrepository as well as from the WF_LOCAL tables to get the complete listof users and roles.

Page 148: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow Directory ServiceChapter 7 - Page 18

Page 149: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 1

Defining Function andProcess ActivitiesChapter 8

Page 150: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 2

Defining Function and Process Activities

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining Function and Process ActivitiesDefining Function and Process Activities

Page 151: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

After this lesson, you should be able to:• Define a function activity• Define an activity attribute• Apply the Workflow Engine APIs to your function

activities• Define a process activity

After this lesson, you should be able to:• Define a function activity• Define an activity attribute• Apply the Workflow Engine APIs to your function

activities• Define a process activity

Page 152: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 4

Create a New Workflow Process Definition

Copyright Oracle Corporation, 2000. All rights reserved.®

Create a New Workflow ProcessDefinition

Create a New Workflow ProcessDefinition

To create a new workflow process:To create a new workflow process:•• Define the item type of the processDefine the item type of the process•• Define item type attributes for the processDefine item type attributes for the process•• Define lookup types and lookup codesDefine lookup types and lookup codes•• Define messagesDefine messages•• Define message attributesDefine message attributes•• Define the activities in the process as Function,Define the activities in the process as Function,

Notification, or ProcessNotification, or Process•• Diagram the relationship of the activitiesDiagram the relationship of the activities

Page 153: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 5

Define a Function Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

Define a Function ActivityDefine a Function Activity

Function ActivitiesFunction activities must be associated with an item type and are created inthe navigator tree beneath the Functions branch of the item type. Select theitem type, then select New Function… from the Edit menu.

Activity Property PageSpecify an internal name, display name, and description for thefunction activity.Choose a descriptive icon for the activity.Specify a function type and function for the activity.

PL/SQL: Enter the name of the PL/SQL stored procedurethat you want the Workflow Engine to execute for thisfunction activity.External: Enter the name of the external program you wantthe Workflow Engine to enqueue in the Outbound queue.The correlation value of that entry is set to the value youspecify in the Function field.

Specify the result type that contains the possible results that theactivity can return.Specify a relative cost, in seconds, that represents how long theprocedure takes to run. If the cost exceeds the Workflow Engine

Page 154: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 6

threshold, the activity will be deferred for later processing by abackground engine.

Page 155: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 7

Assigning a Cost to a Function Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

Assigning a Cost to a Function ActivityAssigning a Cost to a Function Activity

• Cost is entered in seconds and converted tohundredths of a second when stored in thedatabase.

• Assign a high cost to function activities thatrequire a large amount of processing to complete.

• If the cost of an activity exceeds the thresholdcost of the Workflow Engine, the activity getsdeferred by the Workflow Engine.

• A background engine set up to poll for deferredactivities can execute the deferred activity at alater time.

• Cost is entered in seconds and converted tohundredths of a second when stored in thedatabase.

• Assign a high cost to function activities thatrequire a large amount of processing to complete.

• If the cost of an activity exceeds the thresholdcost of the Workflow Engine, the activity getsdeferred by the Workflow Engine.

• A background engine set up to poll for deferredactivities can execute the deferred activity at alater time.

Assigning a Cost to a Function ActivityNote: The Workflow Engine executes one activity at a time. If possible,you should avoid placing costly activities along the critical path of aprocess. Instead, place costly activities on parallel branches in a process,where they can be deferred for a background engine to process later.

Page 156: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 8

Standard PL/SQL API for Calling Functions

Copyright Oracle Corporation, 2000. All rights reserved.®

Standard PL/SQL API for CallingFunctions

Standard PL/SQL API for CallingFunctions

• All PL/SQL stored procedures called by functionactivities in an Oracle Workflow process shouldfollow the standard API format so that theWorkflow Engine can properly execute the activity.

• All PL/SQL stored procedures called by functionactivities in an Oracle Workflow process shouldfollow the standard API format so that theWorkflow Engine can properly execute the activity.

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

Standard APIprocedure <procedure name> (

itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2) is<local declarations>beginif (funcmode=‘RUN’) then

<your Run executable statements>resultout:=‘COMPLETE:<result>‘;return;

endif;if (funcmode=‘CANCEL’) then

<your CANCEL executable statements>resultout:=‘COMPLETE’;return;

endif;...

Page 157: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 9

Execution Modes

Copyright Oracle Corporation, 2000. All rights reserved.®

Execution ModesExecution Modes

• Function activity modes:– RUN

– Activities that are executed for the first time– Follows CANCEL mode on a loop reset

– CANCEL– Activities revisited as part of a loop reset– Activities that are part of a process that has

been canceled by a call toWF_ENGINE.AbortProcess

– Activities that are part of the processstream being undone by a call toWF_ENGINE.HandleError

• Function activity modes:– RUN

– Activities that are executed for the first time– Follows CANCEL mode on a loop reset

– CANCEL– Activities revisited as part of a loop reset– Activities that are part of a process that has

been canceled by a call toWF_ENGINE.AbortProcess

– Activities that are part of the processstream being undone by a call toWF_ENGINE.HandleError

Page 158: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 10

Notification Activities Revisited

Copyright Oracle Corporation, 2000. All rights reserved.®

Notification Activities RevisitedNotification Activities Revisited

• All PL/SQL stored procedures referenced bynotification activities in an Oracle Workflowprocess should follow the standard API format sothat the Workflow Engine can properly execute theactivity.

• All PL/SQL stored procedures referenced bynotification activities in an Oracle Workflowprocess should follow the standard API format sothat the Workflow Engine can properly execute theactivity.

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

Standard API (revisited)procedure <procedure name> (

itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2) is

<local declarations>beginif (funcmode=‘RESPOND’) then

<your RESPOND executable statements>resultout:=‘COMPLETE’;return;

endif;if (funcmode=‘FORWARD’) then

<your FORWARD executable statements>resultout:=‘COMPLETE’;return;

endif;

if (funcmode=‘TRANSFER’) then<your TRANSFER executable statements>

Page 159: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 11

resultout:=‘COMPLETE’;return;

endif;...

Page 160: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 12

Notification Activities Revisited

Copyright Oracle Corporation, 2000. All rights reserved.®

Notification Activities RevisitedNotification Activities Revisited

• All PL/SQL stored procedures referenced bynotification activities in an Oracle Workflowprocess should follow the standard API format sothat the Workflow Engine can properly execute theactivity.

• All PL/SQL stored procedures referenced bynotification activities in an Oracle Workflowprocess should follow the standard API format sothat the Workflow Engine can properly execute theactivity.

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

Standard API (revisited)procedure <procedure name> (

itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2) is

<local declarations>begin

...if (funcmode=‘RUN’) then

<your Run executable statements>resultout:=‘COMPLETE:<result>‘;return;

endif;

if (funcmode=‘TIMEOUT’) then<your TIMEOUT executable statements>resultout:=‘COMPLETE’;return;

endif;

Page 161: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 13

Execution Modes

Copyright Oracle Corporation, 2000. All rights reserved.®

Execution ModesExecution Modes

• Notification activity with a post-notificationfunction modes are:– RESPOND– FORWARD– TRANSFER– RUN– TIMEOUT

• Notification activity with a post-notificationfunction modes are:– RESPOND– FORWARD– TRANSFER– RUN– TIMEOUT

Post-Notification Function ModesRESPOND: The performer responded to the notification. The post-notification function can interpret the result and perform post-response processing. The function can reject the response with anerror.FORWARD: The performer delegates the notification to anotheruser. The function can audit or reject the delegation request with anerror. This state corresponds to the Delegate Authority option inthe user interface.TRANSFER: The performer transfers the notification to anotheruser. The function can audit or reject the transfer request with anerror.RUN: Called after RESPOND, FORWARD, or TRANSFERmodes. The post-notification function in RUN mode can performadditional processing associated with the notification event.TIMEOUT: If a notification activity does not complete within acertain period of time then Oracle Workflow marks that activity astimed out and then cancels any notification associated with thetimed out activity. The Notification System sends a cancellationmessage to the performer only if the cancelled notification wasexpecting a response and the performer's notification preference isto receive e-mail.

Page 162: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 14

Note: If the post-notification function in RESPOND, FORWARD orTRANSFER mode returns ERROR:<errcode> as a result or raises anexception, the Workflow Engine aborts the respond, forward, or transferoperation.

Page 163: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 15

Post-Notification Function

Copyright Oracle Corporation, 2000. All rights reserved.®

Post-Notification FunctionPost-Notification Function

• Reference Global WF_ENGINE variables in PL/SQL• Global Context Information set:

– WF_ENGINE.context_nid = notification_ID– WF_ENGINE.context_text = new recipient_role

available in TRANSFER or FORWARD mode– WF_ENGINE.context_text = responder

available in RESPOND mode

• Reference Global WF_ENGINE variables in PL/SQL• Global Context Information set:

– WF_ENGINE.context_nid = notification_ID– WF_ENGINE.context_text = new recipient_role

available in TRANSFER or FORWARD mode– WF_ENGINE.context_text = responder

available in RESPOND mode

Note: The value of responder varies depending on the notificationinterface the recipient uses to respond. If the recipient responds using theNotification Web page, responder is set to the role name of the responder.If the recipient responds using e-mail, responder is set to“email:responder_email_address”.

Page 164: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 16

Exception Handling

Copyright Oracle Corporation, 2000. All rights reserved.®

Exception HandlingException Handling

• Use WF_CORE APIs to raise and catch errors inyour PL/SQL procedures

• Engine sets function activity status “ERROR” if:– PL/SQL procedure raises an unhandled

exception– PL/SQL procedure returns a result beginning

with “ERROR:”

• Use WF_CORE APIs to raise and catch errors inyour PL/SQL procedures

• Engine sets function activity status “ERROR” if:– PL/SQL procedure raises an unhandled

exception– PL/SQL procedure returns a result beginning

with “ERROR:”

Debugging Function ActivitiesDebugging Function Activities

Activities that ErrorThe following columns from the tableWF_ITEM_ACTIVITY_STATUSES, viewable from the WorkflowMonitor are set to reflect the error:

ERROR_NAMEERROR_MESSAGEERROR_STACK

Page 165: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 17

Exception Handling Example

Copyright Oracle Corporation, 2000. All rights reserved.®

Exception Handling ExampleException Handling Example

exception

when others then

WF_CORE.CONTEXT (‘<package name>‘, ‘<procedure name>‘, <itemtype>, <itemkey>, to_char(<actid>), <funcmode>;raise;

end <procedure name>

exception

when others then

WF_CORE.CONTEXT (‘<package name>‘, ‘<procedure name>‘, <itemtype>, <itemkey>, to_char(<actid>), <funcmode>;raise;

end <procedure name>

Exception HandlingWF_CORE.CONTEXT adds an entry to the error stack to provide context

information that helps locate the source of an error.Use the exception handler example construct in your PL/SQL procedures to

facilitate debugging workflow function activities.If a call to ‘procedure name’ failed with an unhandled exception, thecolumn ERROR_STACK in WF_ITEM_ACTIVITY_STATUSES wouldrecord the call to ‘procedure name’ and its arguments.

Page 166: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 18

Defining a Function Activity Attribute

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining a Function Activity AttributeDefining a Function Activity Attribute

Function Activity AttributesIf the PL/SQL procedure or external program for a functionactivity contains external parameters, you can redefine thoseparameters as activity attributes.You can change the value of an activity attribute at any time inOracle Workflow Builder.Function activity attributes can only be associated with a functionactivity and are created in the navigator tree beneath that functionactivity. Select the function activity, then select New Attribute…from the Edit menu.

Attributes Property PageActivity attributes are defined the same way that item typeattributes are defined.Activity attributes apply only to the current activity and, unlikeitem type attributes, are not global to a process.

Page 167: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 19

Defining a Process Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining a Process ActivityDefining a Process Activity

Process ActivitiesA process activity must be defined before a business process can be

diagrammed.Process activities must be associated with an item type and are created in the

navigator tree beneath the Processes branch of the item type. Select theitem type, then select New Process... from the Edit menu.

Activity Property Page1. Specify an internal name, display name, and description for the processactivity.2. Choose a descriptive icon for your process.3. Specify the result type that contains the possible results that the processcan return.4. Select the Runnable check box if this is a top level workflow process thatcan be initiated.

Clear the Runnable check box if this process activity can only be executedas a subprocess called by another higher-level process.

Page 168: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 20

Defining Activity Details

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining Activity DetailsDefining Activity Details

Details Property PageEvery activity has a Details property page. The activity details for process,notification, and function activities are similar.1. Specify the internal name of the item type that owns the error process thatwill be executed if an error occurs in the current activity, whether or not thatactivity is a process, function, or notification.2. Specify the internal name of the error process.3. Specify the value for On Revisit to determine how the Workflow Enginehandles this activity when it is transitioned to more than once.

Ignore: For OR-type operations where the rest of the branch is ignored.Reset: Permits resetting status by recalling activities in CANCEL-mode.Loop: Performs loop without any reset.

Note: You set the effective date when you save your changes using the Save Asoption in the File menu. All your activity modifications share the same effectivedate when you save. The version number of the activity is maintained by OracleWorkflow.

Page 169: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 21

Looping

Copyright Oracle Corporation, 2000. All rights reserved.®

LoopingLooping

• Looping occurs when the completion of an activitycauses a transition to another activity that hasalready been completed.

• The first activity detected as a revisited activity isalso called a loop point or pivot activity.

• The Workflow Engine can handle a revisitedactivity in one of three ways:– Ignore– Reset– Re-execute

• Looping occurs when the completion of an activitycauses a transition to another activity that hasalready been completed.

• The first activity detected as a revisited activity isalso called a loop point or pivot activity.

• The Workflow Engine can handle a revisitedactivity in one of three ways:– Ignore– Reset– Re-execute

Handling a Revisited ActivityIgnore the activity and stop further processing of the thread, so ineffect, the activity can only run once.Reset the loop to the loop point before re-executing by firstrunning logic to undo the activities within the loop.Re-execute the loop point and all activities within the loop withoutrunning any compensatory logic.

Page 170: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 22

Looping

Copyright Oracle Corporation, 2000. All rights reserved.®

LoopingLooping

• Non-canceling Loop can improve performance bypreventing the rerun of functions in CANCELmode.

• Non-canceling Loop can improve performance bypreventing the rerun of functions in CANCELmode.

Ignore: is for OR-typeoperations where rest of

branch is ignored.

Reset: permits resettingstatus by recalling

activitiesin CANCEL-mode.

Loop: performs loopwithout any reset.

Non-Canceling LoopLooping occurs when the completion of an activity causes a transition toanother activity that has already been completed. The first activity that isdetected as a revisited activity is called a loop point or pivot activity.

Every activity has an On Revisit pop-up list field in its Oracle WorkflowBuilder Details property page. The On Revisit pop-up list lets you specifythe behavior of the Workflow Engine when it revisits the activity in aworkflow process. It is an important flag to set for the pivot activity of aloop. You can set the field to Ignore, Reset, or Loop. Setting On Revisitto Loop for an activity is useful when you want to simply re-executeactivities in a loop without resetting the status of the activities in the loop.Loop causes the Workflow Engine to re-execute the activity in RUN modewithout executing any CANCEL mode logic for the activity.

Page 171: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 23

Self-Looping Transitions

Copyright Oracle Corporation, 2000. All rights reserved.®

Self-Looping TransitionsSelf-Looping Transitions

<Time out>

Approve

Re je ct

Approve

Re je ct

<Time out>

End (Approve )

End (Re je ct)

NotifyRe quis itionApprova lRe quire d

Re minde r-Approva lNe e de d

Or

Or

Sta rt

Activity loopsback to

itselfon Timeout

Self-Looping TransitionsYou can draw a transition that loops back to its source activity withoutcreating additional activity nodes.

Page 172: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 24

Default Error Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Default Error ProcessDefault Error Process

The ‘System:Error’ Item Type contains the followingThe ‘System:Error’ Item Type contains the followingcomponents:components:

• Two process activities called Default ErrorProcess and Retry-only

• Four function activities called Abort, Error StillActive, Initialize Error, and Retry

• Two Notification activities called NotifyAdministrator and NTF with RETRY only

• Two process activities called Default ErrorProcess and Retry-only

• Four function activities called Abort, Error StillActive, Initialize Error, and Retry

• Two Notification activities called NotifyAdministrator and NTF with RETRY only

Default Error ProcessYou can use the default error process or retry-only process as needed tohandle unexpected errors that occur in a process.

Avoid relying on an error process to handle exceptions in thePL/SQL procedure of a function activity. Instead, try to modelyour process to handle any known errors that could occur.The Notify Administrator and NTF with RETRY only notificationsreturn:

Item TypeItem KeyUser KeyError NameError MessageError StackActivity IDActivity LabelResult CodeNotification IDAssigned User

Page 173: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 25

Error Handling

Copyright Oracle Corporation, 2000. All rights reserved.®

Error HandlingError Handling

• Notify System Administrator or a user of yourchoice if an unexpected error occurs

• Option to retry, abort or ignore from thenotification

• Link to directly access administrator toolkit on themonitor for more complex processing

• Automatically terminates when error is no longeractive

• Notify System Administrator or a user of yourchoice if an unexpected error occurs

• Option to retry, abort or ignore from thenotification

• Link to directly access administrator toolkit on themonitor for more complex processing

• Automatically terminates when error is no longeractive

Error Item Type SupportYou can add custom error processes to the System: Error item type or toany other item type. However, you cannot edit the two predefined System:Error error processes.In addition, the default error process in the WFERROR item type includesadditional information in the notification that it sends to the workflowadministrator:

Monitor URL: Enables the administrator to navigate to the errorprocess.A request to either retry or abort the process

Use the WF_ADMINISTRATOR item attribute in your item type tospecify to which role to send the error notification; the default is theSystem Administrator role.

Page 174: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 26

Error Handling (Continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Error Handling (Continued)Error Handling (Continued)

Abort

<Timeout>

Re try

Re s olve d

Fa ls e

True

True

Fa ls e

Fa lse

True

Re tryInitia lize Error NotifyAdminis tra tor

Sta rt End

EndAbort

End

Error Still Active End

Error Still Active

End

Error Still Active

Page 175: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 27

Practice Les 8-1 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Practice Les 8-1 OverviewPractice Les 8-1 Overview

This practice covers the following topics:• Creating a PL/SQL procedure for a function

activity• Creating a Function Activity

Note: You will have an opportunity to test thesechanges in a later Practice. The primary goal inthis practice is to get a clean compilation ofyour PL/SQL procedure.

This practice covers the following topics:• Creating a PL/SQL procedure for a function

activity• Creating a Function Activity

Note: You will have an opportunity to test thesechanges in a later Practice. The primary goal inthis practice is to get a clean compilation ofyour PL/SQL procedure.

Page 176: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 28

Practice Les 8-1 Overview Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

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

• Create an Employee Vacation Schedule UpdatePL/SQL procedure that includes the followinglogic to record an approved vacation proposal:– if the function activity is called by the workflow

engine in RUN mode, insert the requestor,approver, and vacation dates into a vacationschedule table (of your own design)

– if the function activity is called in CANCELmode, delete the appropriate requestor,approver, and vacation date row from thevacation schedule table

• Create a function activity to execute the EmployeeVacation Schedule Update PL/SQL procedure

• Create an Employee Vacation Schedule UpdatePL/SQL procedure that includes the followinglogic to record an approved vacation proposal:– if the function activity is called by the workflow

engine in RUN mode, insert the requestor,approver, and vacation dates into a vacationschedule table (of your own design)

– if the function activity is called in CANCELmode, delete the appropriate requestor,approver, and vacation date row from thevacation schedule table

• Create a function activity to execute the EmployeeVacation Schedule Update PL/SQL procedure

Page 177: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 29

Guided Practice Les 8-1 Creating a Vacation ScheduleTable

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-1Creating a Vacation Schedule Table

Guided Practice Les 8-1Creating a Vacation Schedule Table

1. Create a Vacation Schedule Table named“WFVACXX_VACATION_SCHEDULE” where XX isthe unique number assigned to your station, withthe following columns:– requestor varchar2(30)– approver varchar2(30)– from_date date– to_date date

1. Create a Vacation Schedule Table named“WFVACXX_VACATION_SCHEDULE” where XX isthe unique number assigned to your station, withthe following columns:– requestor varchar2(30)– approver varchar2(30)– from_date date– to_date date

Page 178: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 30

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

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

2. Use the standard API format for your PL/SQLspecification and body.

2. Use the standard API format for your PL/SQLspecification and body.procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

a. Name your package “WFVACXX” where XX isthe unique number assigned to your station.

b. Give your procedure a descriptive name suchas SCHEDULE_ UPDATE.

a. Name your package “WFVACXX” where XX isthe unique number assigned to your station.

b. Give your procedure a descriptive name suchas SCHEDULE_ UPDATE.

Page 179: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 31

Guided Practice Les 8-1 RUN processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-1RUN processing

Guided Practice Les 8-1RUN processing

3. In your PL/SQL procedure include logic for RUNfuncmode:a. retrieve the values for requestor, approver,

vacation from date, and vacation to date usingAPI calls to wf_engine.GetItemAttrText andwf_engine.GetItemAttrDate

b. insert a row into your Vacation Schedule tableusing the appropriate item attribute values

c. set resultout towf_engine.eng_completed||’:’||wf_engine.eng_null

d. return

3. In your PL/SQL procedure include logic for RUNfuncmode:a. retrieve the values for requestor, approver,

vacation from date, and vacation to date usingAPI calls to wf_engine.GetItemAttrText andwf_engine.GetItemAttrDate

b. insert a row into your Vacation Schedule tableusing the appropriate item attribute values

c. set resultout towf_engine.eng_completed||’:’||wf_engine.eng_null

d. return

Page 180: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 32

Guided Practice Les 8-1 CANCEL processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-1CANCEL processing

Guided Practice Les 8-1CANCEL processing

4. In your PL/SQL procedure include logic forCANCEL funcmode:a. retrieve the values for requestor, approver,

vacation from date, and vacation to date usingAPI calls to wf_engine.GetItemAttrText andwf_engine.GetItemAttrDate

b. delete the row from your Vacation Scheduletable based on requestor, approver, from andto dates

c. set resultout towf_engine.eng_completed||’:’||wf_engine.eng_null

d. return

4. In your PL/SQL procedure include logic forCANCEL funcmode:a. retrieve the values for requestor, approver,

vacation from date, and vacation to date usingAPI calls to wf_engine.GetItemAttrText andwf_engine.GetItemAttrDate

b. delete the row from your Vacation Scheduletable based on requestor, approver, from andto dates

c. set resultout towf_engine.eng_completed||’:’||wf_engine.eng_null

d. return

Page 181: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 33

Guided Practice Les 8-1 Adding a Function Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-1Adding a Function ActivityGuided Practice Les 8-1

Adding a Function Activity

5. Using the Vacation Proposal process created inpractice Les 7-2, open the Vacation Proposalprocess diagram:a. Delete the transition between the Vacation

Approved and End nodesb. Click on the New Function icon, position the

cross-hairs between the Vacation Approvedand End nodes, and click again to open theproperties

c. Enter unique Internal and Display Names,select an appropriate icon , enter a FunctionName with format <package.procedure> for thePL/SQL procedure you just created

5. Using the Vacation Proposal process created inpractice Les 7-2, open the Vacation Proposalprocess diagram:a. Delete the transition between the Vacation

Approved and End nodesb. Click on the New Function icon, position the

cross-hairs between the Vacation Approvedand End nodes, and click again to open theproperties

c. Enter unique Internal and Display Names,select an appropriate icon , enter a FunctionName with format <package.procedure> for thePL/SQL procedure you just created

Function Activity Internal NameAs a workflow development standard, use the procedure name as thecorresponding function activity internal name where possible.

Function Value<package.procedure> value should look something likeWFVACXX.SCHEDULE_UPDATE, where ‘XX’ is the unique number assignedto your work station.

Page 182: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 34

Guided Practice Les 8-1 Adding a Function ActivityContinued

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-1Adding a Function Activity Continued

Guided Practice Les 8-1Adding a Function Activity Continued

d. Draw transitions from Vacation Approved toUpdate Schedule, Update Schedule to End

d. Draw transitions from Vacation Approved toUpdate Schedule, Update Schedule to End

Page 183: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 35

Les 8-1 Summary

Copyright Oracle Corporation, 2000. All rights reserved.®

Les 8-1 SummaryLes 8-1 Summary

In this practice, you should have learned how to:• Create a PL/SQL procedure using the standard API

format for function activities• Use the Workflow APIs to retrieve item attribute

values• Write logic to allow a function activity to run more

than once• Create a new function activity and node

In this practice, you should have learned how to:• Create a PL/SQL procedure using the standard API

format for function activities• Use the Workflow APIs to retrieve item attribute

values• Write logic to allow a function activity to run more

than once• Create a new function activity and node

Sample SolutionsRefer to table creation script wfvacxxc.sql, PL/SQL package specification andbody definition files wfvacxxs.sql and wfvacxxb.sql, and workflow definition filewfvacxx_81.wft for sample solutions.The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample proceduresused throughout the lesson practices. The procedure specific to Practice 8-1 isWFVACXX.SCHEDULE_UPDATE.

Page 184: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 36

Practice Les 8-2 Overview Optional

Copyright Oracle Corporation, 2000. All rights reserved.®

Practice Les 8-2 OverviewOptional

Practice Les 8-2 OverviewOptional

This optional practice covers the following topics:• Creating a PL/SQL procedure to perform post-

notification response processing• Adding Post-notification Response processing to

a Notification ActivityNote: You will have an opportunity to test these

changes in a later Practice. The primary goalin this practice is to get a clean compilation ofyour PL/SQL procedure.

This optional practice covers the following topics:• Creating a PL/SQL procedure to perform post-

notification response processing• Adding Post-notification Response processing to

a Notification ActivityNote: You will have an opportunity to test these

changes in a later Practice. The primary goalin this practice is to get a clean compilation ofyour PL/SQL procedure.

Page 185: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 37

Practice Les 8-2 Overview Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

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

• Create a PL/SQL procedure that includes thefollowing logic to validate action taken on theVacation Proposal notification:– if the approver rejects the Vacation Proposal

– alternate vacation dates must be provided– alternate from date must be prior to

alternate to date– the approver is allowed to delegate (forward)

the notification response to another role– the approver is not allowed to transfer the

notification to another role

• Create a PL/SQL procedure that includes thefollowing logic to validate action taken on theVacation Proposal notification:– if the approver rejects the Vacation Proposal

– alternate vacation dates must be provided– alternate from date must be prior to

alternate to date– the approver is allowed to delegate (forward)

the notification response to another role– the approver is not allowed to transfer the

notification to another role

Page 186: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 38

Practice Les 8-2 Overview Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

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

• Associate a post-notification function with theVacation Proposal notification

• Associate a post-notification function with theVacation Proposal notification

Page 187: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 39

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

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

1. Use the standard API format for your PL/SQLspecification and body.

1. Use the standard API format for your PL/SQLspecification and body.

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

a. Add to your package “WFVACXX” created inpractice Les 8-1.

b. Give your procedure the same name as theinternal name of the notification it validates.

a. Add to your package “WFVACXX” created inpractice Les 8-1.

b. Give your procedure the same name as theinternal name of the notification it validates.

Page 188: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 40

Guided Practice Les 8-2 RESPOND processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-2RESPOND processing

Guided Practice Les 8-2RESPOND processing

2. In your PL/SQL procedure include logic forRESPOND funcmode:a. get the notification id (nid) from the engine

context variable wf_engine.context_nidb. retrieve the response result using API call

wf_notification.GetAttrText(nid,’RESULT’)

2. In your PL/SQL procedure include logic forRESPOND funcmode:a. get the notification id (nid) from the engine

context variable wf_engine.context_nidb. retrieve the response result using API call

wf_notification.GetAttrText(nid,’RESULT’)

Setting Resultout ParameterParameter resultout should be set to wf_engine.eng_completed||’:’||<ntf resultretrieved> if the response was successfully validated.Resultout should be set to wf_engine.eng_error||’:’||wf_engine.eng_null if theresponse failed validation.Resultout should be set to wf_engine.eng_null if the function mode is notimplemented or you do not wish to override the current result for the activity.

Page 189: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 41

Guided Practice Les 8-2 RESPOND processingcontinued

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-2RESPOND processing continued

Guided Practice Les 8-2RESPOND processing continued

3. If response is APPROVED, no further responsevalidation is neededa. set the resultout to

wf_engine.eng_completed||’:’||<ntf resultretrieved>

b. return

3. If response is APPROVED, no further responsevalidation is neededa. set the resultout to

wf_engine.eng_completed||’:’||<ntf resultretrieved>

b. return

Setting Resultout ParameterParameter resultout should be set to wf_engine.eng_completed||’:’||<ntf resultretrieved> if the response was successfully validated.Resultout should be set to wf_engine.eng_error||’:’||wf_engine.eng_null if theresponse failed validation.Resultout should be set to wf_engine.eng_null if the function mode is notimplemented or you do not wish to override the current result for the activity.

Page 190: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 42

Guided Practice Les 8-2 RESPOND processingcontinued

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-2RESPOND processing continued

Guided Practice Les 8-2RESPOND processing continued

4. If response is REJECTED, retrieve the alternatefrom and to dates using API callwf_notification.GetAttrDate(nid,<attribute_ name>)a. if the alternate dates are valid, set resultout to

wf_engine.eng_completed||’:’||<ntf resultretrieved>

b. if the alternate dates are in error, raise anexception using API call wf_core.Raise(<yourmessage>) and set resultout towf_engine.eng_error||’:’||wf_engine.eng_null

4. If response is REJECTED, retrieve the alternatefrom and to dates using API callwf_notification.GetAttrDate(nid,<attribute_ name>)a. if the alternate dates are valid, set resultout to

wf_engine.eng_completed||’:’||<ntf resultretrieved>

b. if the alternate dates are in error, raise anexception using API call wf_core.Raise(<yourmessage>) and set resultout towf_engine.eng_error||’:’||wf_engine.eng_null

Setting Resultout ParameterParameter resultout should be set to wf_engine.eng_completed||’:’||<ntf resultretrieved> if the response was successfully validated.Resultout should be set to wf_engine.eng_error||’:’||wf_engine.eng_null if theresponse failed validation.Resultout should be set to wf_engine.eng_null if the function mode is notimplemented or you do not wish to override the current result for the activity.

Page 191: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 43

Guided Practice Les 8-2 FORWARD processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-2FORWARD processing

Guided Practice Les 8-2FORWARD processing

5. In your PL/SQL procedure include logic forTRANSFER funcmode:a. raise an exception using API call

wf_core.Raise(<your message>) and setresultout towf_engine.eng_error||’:’||wf_engine.eng_null

5. In your PL/SQL procedure include logic forTRANSFER funcmode:a. raise an exception using API call

wf_core.Raise(<your message>) and setresultout towf_engine.eng_error||’:’||wf_engine.eng_null

Page 192: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 44

Guided Practice Les 8-2 FORWARD, RUN, TIMEOUTprocessing

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

6. In your PL/SQL procedure do not implement logicfor FORWARD, RUN, or TIMEOUT funcmodes:a. no special logic neededb. set parameter resultout to wf_engine.eng_null

to indicate the funcmode is not implemented

6. In your PL/SQL procedure do not implement logicfor FORWARD, RUN, or TIMEOUT funcmodes:a. no special logic neededb. set parameter resultout to wf_engine.eng_null

to indicate the funcmode is not implemented

Page 193: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 45

Guided Practice Les 8-2 Adding a Post-NotificationFunction

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 8-2Adding a Post-Notification Function

Guided Practice Les 8-2Adding a Post-Notification Function

7. In the Workflow Builder Vacation Proposal processdiagram:a. Open the Properties for the Vacation Proposal

notification node and enter a Function Namewith format <package.procedure> for thePL/SQL procedure you just created.

7. In the Workflow Builder Vacation Proposal processdiagram:a. Open the Properties for the Vacation Proposal

notification node and enter a Function Namewith format <package.procedure> for thePL/SQL procedure you just created.

Function Value<package.procedure> value should look likeWFVACXX.NTF_VACATION_PROPOSAL where ‘XX’ is the unique numberassigned to your work station.

Page 194: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Defining Function and Process ActivitiesChapter 8 - Page 46

Les 8-2 Summary

Copyright Oracle Corporation, 2000. All rights reserved.®

Les 8-2 SummaryLes 8-2 Summary

In this practice, you should have learned how to:• Create a PL/SQL procedure using the standard API

format for notification activity functions• Write post-notification processing to validate and

reject a notification response• Write post-notification processing to prevent

transfer of a notification• Write post-notification processing to allow a

notification to be delegated• Assign a function to a notification activity

In this practice, you should have learned how to:• Create a PL/SQL procedure using the standard API

format for notification activity functions• Write post-notification processing to validate and

reject a notification response• Write post-notification processing to prevent

transfer of a notification• Write post-notification processing to allow a

notification to be delegated• Assign a function to a notification activity

Sample SolutionsRefer to PL/SQL package specification and body definition files wfvacxxs.sql andwfvacxxb.sql and workflow definition file wfvacxx_82.wft for sample solutions.The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample proceduresused throughout the lesson practices. The procedure specific to Practice 8-2 isWFVACXX.NTF_VACATION_PROPOSAL.

Page 195: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 1

Diagramming a WorkflowProcessChapter 9

Page 196: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 2

Diagramming a Workflow Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Diagramming a Workflow ProcessDiagramming a Workflow Process

Page 197: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

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

Page 198: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 4

Create a New Workflow Process Definition

Copyright Oracle Corporation, 2000. All rights reserved.®

Create a New Workflow ProcessDefinition

Create a New Workflow ProcessDefinition

To create a new workflow process:To create a new workflow process:•• Define the item type of the processDefine the item type of the process•• Define item type attributes for the processDefine item type attributes for the process•• Define lookup types and lookup codesDefine lookup types and lookup codes•• Define messagesDefine messages•• Define message attributesDefine message attributes•• Define the activities in the process as Function,Define the activities in the process as Function,

Notification, or ProcessNotification, or Process•• Diagram the relationship of the activitiesDiagram the relationship of the activities

Page 199: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 5

Loading Roles

Copyright Oracle Corporation, 2000. All rights reserved.®

Loading RolesLoading Roles

Loading RolesIf you wish to set the recipient of a notification to a constant value, you mustfirst load the roles stored in your Oracle Workflow directory service into OracleWorkflow Builder. To load roles, use the following procedure:1. Choose File—>Open to connect to your database and open the item typefor which you are creating a process diagram.2. Choose File—>Load Roles from Database.3. Specify search criteria in the Find Roles field of the Role selectionwindow and then choose Find.4. Select the roles you want to load in the Query Results list, then chooseAdd to add them to the Loaded Roles list.5. Choose OK to load the roles and make them available to the objects inyour open item type.Directory Service DisplayUse the Directory Service branch in the navigator tree to see information aboutthe roles you load from the database.List-of-Values for Role AttributesYou can select roles from the list of values which the directory servicepopulates. List-of-values is available wherever large lists are used.

Page 200: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 6

Diagramming a Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Diagramming a ProcessDiagramming a Process

1. To begin drawing a process diagram, you mustdisplay the process window. This can be done in several ways:a. Double-click on the process activity on the

navigator tree.b. Select the process activity and press Ctrl + E.c. Select the process activity and choose Process

Details from the Edit menu.d. Use the Quick Start Wizard to create a process

activity and initial diagram with Start and End nodes.

1. To begin drawing a process diagram, you mustdisplay the process window. This can be done in several ways:a. Double-click on the process activity on the

navigator tree.b. Select the process activity and press Ctrl + E.c. Select the process activity and choose Process

Details from the Edit menu.d. Use the Quick Start Wizard to create a process

activity and initial diagram with Start and End nodes.

Each process diagram must have one or more Start activities and one or more End activities.

Page 201: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 7

Quick Start Wizard

Copyright Oracle Corporation, 2000. All rights reserved.®

Quick Start WizardQuick Start Wizard

Quick Start WizardThe Quick Start Wizard creates a process and opens the process window.The start and end nodes are automatically created. The workflowdeveloper uses the process diagram toolbar icons to create additionalactivity nodes.

Page 202: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 8

Diagramming a Process (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Diagramming a Process (continued)Diagramming a Process (continued)

2. Create a new node in the process by using one ofthe following methods:a. Select an activity (process, function or

notification) from the navigator tree and drag itto the process window

b. Choose from the NewFunction/Process/Notification toolbar button

c. Choose Create Activity from the right mousebutton menu while your cursor is in theprocess window

2. Create a new node in the process by using one ofthe following methods:a. Select an activity (process, function or

notification) from the navigator tree and drag itto the process window

b. Choose from the NewFunction/Process/Notification toolbar button

c. Choose Create Activity from the right mousebutton menu while your cursor is in theprocess window

Drawing the Process DiagramNote: In the process window, you can display information about an activity bymoving your mouse over the activity. The Label Name, Internal Name, DisplayName, Comment, and Performer appears in a tool-tip-style display.

Page 203: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 9

Show Label in Designer Menu Option

Copyright Oracle Corporation, 2000. All rights reserved.®

Show Label in Designer Menu OptionShow Label in Designer Menu Option

View/Show Label in Designer Navigator Menu OptionsThe View—>Show Label In Designer menu options are:

Instance Label: Uses the node label for each activity nodeInternal Name: Uses the internal name of an activity as the labelfor each activity nodeDisplay name: Uses the display name of an activity as the label foreach activity nodePerformer: Uses the activity’s performer as the label for eachactivity nodeComment: Uses the activity’s comment as the label for eachactivity node

Page 204: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 10

Display Modes

Copyright Oracle Corporation, 2000. All rights reserved.®

Display ModesDisplay Modes

Object Internal names

Standard icons used for display

Display ModesYou can toggle between the following two display modes of the workflowbuilder:

Presentation modeDeveloper mode

In presentation mode, workflow builder shows the names for the activityicons that you specify in their property page.The developer mode assists you in developing large complex processes asfollows:

Providing visual distinctions between top-level processes andsubprocesses in the navigator treeSetting the icons for each activity and object to the default icon ofits object type or subtype in both the navigator tree and the processdiagram windowIdentifying each object in the navigator tree by its internal, ordeveloper, nameIdentifying each activity in the process diagram window by itsactivity label

Page 205: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 11

Diagramming a Process (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Diagramming a Process (continued)Diagramming a Process (continued)

3. Create a transition (arrow) between two nodes byholding down the right mouse button anddragging the cursor from the source activity to thedestination activity.

4. Choose a result from the list of possible resultcodes that appear if the source activity has aresult type defined.

3. Create a transition (arrow) between two nodes byholding down the right mouse button anddragging the cursor from the source activity to thedestination activity.

4. Choose a result from the list of possible resultcodes that appear if the source activity has aresult type defined.

Drawing the Process Diagram (continued)If the source activity has no result type associated with it, by default no labelappears on the transition. You can choose to show a label for such a transitionby selecting the transition, holding down the right mouse button, and clearingthe Hidden Label option. The label will display as <Default>.If the source activity has an associated result type you can create transitions tofollow:a. When a specific result is returned by the activity, labeled with the resultdisplay nameb. When a result returned is not covered by other transitions, labeled <Default>c. Regardless of result returned, labeled <Any>d. When the activity times out, labeled <Timeout>

If the source activity is a voting activity you can also create transitions tofollow:a. When the vote results in a tie, labeled <Tie>b. When the vote doesn’t return a result, labeled <No Match>

Note: For more information on good diagramming practices please see thefollowing URL :

Page 206: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 12

http://www-apps.us.oracle.com/atg/wf/index.html.Choose the Workflow Development Standards link to the More Tips for GoodDiagramming link.

Page 207: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 13

Self-Looping Transitions

Copyright Oracle Corporation, 2000. All rights reserved.®

Self-Looping TransitionsSelf-Looping Transitions

Activity loopsback to itselfon Timeout

Self-Looping TransitionsHow to draw a self-loop transition1. Select the activity node.2. Hold down the right mouse button.3. Drag the cursor away and back to the same activity node.4. Release the right mouse button and select the transition label from the listof results.Note: The node Timeout property must be set to enable the <Timeout> optionin the transition list of results.

Page 208: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 14

<Any> Transitions

Copyright Oracle Corporation, 2000. All rights reserved.®

<Any> Transitions<Any> Transitions

No

Ye s

Approve

Re je ct

<Any>

Docume ntApprove d

Docume ntRe je cte d

End (Re je ct)

End (Approve )

Re vie wDocume nt

Sta rt

Log Re vie w Automatic parallel branchingwith the

<Any> transition

<Any> TransitionThe Workflow Engine follows an <Any> transition regardless of whatcompletion result the activity returns. This allows you to include a genericactivity in the process that the Workflow Engine executes in parallel withthe result-specific activity.

Page 209: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 15

Top Down Design

Copyright Oracle Corporation, 2000. All rights reserved.®

Top Down DesignTop Down DesignPalette permits

creating processes, notifications or

functions without underlying

dependencies

No need to specify function

at this point

Top Down DesignOracle Workflow Builder previously required you to enter a workflowdefinition by defining underlying components before drawing the processdiagram. The top-down design approach lets you draw the processdiagram first and then define the underlying components.When you save a partially completed top-down process, workflow builderdisplays an error window with a list of invalid or missing information.You can save the errored process definition and correct the errors later.The activity and process activity property pages are now accessible fromone dialogue. The property page now includes all tabs both for the baseactivity of the node and the usage of the individual node.

Page 210: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 16

Top Down Design

Copyright Oracle Corporation, 2000. All rights reserved.®

Top Down DesignTop Down Design

Functions can be createdwhile designing

Palette permits creating processes,

notifications orfunctions without

underlyingdependencies

No need to specify function

at this point

Page 211: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 17

Validation Performed by the Verify Command

Copyright Oracle Corporation, 2000. All rights reserved.®

Validation Performed by the VerifyCommand

Validation Performed by the VerifyCommand

• At least one Start and one End activity exists.• A process does not contain itself as a process

activity.• The same subprocess is not being used twice in a

process.• All possible activity results are modeled as

outgoing transitions.• All activity nodes marked as END nodes do not

have any outgoing transitions.

• At least one Start and one End activity exists.• A process does not contain itself as a process

activity.• The same subprocess is not being used twice in a

process.• All possible activity results are modeled as

outgoing transitions.• All activity nodes marked as END nodes do not

have any outgoing transitions.

Verify TransitionsWhen you save your work the Workflow Builder automatically validatesthe process definition for any invalid or missing information and displayswhat it finds in a Workflow Error verification window. You can verifyyour workflow definition at any time during a builder session by selectingan object (for example, data store, item type, and process) in the navigatortree and choosing Verify from the File menu options. This will validatethe definitions in the current data store.Note: The Verify option is enabled in the File menu only when thenavigator window is the current window.

Page 212: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 18

Validation Performed by the Verify Command(continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Validation Performed by the VerifyCommand (continued)

Validation Performed by the VerifyCommand (continued)

• Each notification activity's result type matches thelookup type defined for the message's RESULTmessage attribute.

• All message attributes referenced in a messagebody for token substitution exist in the messagedefinition.

• All processes that reference objects from anotheritem type verify the existence of requisite itemattributes associated with that referenced item.

• Each notification activity's result type matches thelookup type defined for the message's RESULTmessage attribute.

• All message attributes referenced in a messagebody for token substitution exist in the messagedefinition.

• All processes that reference objects from anotheritem type verify the existence of requisite itemattributes associated with that referenced item.

Advanced Definition ValidationYou should always validate any new process definition you create as ithelps you to identify any potential problems with the definition that mightprevent it from executing successfully.

Page 213: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 19

Editing a Transition

Copyright Oracle Corporation, 2000. All rights reserved.®

Editing a TransitionEditing a Transition

1. Select the transition you want to edit.2. Click on the right mouse button to edit the

transition– Delete transition: deletes the selected

transition– Locked: toggles between locking and

unlocking the transition from further edits– Hidden label: toggles between displaying and

hiding the transition label– Straighten: straightens the transition by

removing extra vertex points causing the bend– Results: allows changing of result label

already assigned

1. Select the transition you want to edit.2. Click on the right mouse button to edit the

transition– Delete transition: deletes the selected

transition– Locked: toggles between locking and

unlocking the transition from further edits– Hidden label: toggles between displaying and

hiding the transition label– Straighten: straightens the transition by

removing extra vertex points causing the bend– Results: allows changing of result label

already assigned

Page 214: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 20

Editing a Transition (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Editing a Transition (continued)Editing a Transition (continued)3. Repositioning a transition label: select the label

with the mouse and drag to the new position4. Bending a transition: select the transition and drag

by holding down the left mouse button to create avertex point.

5. Creating a self-looping transition: one of two ways– Hold down right mouse button and drag

mouse from source activity back to itself– Draw a transition to some other activity, add a

vertex point to the transition, then select thearrowhead with left mouse button and dragback to originating activity

6. Removing vertex point: select the vertex and dragover another to combine the two points

3. Repositioning a transition label: select the labelwith the mouse and drag to the new position

4. Bending a transition: select the transition and dragby holding down the left mouse button to create avertex point.

5. Creating a self-looping transition: one of two ways– Hold down right mouse button and drag

mouse from source activity back to itself– Draw a transition to some other activity, add a

vertex point to the transition, then select thearrowhead with left mouse button and dragback to originating activity

6. Removing vertex point: select the vertex and dragover another to combine the two points

Page 215: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 21

Customizing a Process Node

Copyright Oracle Corporation, 2000. All rights reserved.®

Customizing a Process NodeCustomizing a Process Node

Customize a NodeSince an activity can be reused throughout a process, a node represents aninstance of that activity and its properties are unique to that instance. Tocustomize a node, in the Process Activity property page:1. Specify whether the activity is a Start, End, or Normal activity in theprocess.

For an End activity, if the process itself has a result type associated with it,you should specify what the result of the process is when this End activitycompletes. Choose from the possible results listed in the result type of theprocess activity.

2. If you use an activity more than once in a process, subsequent nodes ofthat activity will have an “-N” appended to its label name to identify it as aunique instance.3. If the activity is a notification, specify a performer.

A performer is a role that can consist of one or more users.You can specify a static role. Specify Constant for the Performer Type, then

select a role name. Note that you must first load roles from your databasefirst.

You can alternatively specify a dynamic role. Select item attribute for thePerformer type, then select an Item Type attribute that returns a role nameduring runtime.

Page 216: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 22

Setting Activity Attribute Values

Copyright Oracle Corporation, 2000. All rights reserved.®

Setting Activity Attribute ValuesSetting Activity Attribute Values

Activity AttributesBecause an activity can be reused throughout a process, the value of an activityattribute can vary from node to node. Specify the values for the attributes in theAttribute Values property page.1. Select the attribute.2. The value can be constant or dynamic:

For a constant value, select Constant, then enter a value.For a dynamic value, select Item Attribute, then select the name of an item

type attribute that returns a value of the same type during runtime.

Page 217: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 23

Deleting Item Attributes

Copyright Oracle Corporation, 2000. All rights reserved.®

Deleting Item AttributesDeleting Item Attributes

• You use workflow builder to delete item attributesfrom a workflow definition in a database

• To actually delete an attribute from the databaseyou must be connected to that database. Deletingfrom a flat file and uploading it will not delete theattribute from the database

• You use workflow builder to delete item attributesfrom a workflow definition in a database

• To actually delete an attribute from the databaseyou must be connected to that database. Deletingfrom a flat file and uploading it will not delete theattribute from the database

Note: Deleting an item attribute from a workflow definition stored in a flatfile, then uploading that flat file definition to a database will not delete theitem attribute from the definition stored in the database. To delete an itemattribute completely, you must delete it from your flat file definition andspecifically from any databases in which that workflow item type isloaded.

Page 218: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 24

Standard Activities

Copyright Oracle Corporation, 2000. All rights reserved.®

Standard ActivitiesStandard Activities

Standard ActivitiesThe standard item type includes function and notification activities thatcan be included in process diagrams associated with the other item types.For a full explanation of the above standard activities please see theOracle Workflow Guide (Release 2.5), chapter 6, Predefined WorkflowActivities.

Page 219: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 25

Saving the Process Definition

Copyright Oracle Corporation, 2000. All rights reserved.®

Saving the Process DefinitionSaving the Process Definition

• Always save the process definition to a flat file forsource control.

• Before saving the process definition to theproduction database, save to a developmentdatabase for testing.

• The Workflow Loader is a utility program thatmoves workflow definitions between database andflat files. It is used to move definitions betweendevelopment and production databases, or toapply upgrades to existing definitions.

• Always save the process definition to a flat file forsource control.

• Before saving the process definition to theproduction database, save to a developmentdatabase for testing.

• The Workflow Loader is a utility program thatmoves workflow definitions between database andflat files. It is used to move definitions betweendevelopment and production databases, or toapply upgrades to existing definitions.

Page 220: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 26

Reviewing the Process Definition

Copyright Oracle Corporation, 2000. All rights reserved.®

Reviewing the Process DefinitionReviewing the Process Definition

Item Type Definition Web PageThe Item Type Definition Web page provides you with distributed access toworkflow definitions stored in your Oracle Workflow database.

The item type Definition Web page provides detailed view of attributes,processes, notifications, functions, messages, and lookup types associatedwith a given item type.

The information is displayed in two frames. The left frame lists all the objectsin the item type in an expandable hierarchy tree, similar to the navigatortree in Oracle Workflow Builder. The right frame displays the details ofthe object you select in the hierarchy tree. Select either frame at any timeand use the Print command in your Web browser to print all theinformation in the selected frame.

Displaying the Item Type Definition Web Page1. Enter the URL <webagent>/wf_item_definition.find_item_type in yourWeb browser.2. Select the item type to display.3. Specify the effective date and time of the item type definition you want todisplay, using the format DD-MON-RRRR.4. Choose Find.

Page 221: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 27

Version Compatibility

Copyright Oracle Corporation, 2000. All rights reserved.®

Version CompatibilityVersion Compatibility

• All Oracle Workflow client modules automaticallyverify that the module is compatible with theversion of the Oracle Workflow server that it isoperating against.

• To determine which version of the OracleWorkflow server is running, connect to theWorkflow server account using SQL/PLUS andexecute the script wfver.sql

• All Oracle Workflow client modules automaticallyverify that the module is compatible with theversion of the Oracle Workflow server that it isoperating against.

• To determine which version of the OracleWorkflow server is running, connect to theWorkflow server account using SQL/PLUS andexecute the script wfver.sql

Version Compatibility CheckYou can check that the workflow builder is compatible with the version ofthe workflow server against which it is operating.

Page 222: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 28

Display Name Conflicts

Copyright Oracle Corporation, 2000. All rights reserved.®

Display Name ConflictsDisplay Name Conflicts

• If a nonunique display name is encountered duringupload/upgrade, the Workflow Definition Loaderautomatically resolves the display name conflictby adding a “@” character to the beginning ofconflicting display names.

• If a nonunique display name is encountered duringupload/upgrade, the Workflow Definition Loaderautomatically resolves the display name conflictby adding a “@” character to the beginning ofconflicting display names.

Display Name ConflictsThe workflow definitions loader automatically resolves display nameconflicts caused when the following entities share the same display name:

The upload/upgrade definitionThe target database

Page 223: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 29

Practice Les 9-1 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Practice Les 9-1 OverviewPractice Les 9-1 Overview

This practice covers the following topics:• Creating a Notification Timeout• Adding a Result Type to a process• Adding an Error Process to a process

Note: You will have an opportunity to test thesechanges in a later Practice.

This practice covers the following topics:• Creating a Notification Timeout• Adding a Result Type to a process• Adding an Error Process to a process

Note: You will have an opportunity to test thesechanges in a later Practice.

Page 224: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 30

Practice Les 9-1 Overview Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

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

Using the Vacation Proposal process created inPractice Les 8-1 or 8-2:

• Add a Timeout to the Vacation Proposalnotification

• Implement one of the following:– On timeout, transition back to the same

notification until a response is received– On timeout, transition to a loop counter and

back to the Vacation Proposal 2 times, on the3rd loop exit to approve the proposal

– On timeout, transition to a remindernotification

Using the Vacation Proposal process created inPractice Les 8-1 or 8-2:

• Add a Timeout to the Vacation Proposalnotification

• Implement one of the following:– On timeout, transition back to the same

notification until a response is received– On timeout, transition to a loop counter and

back to the Vacation Proposal 2 times, on the3rd loop exit to approve the proposal

– On timeout, transition to a remindernotification

Sample SolutionsRefer to PL/SQL package specification and body definition files wfvacxxs.sql andwfvacxxb.sql, and workflow definition files wfvacxx_81.wft and wfvacxx_82.wftfor sample solutions.The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample proceduresused throughout the lesson practices.The procedure specific to Practice 8-1 is WFVACXX.SCHEDULE_UPDATE.The procedure specific to Practice 8-2 isWFVACXX.NTF_VACATION_PROPOSAL.

Page 225: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 31

Practice Les 9-1 Overview Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

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

• Modify the Vacation Proposal process properties:– assign Result Type ‘Approval’– assign Error Process DEFAULT_ERROR from

Error Item Type WFERROR• Label the two process End points with the

appropriate result

• Modify the Vacation Proposal process properties:– assign Result Type ‘Approval’– assign Error Process DEFAULT_ERROR from

Error Item Type WFERROR• Label the two process End points with the

appropriate result

Page 226: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 32

Guided Practice Les 9-1 Adding a Timeout

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 9-1Adding a Timeout

Guided Practice Les 9-1Adding a Timeout

1. In the Workflow Builder open the VacationProposal process diagram created in Practice Les8-1 or 8-2:a. Open the Properties for the Vacation Proposal

notification node. Select the Node tab and setthe Timeout.– Hint: simplest method for testing is to set

the Timeout Type to Relative Time and theValue to a short duration such as 5 Minutes

1. In the Workflow Builder open the VacationProposal process diagram created in Practice Les8-1 or 8-2:a. Open the Properties for the Vacation Proposal

notification node. Select the Node tab and setthe Timeout.– Hint: simplest method for testing is to set

the Timeout Type to Relative Time and theValue to a short duration such as 5 Minutes

Page 227: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 33

Guided Practice Les 9-1 Adding a Self-TimeoutTransition

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 9-1Adding a Self-Timeout Transition

Guided Practice Les 9-1Adding a Self-Timeout Transition

2. In the Workflow Builder Vacation Proposal processdiagram:a. Select the Vacation Proposal notification node,

hold down your right mouse button and dragaway and back to the Vacation Proposal node.Let go of the right mouse button.

b. Choose <Timeout> from the transition results.

2. In the Workflow Builder Vacation Proposal processdiagram:a. Select the Vacation Proposal notification node,

hold down your right mouse button and dragaway and back to the Vacation Proposal node.Let go of the right mouse button.

b. Choose <Timeout> from the transition results.

Page 228: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 34

Guided Practice Les 9-1 Adding a Loop CounterFunction Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

3. In the Workflow Builder WFVACXX item type:a. Open the Vacation Proposal process diagramb. Locate the Loop Counter function activity in

the Standard item typec. Drag and drop the Loop Counter activity into

the Vacation Proposal process diagrampositioning it above the Vacation Proposalnotification node

d. Open the Loop Counter node Properties andgo to the Node Attributes tab to set thenumber of times to loop

3. In the Workflow Builder WFVACXX item type:a. Open the Vacation Proposal process diagramb. Locate the Loop Counter function activity in

the Standard item typec. Drag and drop the Loop Counter activity into

the Vacation Proposal process diagrampositioning it above the Vacation Proposalnotification node

d. Open the Loop Counter node Properties andgo to the Node Attributes tab to set thenumber of times to loop

Locating the Loop Counter Function ActivityWith the cursor in the Builder Navigator window, select Find… from the Editmenu (or ctrl+F). Enter ‘Loop Counter’ in the Search Text field, check theDisplay Name and Function checkboxes and click on the Search button. TheLoop Counter will be automatically selected. Close the Find window.

Page 229: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 35

Guided Practice Les 9-1 Adding a Loop CounterFunction Activity Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

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

Continued

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

Continuede. Select attribute Loop Limit and set it to a

Constant Type with a Value of 2e. Select attribute Loop Limit and set it to a

Constant Type with a Value of 2

Page 230: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 36

Guided Practice Les 9-1 Adding a Timeout transition toLoop Counter

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 9-1Adding a Timeout transition to Loop

Counter

Guided Practice Les 9-1Adding a Timeout transition to Loop

Counter4. In the Workflow Builder Vacation Proposal process

diagram:a. Select the Vacation Proposal notification node,

draw a transition to the Loop Counter nodechoosing <Timeout> from the Results menu

b. Create a vertex in the transition line betweenthe nodes

c. Select the Loop Counter node, draw atransition to the Vacation Proposal notificationnode choosing Loop from the transitionresults

4. In the Workflow Builder Vacation Proposal processdiagram:a. Select the Vacation Proposal notification node,

draw a transition to the Loop Counter nodechoosing <Timeout> from the Results menu

b. Create a vertex in the transition line betweenthe nodes

c. Select the Loop Counter node, draw atransition to the Vacation Proposal notificationnode choosing Loop from the transitionresults

Page 231: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 37

Guided Practice Les 9-1 Adding a Timeout transition toLoop Counter Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 9-1Adding a Timeout transition to Loop

Counter Continued

Guided Practice Les 9-1Adding a Timeout transition to Loop

Counter Continuedd. Select the Loop Counter node, draw a

transition to the Vacation Approved nodechoosing Exit from the transition results

d. Select the Loop Counter node, draw atransition to the Vacation Approved nodechoosing Exit from the transition results

Page 232: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 38

Guided Practice Les 9-1 Assigning a Process Resultand Error Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 9-1Assigning a Process Result

and Error Process

Guided Practice Les 9-1Assigning a Process Result

and Error Process5. In the Workflow Builder Navigator open the

Properties for the Vacation Proposal process:a. Select Approval from the Result Type poplistb. Select the Details tab and enter:

Error Item Type WFERRORError Process DEFAULT_ERROR

5. In the Workflow Builder Navigator open theProperties for the Vacation Proposal process:a. Select Approval from the Result Type poplistb. Select the Details tab and enter:

Error Item Type WFERRORError Process DEFAULT_ERROR

Page 233: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 39

Guided Practice Les 9-1 Labeling End nodes withResult

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 9-1Labeling End nodes with Result

Guided Practice Les 9-1Labeling End nodes with Result

6. In the Workflow Builder Vacation Proposal processdiagram:a. Open the Properties for each End node and

select the Node tabb. Select a value from the Result poplist

– Approve for the End node associated withthe vacation proposal approved paththrough the process

– Reject for the End node associated with thevacation proposal rejected path through theprocess

6. In the Workflow Builder Vacation Proposal processdiagram:a. Open the Properties for each End node and

select the Node tabb. Select a value from the Result poplist

– Approve for the End node associated withthe vacation proposal approved paththrough the process

– Reject for the End node associated with thevacation proposal rejected path through theprocess

Note:The Start/End property must be set to End to enable the Result property on thenode.

Page 234: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Diagramming a Workflow ProcessChapter 9 - Page 40

Les 9-1 Summary

Copyright Oracle Corporation, 2000. All rights reserved.®

Les 9-1 SummaryLes 9-1 Summary

In this practice, you should have learned how to:• Set a Timeout property and create a <Timeout>

transition for a notification activity• Modify Process properties• Assign a result to a process End node

In this practice, you should have learned how to:• Set a Timeout property and create a <Timeout>

transition for a notification activity• Modify Process properties• Assign a result to a process End node

Sample SolutionsRefer to workflow definition file wfvacxx_91.wft for Timeout using a LoopCounter sample solution.

Page 235: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 1

Overview of the WorkflowEngineChapter 10

Page 236: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 2

Overview of the Workflow Engine

Copyright Oracle Corporation, 2000. All rights reserved.®

Overview of the Workflow EngineOverview of the Workflow Engine

Page 237: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

After this lesson, you should be able to:• Give a general description of how the Workflow

Engine manages a process• Apply the Workflow Engine APIs to your function

activities

After this lesson, you should be able to:• Give a general description of how the Workflow

Engine manages a process• Apply the Workflow Engine APIs to your function

activities

Page 238: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 4

Overview of the Workflow Engine

Copyright Oracle Corporation, 2000. All rights reserved.®

Overview of the Workflow EngineOverview of the Workflow Engine

• Is implemented in server-side PL/SQL.• Is activated whenever a call to one of its PL/SQL

procedures or functions is made.• Manages the state of activities for each process

instance.• Determines the next activity once a prerequisite

activity completes.• Executes function activities automatically.• Calls the Notification System to send notification

messages.

• Is implemented in server-side PL/SQL.• Is activated whenever a call to one of its PL/SQL

procedures or functions is made.• Manages the state of activities for each process

instance.• Determines the next activity once a prerequisite

activity completes.• Executes function activities automatically.• Calls the Notification System to send notification

messages.

The Oracle Workflow Engine:The Oracle Workflow Engine:

Note: The Notification System is also implemented in server-side PL/SQL andcan interface with an Oracle Web Agent or the Notification Mailer program todeliver notifications to end users.

Page 239: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 5

Overview of the Workflow Engine (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Overview of the Workflow Engine(continued)

Overview of the Workflow Engine(continued)

• Supports results-based branches, parallelbranches, rendezvous, loops and subprocesses.

• Can execute activities from non-savepointenvironments such as database triggers anddistributed transactions. It automatically trapssavepoint-not-allowed errors.

• Can defer activities too costly to execute in realtime to background engines for processing.

• Maintains a history of completed activities.• Detects error conditions and executes error

processes.

• Supports results-based branches, parallelbranches, rendezvous, loops and subprocesses.

• Can execute activities from non-savepointenvironments such as database triggers anddistributed transactions. It automatically trapssavepoint-not-allowed errors.

• Can defer activities too costly to execute in realtime to background engines for processing.

• Maintains a history of completed activities.• Detects error conditions and executes error

processes.

Page 240: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 6

Workflow Engine Features

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Engine FeaturesWorkflow Engine Features

• Managing process state• Coordinating execution of activities• Sophisticated rules including looping, results-

based branching, parallel flows, and subprocesses• Deferred processing• Detecting error conditions and running error

processes

• Managing process state• Coordinating execution of activities• Sophisticated rules including looping, results-

based branching, parallel flows, and subprocesses• Deferred processing• Detecting error conditions and running error

processes

The Workflow Engine supports the following features:The Workflow Engine supports the following features:

Additional Workflow Engine FeaturesFor explicit information on the above features please see the OracleWorkflow Guide (Release 2.5), chapter 8 Oracle Workflow APIs.

Page 241: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 7

Initiating a Workflow Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Initiating a Workflow ProcessInitiating a Workflow Process

• Your application must execute a procedure thatcalls the following Workflow Engine APIs:– WF_ENGINE.CreateProcess– WF_ENGINE.StartProcess

or– WF_ENGINE.LaunchProcess

• The procedure must identify the value of theprocess item type and item key for these APIs

• Your application must execute a procedure thatcalls the following Workflow Engine APIs:– WF_ENGINE.CreateProcess– WF_ENGINE.StartProcess

or– WF_ENGINE.LaunchProcess

• The procedure must identify the value of theprocess item type and item key for these APIs

To start a workflow process:To start a workflow process:

Initiating Workflow ProcessesOracle Workflow Release 2.5 now includes a new Launch Processes WebPage for initiating workflow processes. The Launch Processes link can befound on the Workflow Home Page. It is intended for use by theWorkflow Administrator and for testing workflow processes in adevelopment environment.

Note: For more information on the syntax and descriptions of the aboveAPIs please see the Oracle Workflow User Guide (Release 2.5), chapter 8Workflow Engine APIs section.

Page 242: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 8

Workflow Engine Processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Engine ProcessingWorkflow Engine Processing

Upon starting a process, the Workflow Engine:• Identifies and executes the Start activity• Determines the next activity to transition to after

completing the prerequisite activity or activities• Drives through the process, automatically

executing all function activities, until it comes to anotification or blocking activity

• Calls the Notification System to notify the recipient• Continues driving through the process until it

encounters an End activity, (once the performercompletes the notification or the block activity iscompleted)

Upon starting a process, the Workflow Engine:• Identifies and executes the Start activity• Determines the next activity to transition to after

completing the prerequisite activity or activities• Drives through the process, automatically

executing all function activities, until it comes to anotification or blocking activity

• Calls the Notification System to notify the recipient• Continues driving through the process until it

encounters an End activity, (once the performercompletes the notification or the block activity iscompleted)

Workflow EngineSets a savepoint for each completed function activitySaves all consecutively completed function activities as part of onecommit cycleIf an error occurs during a commit, the database can roll back to anappropriate savepoint

Note: A notification activity that sends an FYI notification message willbe automatically completed by the Workflow Engine. Only notificationsthat prompt for a response will cause the Workflow Engine to pause forresponse from the notification recipient.

Page 243: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 9

Activity Statuses

Copyright Oracle Corporation, 2000. All rights reserved.®

Activity StatusesActivity Statuses

Once the Workflow Engine executes an activity, itupdates the state of the activity to one of thefollowing statuses:• Active• Complete• Waiting• Notified• Deferred• Error• Suspend

Once the Workflow Engine executes an activity, itupdates the state of the activity to one of thefollowing statuses:• Active• Complete• Waiting• Notified• Deferred• Error• Suspend

Activity Status DefinitionsActive: Activity is currently being executed.Complete: Activity executed successfully.Waiting: Activity is waiting for dependencies to complete. Anexample is the AND activity, where one of its incoming activitytransitions is complete but is still waiting for another requiredincoming activity transition to complete before it can be marked ascomplete.Notified: Activity is waiting for a response from a notification orfor an external program to complete and call the Workflow Engine.Deferred: Activity is deferred to a background engine forexecution.Error: Activity has encountered an error during execution.Suspend: Activity is suspended from further execution.

Page 244: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 10

Calling the Workflow Engine

Copyright Oracle Corporation, 2000. All rights reserved.®

Calling the Workflow EngineCalling the Workflow Engine

• Engine must be informed when an activitycompletes.– Process, notification, and function activities

automatically callWF_ENGINE.CompleteActivity( ) when theycomplete.

– If a notification activity requires some action tobe taken in a form or Web page, then that formor Web page must callWF_ENGINE.CompleteActivity( ) when the usercompletes the transaction.

– If a function activity calls an external program,then code that external program to callWF_ENGINE.CompleteActivity( ) when itcompletes.

• Engine must be informed when an activitycompletes.– Process, notification, and function activities

automatically callWF_ENGINE.CompleteActivity( ) when theycomplete.

– If a notification activity requires some action tobe taken in a form or Web page, then that formor Web page must callWF_ENGINE.CompleteActivity( ) when the usercompletes the transaction.

– If a function activity calls an external program,then code that external program to callWF_ENGINE.CompleteActivity( ) when itcompletes.

Note:You can add a standard Block activity after any function activity that callsan external program. The Block activity will pause the process until theexternal program completes and makes a call toWF_ENGINE.CompleteActivity( ).For more information, see the Oracle Workflow Guide (Release 2.5) for acomplete description of all Oracle Workflow APIs.

Page 245: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 11

Oracle Workflow APIs

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow APIsOracle Workflow APIs

Oracle Workflow APIs are grouped as follows:• Engine APIs

– Starting/running a process– Communicating attribute information– Communicating state changes

• Core APIs: raising and catching errors• Purge APIs: purging obsolete runtime data• Directory APIs: communicating directory services

user and role information

Oracle Workflow APIs are grouped as follows:• Engine APIs

– Starting/running a process– Communicating attribute information– Communicating state changes

• Core APIs: raising and catching errors• Purge APIs: purging obsolete runtime data• Directory APIs: communicating directory services

user and role information

Page 246: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 12

Oracle Workflow APIs (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

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

• Monitor APIs: generating Workflow Monitor URLs• Notification APIs: managing notifications• Preference APIs: retrieving user preference

information• Queue APIs: handling workflow Advanced Queues

processing• Document Management APIs: returning URLs or

javascript functions• Views: providing public views to access workflow

data

• Monitor APIs: generating Workflow Monitor URLs• Notification APIs: managing notifications• Preference APIs: retrieving user preference

information• Queue APIs: handling workflow Advanced Queues

processing• Document Management APIs: returning URLs or

javascript functions• Views: providing public views to access workflow

data

Note:The public views are installed in the APPS account for the version ofOracle Workflow embedded in Oracle Applications.For more information, see the Oracle Workflow Guide (Release 2.5),chapter 8 for a complete description of all Oracle Workflow APIs.

Page 247: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 13

Workflow Engine APIs

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Engine APIsWorkflow Engine APIs

Use the following APIs to start or run a workflowprocess:• WF_ENGINE.CreateProcess• WF_ENGINE.StartProcess• WF_ENGINE.LaunchProcess• WF_ENGINE.SetItemOwner• WF_ENGINE.SetItemUserKey• WF_ENGINE.SetItemParent• WF_ENGINE.background

Use the following APIs to start or run a workflowprocess:• WF_ENGINE.CreateProcess• WF_ENGINE.StartProcess• WF_ENGINE.LaunchProcess• WF_ENGINE.SetItemOwner• WF_ENGINE.SetItemUserKey• WF_ENGINE.SetItemParent• WF_ENGINE.background

Workflow Engine APIs to Start or Run a ProcessThe item type and item key uniquely identify an item and must be passedto subsequent API calls for each specific process. The following APIs startor run a workflow process:

WF_ENGINE.CreateProcess creates a new runtime process for anapplication item.WF_ENGINE.StartProcess begins execution of the specifiedprocess.WF_ENGINE.LaunchProcess launches a specified process bycreating the new runtime process and beginning its execution.WF_ENGINE.SetItemOwner sets the owner of an existing item.WF_ENGINE.SetItemUserKey sets a user-friendly identifier foran item.WF_ENGINE.SetItemParent defines the parent/child relationshipfor a master-and-detail process.WF_ENGINE.background runs a background engine to processdeferred and/or timed out activities.

For more information, see the Oracle Workflow Guide (Release 2.5),chapter 8 for a complete description of all Oracle Workflow APIs.

Page 248: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 14

Workflow Engine APIs

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Engine APIsWorkflow Engine APIs

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

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

Workflow Engine APIs to Communicate Attribute InformationThe following APIs communicate attribute information to the WorkflowEngine:

WF_ENGINE.SetItemAttribute (3) sets the value of an item typeattribute in a process.WF_ENGINE.SetItemAttrDocument sets the value of an itemattribute of type document, to a documents identifier.WF_ENGINE.getItemTypes returns a list of all the item typesdefined in the Oracle Workflow database as a two dimensionaldata object.WF_ENGINE.GetItemAttribute (3) returns the value of an itemtype attribute in a process.WF_ENGINE.GetItemAttrDocument returns the documentidentifier of an item attribute of type document.

Page 249: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 15

Workflow Engine APIs

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Engine APIsWorkflow Engine APIs

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

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

Workflow Engine APIs to Communicate Attribute Information (continued)WF_ENGINE.GetActivityAttribute (3) returns the value of anactivity attribute in a process.WF_ENGINE.AddItemAttr adds an empty item attribute variableto the runtime process, so that a new item attribute can be definedat runtime.WF_ENGINE.GetItemAttrInfo returns information about an itemtype attribute, such as its type and format.WF_ENGINE.GetActivityAttrInfo returns information about anactivity attribute, such as its type and format.

For more information, see the Oracle Workflow Guide (Release 2.5),chapter 8 for a complete description of all Oracle Workflow APIs.

Page 250: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 16

Workflow Engine APIs

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Engine APIsWorkflow Engine APIs

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

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

Workflow Engine APIs to Communicate State ChangesWF_ENGINE.CompleteActivity notifies the engine that thespecified activity has been completed for the item.WF_ENGINE.BeginActivity determines if the specified activitycan currently be performed and raises an exception if it cannot.WF_ENGINE.AssignActivity assigns an activity to anotherperformer.WF_ENGINE.GetActivityLabel returns the instance label of anactivity, given the internal activity instance identification.WF_ENGINE.AbortProcess aborts process execution and cancelsoutstanding notifications.WF_ENGINE.SuspendProcess suspends process execution so thatusers cannot transition items to new activities.

Page 251: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 17

Workflow Engine APIs

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Engine APIsWorkflow Engine APIs

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

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

Workflow Engine APIs to Communicate State Changes (continued)WF_ENGINE.ResumeProcess returns a suspended process tonormal execution status.WF_ENGINE.HandleError handles any activity that hasencountered an error. This API can also be called for any arbitraryactivity in a process to roll back part of the process to that activity.WF_ENGINE.ItemStatus returns the status and results for the rootprocess of the specified item instance.WF_ENGINE.getProcessStatus returns the process status for thegiven item type instance as a two dimensional data object.

For more information, see the Oracle Workflow Guide (Release 2.5),chapter 8 for a complete description of all Oracle Workflow APIs.

Page 252: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 18

Background Engine

Copyright Oracle Corporation, 2000. All rights reserved.®

Background EngineBackground Engine

The Background Engine is a PL/SQL procedure.• The Background Engine checks for and executes

any deferred or timed out activities that satisfy thearguments of the procedure at the time theprocedure is invoked.

• The procedure ends once all matching activitiesare executed.

• If new activities are deferred or timed out after theinitiation of the current Background Engineprocedure, they will be processed when the nextBackground Engine procedure is initiated.

The Background Engine is a PL/SQL procedure.• The Background Engine checks for and executes

any deferred or timed out activities that satisfy thearguments of the procedure at the time theprocedure is invoked.

• The procedure ends once all matching activitiesare executed.

• If new activities are deferred or timed out after theinitiation of the current Background Engineprocedure, they will be processed when the nextBackground Engine procedure is initiated.

Resubmitting the Background EngineFor Oracle Workflow standalone, use one of the sample scriptsprovided or create your own custom script to make the backgroundengine procedure loop indefinitely:

wfbkg.sql: Located in the Oracle Workflow admin/sqlsubdirectorywfbkgchk.sql: Located in the Oracle Workflow admin/sqlsubdirectory

For Oracle Workflow embedded in Oracle Applications, use theWorkflow Background Process concurrent program to schedule thebackground engine procedure to run repeatedly.

Page 253: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 19

Background Engine

Copyright Oracle Corporation, 2000. All rights reserved.®

Background EngineBackground Engine

Background Engine APIBackground Engine API

WF_ENGINE.BACKGROUND(

itemtype in varchar2,

minthresholdin number default null,

maxthresholdin number default null,

process_deferred in boolean default TRUE,

process_timeout in boolean default TRUE);

Background Engine ParametersYou can set up as many background engines as needed, but if you set up

only one, then that background engine must handle both deferred and timed outactivities. That is, process_deferred and process_timeout must bothbe TRUE.

Background Engine Definitionsitemtype: Optional item type to restrict this engine to activities associated

with that item type.minthreshold: Optional minimum cost that an activity must have for this

background engine to execute it, in hundredths of a second.maxthreshold: Optional maximum cost an activity can have for this

background engine to execute it, in hundredths of a second.process_deferred: Set to TRUE to allow the engine to check for deferred

activities. Setting this parameter to FALSE restricts the engine to handlingonly activities that have timed out.

process_timeout: Set this parameter to TRUE to allow the engine to check fortimed out activities. Setting the value to FALSE restricts the engine tohandling only deferred activities.

Page 254: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 20

Deferred Processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Deferred ProcessingDeferred Processing

• Set the Workflow Engine threshold cost to controlwhich activities get deferred.

• The default threshold cost of the Workflow Engineis set to 50.

• The Workflow Engine threshold is an externalizedconstant.

• Add this command to a PL/SQL stored procedureor execute this command in SQL*PLUS to changethe threshold: WF_ENGINE.THRESHOLD := n;

• Set the Workflow Engine threshold cost to controlwhich activities get deferred.

• The default threshold cost of the Workflow Engineis set to 50.

• The Workflow Engine threshold is an externalizedconstant.

• Add this command to a PL/SQL stored procedureor execute this command in SQL*PLUS to changethe threshold: WF_ENGINE.THRESHOLD := n;

Note: A function activity is deferred to a background engine forprocessing if its cost exceeds the threshold cost of the Workflow Engine.

Page 255: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 21

Timed Out Notification Activities

Copyright Oracle Corporation, 2000. All rights reserved.®

Timed Out Notification ActivitiesTimed Out Notification Activities

• Workflow Engine calls on the Notification Systemto deliver the notification and marks the activity asNOTIFIED.

• The background Engine configured for timed outactivities checks for Notified activities anddetermines whether the Notified activities havetimeout values that have been exceeded.

• If the timeout value is exceeded, the BackgroundEngine marks the activity as timed out and callsthe Workflow Engine to follow the <Timeout>transition.

• Timeouts may be set to an item attribute or to arelative time in days/hours/minutes

• Workflow Engine calls on the Notification Systemto deliver the notification and marks the activity asNOTIFIED.

• The background Engine configured for timed outactivities checks for Notified activities anddetermines whether the Notified activities havetimeout values that have been exceeded.

• If the timeout value is exceeded, the BackgroundEngine marks the activity as timed out and callsthe Workflow Engine to follow the <Timeout>transition.

• Timeouts may be set to an item attribute or to arelative time in days/hours/minutes

Dynamic TimeoutsYou can fix the due date of an activity at design time or specify it whenyou initiate an instance of the process.If using Item Attribute to set the timeout value then the item attribute mustbe set to type number or type date. If number type, the value entered is inthe unit of minutes. If date type, the value entered is a date in format DD-MON-RR HH24:MI:SS.Subprocess TimeoutsYou can also set a timeout for a subprocess.

Note:If a timed out activity does not have a <Timeout> transition modeled, theWorkflow Engine will try to find an error process to execute.The Timeout property has been moved to the Node tab of the Propertiesfor Oracle Workflow 2.5.

Page 256: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Overview of the Workflow EngineChapter 10 - Page 22

Error Processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Error ProcessingError Processing

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

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

Note: Workflow Engine attempts to locate an error process to run bystarting with the activity which caused the error, and then checking eachparent process activity until an associated error process is located.

Page 257: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 1

Completing WorkflowNotification ActivitiesChapter 11

Page 258: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 2

Completing Workflow Notification Activities

Copyright Oracle Corporation, 2000. All rights reserved.®

Completing Workflow NotificationActivities

Completing Workflow NotificationActivities

Page 259: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

After this lesson, you should be able to:• Respond to notifications from the Notification Web

page• Respond to notifications using email• Access the Oracle Workflow home page• Define notification routing rules

After this lesson, you should be able to:• Respond to notifications from the Notification Web

page• Respond to notifications using email• Access the Oracle Workflow home page• Define notification routing rules

Page 260: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 4

Oracle Workflow Home Page

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow Home PageOracle Workflow Home Page

Oracle Workflow Web-Based FeaturesUse the Oracle Workflow home page to link to all of Oracle Workflow’sWeb-based features.

The URL is <webagent>/wfa_html.home.The home page displays your current Worklist of notifications.Choose the Worklist link to display your list of notifications in thefull browser window. The Worklist allows you to view thecontents of a notification in the Notification Detail Web page.Choose the Find Notifications link to search for a particular set ofnotifications.

Page 261: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 5

Find Notifications Web Page

Copyright Oracle Corporation, 2000. All rights reserved.®

Find Notifications Web PageFind Notifications Web Page

Finding NotificationsEnter criteria to search for a specific set of notifications.Users who have workflow administrator privileges can search fornotifications that belong to any other user/role by specifying aninternal role name in the User ID field.Users who do not have workflow administrator privileges can onlysearch for their own notifications.Choose Find to display matching notifications in the NotificationsWeb page.

Page 262: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 6

Notifications Worklist

Copyright Oracle Corporation, 2000. All rights reserved.®

Notifications WorklistNotifications Worklist

Viewing Notifications from a Web PageAccess the Notifications Worklist using one of the followingmethods:

From the Oracle Workflow home page, whose URL is<webagent>/ wfa_html.home choose the Worklist or FindNotifications linksUsing the URL <webagent>/wfa_html.worklistFrom the Oracle Self-Service Web Applications home page

Present a summary of notifications:Notifications Worklist either displays the notifications thatmatch your search criteria if you navigated from the FindNotifications page, or lists all your open notifications if younavigated directly to this page.Sort the summary by priority, type, subject, sent date, duedate, or status.

Choose a notification from the list to display the details of thenotification on another page.You can respond to or reassign a notification. Once you respond toor reassign a notification, it no longer appears in your Worklist onreturn to the Worklist page. If a notification does not require aresponse, choose Close to remove it from your Worklist.

Page 263: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 7

Use the Select checkbox to simultaneously close multiplenotifications that don’t require a response or use the Selectcheckbox to collectively reassign a group of notifications.

Page 264: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 8

Notification Details

Copyright Oracle Corporation, 2000. All rights reserved.®

Notification DetailsNotification Details

Page 265: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 9

Reassigning Notifications

Copyright Oracle Corporation, 2000. All rights reserved.®

User List-of-values

Delegate orTransfer

reassign options

Reassigning NotificationsReassigning Notifications

Multiple Reassign ModesUse the following options to reassign notifications:

Delegate: Grant permission to someone else to act on a notificationon your behalf while you remain as the owner and performer of theactivity. This performs the same as the former Reassign command.Transfer: Transfer responsibility to act on a notification tosomeone else and transfer the ownership and performance of theactivity to them.

The following Oracle Workflow areas use these notification reassign values:The Monitor Diagram web pageThe Notifications web page

If you view your notifications in e-mail, you can use only the Forward functionwhich performs similar to the Delegate option.The delegate function is WF_NOTIFICATION.Forward and the transferfunction is WF_NOTIFICATION.Transfer.You can associate a post-notification function with a notification activity. TheWorkflow Engine executes the post-notification function in response to an updateof the notification's state after the notification is delivered.When you specify a post-notification function, the Workflow engine first sets thecontext information to be used with the function using the following two globalengine variables:

Page 266: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 10

WF_ENGINE.context_nid=notification_NIDWF_ENGINE.context_text=new recipient role, if the post-notification function gets called in FORWARD or TRANSFERmode. This variable is the new role to which the notification getsforwarded/transferred.

Note:WF_ENGINE.context_text=responder, if the post-notification function gets calledin RESPOND mode. The value of responder varies depending on the notificationinterface the recipient uses to respond. If the recipient responds using theNotification web page, responder is set to the role name of the responder. If therecipient responds using E-mail, responder is set to ‘email:responder emailaddress’.You may reference these global engine variables in your PL/SQL function.

Page 267: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 11

Launching Oracle Application Forms

Copyright Oracle Corporation, 2000. All rights reserved.®

Launching Oracle Application FormsLaunching Oracle Application Forms

Click on form icon to launch Oracle Applications form

Page 268: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 12

E-Mail Notification

Copyright Oracle Corporation, 2000. All rights reserved.®

E-Mail NotificationE-Mail Notification

<Place screenshot here><Place screenshot here><Place screenshot here>

Automaticgeneration

ofresponsetemplate

Viewing E-Mail NotificationsYou can receive e-mail notifications if your notification preferenceis set to “Plan text mail”, “HTML mail”, or “Plain text mail withattachments” in the User Preferences web page and your workflowadministrator sets up the Notification Mailer to run.E-Mail notification contains all the details of the notification,including instructions on how to respond to the notification.

Include the original note with your response to ensure thatthe notification identification and notification access key iswithin your reply.Plain text Template Response: use the template ofresponse prompts provided in the notification and enteryour response values between the double quotes followingeach prompt.Plain text Direct Response: the first lines of your reply areinterpreted as your notification response, where each linerepresents a separate response value listed in the sameorder as its corresponding response prompt. If a responsevalue requires more than one line, enclose the entireresponse value in double quotes. If a response promptprovides a default value, then a matching blank line for aresponse accepts the default value.

Page 269: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 13

Response values are interpreted literally, where upper casevalues are distinct from lower case values.

Turn off automatic e-mail signatures when replying tonotifications.

If your mail applications support HTML attachments youmay respond to a notification using the attached HTMLNotification page.

Page 270: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 14

E-Mail Notification (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

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

Automaticgeneration

ofresponsetemplate

Page 271: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 15

E-Mail Summary of Notifications

Copyright Oracle Corporation, 2000. All rights reserved.®

E-Mail Summary of NotificationsE-Mail Summary of Notifications

<Place screenshot here><Place screenshot here><Place screenshot here>

Viewing a Summary of Notifications Using E-MailDelivers a single e-mail summarizing your current list of opennotifications.You can receive an e-mail summary of notifications if yournotification preference is set to “Plain text summary mail” in theUser Preferences web page and your workflow administrator setsup the Notification Mailer to run.To respond to individual notifications listed in the summary, youmust use the Notification Details Web page.How often you receive e-mail summaries depends on howfrequently the Notification Mailer that handles e-mail summaries isset to run.

Page 272: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 16

Automatic Notification Processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Automatic Notification ProcessingAutomatic Notification Processing

You can automatically forward or respond toincoming notifications during a planned absence.You can define automatic notification processingrules using a set of Web pages.• A rule applies to a message or messages

belonging to a specific role.• A rule can result in one of three actions:

– Reassign the notification to another role– Respond to or close the notification– Deliver to the original recipient with no further

action

You can automatically forward or respond toincoming notifications during a planned absence.You can define automatic notification processingrules using a set of Web pages.• A rule applies to a message or messages

belonging to a specific role.• A rule can result in one of three actions:

– Reassign the notification to another role– Respond to or close the notification– Deliver to the original recipient with no further

action

Automatic Notification Processing RulesOracle Workflow checks each notification against the list of theintended role of automatic processing rules for the best matchaccording to the following order of criteria:

ROLE = <role> and:1. ITEM_TYPE = <type> and MESSAGE_NAME = <name>2. ITEM_TYPE = <type> and MESSAGE_NAME is null3. ITEM_TYPE is null and MESSAGE_NAME is null

If a rule reassigns a notification, Oracle Workflow again performsrule matching against the list of rules of the new recipient role.

A count of the number of times a notification getsforwarded helps detect perpetual forwarding cycles.If a notification is automatically forwarded more than tentimes, Oracle Workflow assumes a forwarding cycle hasoccurred and ceases all further automatic forwarding andmarks the notification as being in error.

Page 273: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 17

Listing Notification Processing Rules

Copyright Oracle Corporation, 2000. All rights reserved.®

Listing Notification Processing RulesListing Notification Processing Rules

Defining Automatic Notification Processing Rules1. Use one of the following URLs to find the automatic notificationprocessing rules for a role.

<webagent>/wf_route.findEnter User ID.Choose Find to display the list of rules.

<webagent>/wf_route.list<webagent>/wfa_html.home

Choose Notification Rules link.Enter User ID.Choose Find to display the list of rules.

2. The Notification Rules page displays the existing rules for the role. Thefollowing information is listed for each rule:

Item TypeNotification name or <ALL>, for all notifications of that item typeAction that the rule takesActive status

3. Click on the link in the “Result of Applying Rule” column to edit a rule.4. Choose X in the Delete Rule column to delete a rule.5. Choose Create Rule to define a new rule.

Page 274: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 18

Creating a New Notification Processing Rule

Copyright Oracle Corporation, 2000. All rights reserved.®

Creating a New Notification ProcessingRule

Creating a New Notification ProcessingRule

Defining the Criteria for an Automatic Notification Processing Rule1. Specify the item type you want the rule to apply to, then choose Next.

Rules apply to notification messages, and all messages are associatedwith a specific item type.

Choose <ALL> if you want the rule to apply to all item types.2. Specify the name of the notification message you wish to apply the rule to,then choose Next.

The message is shown by subject name.Specify <ALL> if you want the rule to apply to all messages.

Page 275: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 19

Creating a New Notification Processing Rule(continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Creating a New Notification ProcessingRule (continued)

Creating a New Notification ProcessingRule (continued)

Defining an Automatic Notification Processing Rule1. Specify the period that you want the rule to be active by entering a startand end date and time.

Use the default date format of your database.Use the time format HH24:MI:SS.Blank Start Date means the rule is effective immediately.Blank End Date means the rule is effective indefinitely.

Note: As you can define multiple rules for the same notifications, make sureyour rules for the same notifications do not overlap in their effective dates.2. Use the “Comments to include in notification” field to specify text thatyou want to append to the notification in the Prior comments when the rule isapplied.3. Check the appropriate radio button to assign an action for the rule.

Reassign to: Forward the notification to the role specified. Must alsoselect either to ‘Delegate Authority for Responding toNotifications’ or to ‘Transfer Ownership of Notifications’.

Respond: Respond to the message from the set of specified responsevalues.

Page 276: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Completing Workflow Notification ActivitiesChapter 11 - Page 20

Deliver Notifications to me, regardless of any general rules: Leave thenotification in your inbox and do nothing. Use this action to excludea subset of notifications from a more encompassing rule.

4. Click OK to save the rule.

Page 277: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 1

Monitoring WorkflowProcessesChapter 12

Page 278: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 2

Monitoring Workflow Processes

Copyright Oracle Corporation, 2000. All rights reserved.®

Monitoring Workflow ProcessesMonitoring Workflow Processes

Page 279: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

After this lesson, you should be able to:• Check the progress of a workflow using the Java-

based Workflow Monitor

After this lesson, you should be able to:• Check the progress of a workflow using the Java-

based Workflow Monitor

Page 280: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 4

Workflow Monitor

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow MonitorWorkflow Monitor

Workflow Monitor FeaturesThe Workflow Monitor is a Java-based tool that lets you view andadminister the progress of a workflow process instance. The workflowmonitor features include:

A point-and-click interface.A display for detailed status information for individual activities aswell as for the whole process.An ability to run in USER mode or ADMIN mode, which providesadditional details and functionality pertinent only to a workflowadministrator.

User Interface ComponentsUser Interface components include:

Process titleProcess diagram windowDetail tab windowAdministration buttons

Page 281: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 5

Process Title

Copyright Oracle Corporation, 2000. All rights reserved.®

Process TitleProcess Title

Process Title FeaturesThe process title displays the process name, followed by the item type anduser key (or item key) that uniquely identifies the process instance. If youdrill down to a subprocess in the process diagram window, the processtitle shows the name of the subprocess.

Page 282: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 6

Process Diagram Window

Copyright Oracle Corporation, 2000. All rights reserved.®

Process Diagram WindowProcess Diagram Window

Process Diagram Window FeaturesThe process diagram window is a noneditable window that displays theprocess diagram you created in Oracle Workflow Builder. It providesvisual cues about the status of the process and its activities.

An activity can be highlighted with a colored box to indicate adistinctive state:

Red: Activity is in an error state.Green: Activity is active or in progress.Yellow: Activity is suspended.

A transition arrow can have a thick green line to indicate that it hasbeen traversed, or it can have a thin black line to indicate that ithasn’t been traversed.Click on an activity to display information about it in the detail tabwindow.Click on any empty space in the diagram to clear a selected activityand display information about the process as a whole in the detailtab window.Double-click on a subprocess activity to drill down and display thediagram of the subprocess and its information in the detail tabwindow. Or select the subprocess activity, then choose Zoom In.

Page 283: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 7

Detail Tab Window

Copyright Oracle Corporation, 2000. All rights reserved.®

Detail Tab WindowDetail Tab Window

Detail Tab Window FeaturesThe detail tab window displays detailed information about the selectedactivity or process. Additional information may appear in these tabs if youare accessing the Workflow Monitor in ADMIN mode. Select from thefollowing tabs:

Definition: Displays the properties of the activity or process.Usage: Displays the properties for the activity as a node in theprocess.Status: Displays status and result information about the activity.Also shows error information if the activity status is ERROR.Notification: Displays notification details for the selectednotification activity.Item: Displays item type and item type attribute information.

Page 284: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 8

Administration Buttons

Copyright Oracle Corporation, 2000. All rights reserved.®

Administration ButtonsAdministration Buttons

Features of the Administration ButtonsThe administration buttons appear only when you run the WorkflowMonitor in ADMIN mode. The buttons and their behavior are as follows:

Abort Process: Calls WF_ENGINE.AbortProcess to abort theselected process and cancel any outstanding notifications. Promptsfor a result to assign to the aborted process.Suspend Process: Calls WF_ENGINE.SuspendProcess to suspendthe selected process.Resume Process: Calls WF_ENGINE.ResumeProcess to resumethe selected suspended process to normal execution status.Reassign: Calls WF_ENGINE.AssignActivity to reassign theselected notification activity to a different performer. Prompts for arole name.Expedite: Calls WF_ENGINE.HandleError to alter the state of anerrored activity, or to undo the selected activity and all otheractivities following it to rollback part of the process. Prompts youto select one of two values:

Skip, to skip the activity and assign it a specified result.Retry, to reexecute the activity.

Attribute: Lets you change the value of an item attribute.

Page 285: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 9

Application-Controlled Access to the Workflow Monitor

Copyright Oracle Corporation, 2000. All rights reserved.®

Application-Controlled Access to theWorkflow Monitor

Application-Controlled Access to theWorkflow Monitor

• Calling application may launch a Web browser andpass a Workflow Monitor URL.

• From a form in Oracle Applications, useFND_UTILITIES.OPEN_URL( ) to launch abrowser and pass a Workflow Monitor URL.

• Monitor a Specific Item Type and Key through:– Process Diagram URL– Notifications List URL– Activities List URL

• Calling application may launch a Web browser andpass a Workflow Monitor URL.

• From a form in Oracle Applications, useFND_UTILITIES.OPEN_URL( ) to launch abrowser and pass a Workflow Monitor URL.

• Monitor a Specific Item Type and Key through:– Process Diagram URL– Notifications List URL– Activities List URL

Web BrowserThe Workflow Monitor requires a Web browser that supports Java 1.1.4and AWT.

Page 286: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 10

Application-Controlled Access to the Workflow Monitor(Continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Application-Controlled Access to theWorkflow Monitor (Continued)

Application-Controlled Access to theWorkflow Monitor (Continued)

• Call functions to generate Monitor URL strings for:– Process Diagram

WF_MONITOR.GetDiagramURL( )– Notifications List

WF_MONITOR.GetEnvelopeURL( )– Activities List

WF_MONITOR.GetAdvancedEnvelopeURL( )• Calling application must supply the Web agent

string, item type, and item key and specify whetherto run the monitor in ADMIN or USER mode.

• Call functions to generate Monitor URL strings for:– Process Diagram

WF_MONITOR.GetDiagramURL( )– Notifications List

WF_MONITOR.GetEnvelopeURL( )– Activities List

WF_MONITOR.GetAdvancedEnvelopeURL( )• Calling application must supply the Web agent

string, item type, and item key and specify whetherto run the monitor in ADMIN or USER mode.

Workflow Web Agent StringUse function wf_core.Translate(‘WF_WEB_AGENT’) to retrieve the<webagent> string used in creating the Find Processes and Monitor URLs.

Workflow Monitor URLsThe Workflow Monitor Process Diagram URL looks something like:<webagent>wf_monitor.html?x_item_type=<item_type>&x_item_key=<item_key>&x_admin_mode=<YES_or_NO>&x_access_key=<access_key>The Notifications List and Activities List will look similar.

User AuthenticationThe Monitor functions for direct access to the Process Diagram,Notifications List, and Activities List all return a hidden password in theURL string that provides the user access to the pages in either ADMIN orUSER mode.

Page 287: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 11

Direct Access to the Workflow Monitor

Copyright Oracle Corporation, 2000. All rights reserved.®

Direct Access to the Workflow MonitorDirect Access to the Workflow Monitor

• If yes, then you can search for and monitor anyworkflow process instance in ADMIN mode.

• If no, then you can only search for and monitorprocesses in ADMIN mode that you own.

• If yes, then you can search for and monitor anyworkflow process instance in ADMIN mode.

• If no, then you can only search for and monitorprocesses in ADMIN mode that you own.

Find Processes Web page is a secured Web page that Find Processes Web page is a secured Web page that requires user authentication.requires user authentication.

Do you have Workflow Administrator privileges?Do you have Workflow Administrator privileges?

Find Processes Web PageUse a Web browser that supports Java 1.1.4 and AWT.

Connect to the following URL:<webagent>/wf_monitor.find_instance

Or, connect to the Oracle Workflow home page and select the FindProcesses link:

<webagent>/wfa_html.home

Workflow Administrator PrivilegesUsers have workflow administrator privileges if they belong to the OracleWorkflow administration role, which is defined in the directory serviceand the wfcfg.msg file.

Page 288: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 12

Find Processes Web Page

Copyright Oracle Corporation, 2000. All rights reserved.®

Find Processes Web PageFind Processes Web Page

Find Processes Web PageThe Find Process Web page lets you specify search criteria tolocate workflow process instances by:

Process StatusItem TypeItem KeyUser KeyProcess NameProcess Owner (if you have Workflow Administratorprivileges, otherwise you can only search for processinstances that you own.)

You can also locate workflow process instances with activitiesthat:

Have any status, are suspended, or in error.Are waiting for a response from a specified role.Have no progress in a specified number of days.

Choose Find to locate the process instances that meet yourspecified criteria

Page 289: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 13

Reviewing the Process List

Copyright Oracle Corporation, 2000. All rights reserved.®

Reviewing the Process ListReviewing the Process List

Reviewing the Process ListThe Process List provides a summary of all process instances thatmatch your Find Processes search criteria.Process instances are listed in ascending order first by item type,then item key.The process List summarizes the status of each process instance.Choose a Process Name link to display the list of notificationactivities that have been initiated for that process instance.

Page 290: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 14

Reviewing the Notifications List

Copyright Oracle Corporation, 2000. All rights reserved.®

Reviewing the Notifications ListReviewing the Notifications List

Notifications ListDisplays all the current notifications that have been sent thatrequire a Result response.Summarizes what each notification activity is, who it is assignedto, when it was sent, whether it has been completed, how manydays have passed before completion and what the result is.

Note: If the process instance is in an error state and the cause of the errorwas from a notification, you can click on the link in the Result column, ifany, to display the cause of the error.

Choose a user link in the Who column to send an email to the userthat a notification has been assigned to.Choose a notification activity link in the Activity column if youwant to view the full definition of a notification activity.If a notification is still open and requires a response, an icon willappear after the notification activity name. You can click on thisicon and you will go to the Notification Details page where youcan respond to the notification if you are logged in as thenotification recipient, or if you are logged in with administratorprivileges.Choose Advanced Options to go to the Activities List Web pagewhere you can specify advanced criteria to search and displayspecific activities of interest for the process.

Page 291: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 15

Choose View Diagram to display the selected process instance inthe Workflow Monitor for a graphical representation of the processstatus. When connected to the current session with WorkflowAdministrator privileges, the Monitor displays the process inADMIN mode, otherwise it is displayed in USER mode.

Page 292: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 16

Filtering Activities in the Activities List

Copyright Oracle Corporation, 2000. All rights reserved.®

Filtering Activities in the Activities ListFiltering Activities in the Activities List

Activities ListThe Activities List lets you use different criteria to filter forspecific activities of interest in the current process instance.Activity Status Options:

Active (includes Notified, Deferred, and Waiting states)CompleteErrorSuspended

Activity Types:Response NotificationsFYI NotificationsFunctionsStandard Workflow Items

Choose Filter Activities to display the activities that match yourcriteria.

Page 293: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 17

Filtering Activities in the Activities List (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Filtering Activities in the Activities List(continued)

Filtering Activities in the Activities List(continued)

Activities List (continued)You can sort the Activities List based on any column by clickingon the column heading:

An asterisk (*) to the left of the sort column title indicatesan ascending sort order.An asterisk (*) to the right of the sort column title indicatesa descending sort order.

Choose a user link in the Who column to send an e-mail to the userto whom a notification has been assigned.Choose an activity link in the Activity column if you want to viewthe full definition of an activity.If a notification activity is still open and requires a response, anicon will appear after the notification activity name. You can clickon this icon and you will go to the Notification Details page whereyou can respond to the notification if you are logged in as thenotification recipient or if you are logged in with administratorprivileges.Choose View Diagram to display the selected process instance inthe Workflow Monitor for a graphical representation of the processstatus. When connected to the current session with WorkflowAdministrator privileges, the Monitor displays the process inADMIN mode, otherwise it is displayed in USER mode.

Page 294: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 18

Child/Parent Instances

Copyright Oracle Corporation, 2000. All rights reserved.®

Child/Parent InstancesChild/Parent Instances

Link to Parent/Child InstancesIf the selected process is a member of a parent/child process, aparent/child hierarchy list appears on the left-hand side. The hierarchy listshows links to corresponding parent and child instances of the currentprocess. The links invoke the Notifications List on the selected parent orchild instance.

Page 295: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 19

Practice Les 12-1 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Practice Les 12-1 OverviewPractice Les 12-1 Overview

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

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

Page 296: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 20

Practice Les 12-1 Overview Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

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

Using the Vacation Proposal process created inpractice Les 9-1:

• Initiate a work item• Monitor the status of your work item using the

Monitor Activities List and Diagram• Timeout the Vacation Proposal notification• Exercise the Schedule Update function activity

logic• Exercise Vacation Proposal post-notification

function logic, if implemented• Debug any PL/SQL errors encountered

Using the Vacation Proposal process created inpractice Les 9-1:

• Initiate a work item• Monitor the status of your work item using the

Monitor Activities List and Diagram• Timeout the Vacation Proposal notification• Exercise the Schedule Update function activity

logic• Exercise Vacation Proposal post-notification

function logic, if implemented• Debug any PL/SQL errors encountered

Page 297: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 21

Guided Practice Les 12-1 Initiating a Work Item

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 12-1Initiating a Work Item

Guided Practice Les 12-1Initiating a Work Item

1. Connect to the Oracle Workflow home page. Logon as any user with “Administrator” privileges.a. Select the Launch Processes linkb. Select your Item Type link from the listc. On the Initiate Workflow page enter:

– an item key and user key to uniquelyidentify your work item

– a requestor and approver using the role list-of-values

– a from and to date (DD-MON-RR)d. Click on OK

1. Connect to the Oracle Workflow home page. Logon as any user with “Administrator” privileges.a. Select the Launch Processes linkb. Select your Item Type link from the listc. On the Initiate Workflow page enter:

– an item key and user key to uniquelyidentify your work item

– a requestor and approver using the role list-of-values

– a from and to date (DD-MON-RR)d. Click on OK

Note:If the Launch Processes menu option does not appear, you are not logged in as auser with administrator privileges. Close the browser and log in again as adifferent user.

Page 298: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 22

Guided Practice Les 12-1: Monitoring the Results

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 12-1:Monitoring the Results

Guided Practice Les 12-1:Monitoring the Results

2. Display the Activities List and Diagram for yourwork item. Evaluate the current status of yourwork item. If an error occurred in your process,use the Result Exception link in the Activities Listto determine the cause.

2. Display the Activities List and Diagram for yourwork item. Evaluate the current status of yourwork item. If an error occurred in your process,use the Result Exception link in the Activities Listto determine the cause.

Note:After starting a process from the Initiate Workflow web page, control is passed tothe Monitor Activities List web page.

Page 299: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 23

Guided Practice Les 12-1 Timing out Vacation Proposalnotification

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 12-1Timing out Vacation Proposal notification

Guided Practice Les 12-1Timing out Vacation Proposal notification

3. To take the <Timeout> transition implemented inpractice Les 9-1:a. Wait until the Vacation Proposal due date has

expiredb. Run the Background Engine from SQL*PLUS

3. To take the <Timeout> transition implemented inpractice Les 9-1:a. Wait until the Vacation Proposal due date has

expiredb. Run the Background Engine from SQL*PLUS

EXEC wf_engine.background(‘<itemtype>‘);EXEC wf_engine.background(‘<itemtype>‘);

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

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

Note:The notification due date (including hours, minutes, seconds) is found on theNotification Details web page in the notification header region.From the Activities List, you can open the Notification Details for your VacationProposal notification by selecting the response notification icon next to theVacation Proposal notification activity link.

Page 300: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 24

Guided Practice Les 12-1 Testing Schedule VacationFunction

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 12-1Testing Schedule Vacation Function

Guided Practice Les 12-1Testing Schedule Vacation Function

4. To test your RUN mode Schedule Vacation logic:a. Accept the Vacation Proposalb. Display the Activities List and Diagram for

your work item. Evaluate the current status ofyour work item. If an error occurred in yourSchedule Vacation function, use the ResultException link in the Activities List todetermine the cause.

c. Query and verify the contents of your VacationSchedule table:

4. To test your RUN mode Schedule Vacation logic:a. Accept the Vacation Proposalb. Display the Activities List and Diagram for

your work item. Evaluate the current status ofyour work item. If an error occurred in yourSchedule Vacation function, use the ResultException link in the Activities List todetermine the cause.

c. Query and verify the contents of your VacationSchedule table:Select * from

WFVACXX_Vacation_Schedule;

Select * from

WFVACXX_Vacation_Schedule;

Note:Your Vacation Schedule table and WFVACXX package must be successfullyloaded into the workflow account of your test database.

Page 301: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 25

Guided Practice Les 12-1 Testing Schedule VacationFunction Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 12-1Testing Schedule Vacation Function

Continued

Guided Practice Les 12-1Testing Schedule Vacation Function

Continued5. To test your CANCEL mode Schedule Vacation

logic:a. Display your completed work item in the

Monitor Diagram. “Rewind” your work item tothe Start node using the Diagram Expeditefeature.– select the Start node and click on the

Expedite button– select Retry and click on the OK button

b. Query and verify the contents of your VacationSchedule table. The Schedule Vacationfunction should have removed the appropriatevacation schedule row.

5. To test your CANCEL mode Schedule Vacationlogic:a. Display your completed work item in the

Monitor Diagram. “Rewind” your work item tothe Start node using the Diagram Expeditefeature.– select the Start node and click on the

Expedite button– select Retry and click on the OK button

b. Query and verify the contents of your VacationSchedule table. The Schedule Vacationfunction should have removed the appropriatevacation schedule row.

Page 302: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 26

Guided Practice Les 12-1 Testing Post-NotificationFunction

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 12-1Testing Post-Notification Function

Guided Practice Les 12-1Testing Post-Notification Function

6. To exercise your post-notification function logic:a. Reassign the Vacation Proposal to a new role

– Transfer should raise an exception– Delegate should be successful

b. Reject the Vacation Proposal without enteringalternate vacation dates– any missing dates on reject should raise an

exceptionc. Reject the Vacation Proposal with an alternate

from date prior to the alternate to date– invalid date ranges should raise an

exception

6. To exercise your post-notification function logic:a. Reassign the Vacation Proposal to a new role

– Transfer should raise an exception– Delegate should be successful

b. Reject the Vacation Proposal without enteringalternate vacation dates– any missing dates on reject should raise an

exceptionc. Reject the Vacation Proposal with an alternate

from date prior to the alternate to date– invalid date ranges should raise an

exception

Page 303: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 27

Guided Practice Les 12-1 Testing Post-NotificationFunction Continued

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 12-1Testing Post-Notification Function

Continued

Guided Practice Les 12-1Testing Post-Notification Function

Continuedd. Reject the Vacation Proposal, including valid

alternate dates and comment– response should be successful

e. Accept the Vacation Proposal– response should be successful

d. Reject the Vacation Proposal, including validalternate dates and comment– response should be successful

e. Accept the Vacation Proposal– response should be successful

Page 304: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Monitoring Workflow ProcessesChapter 12 - Page 28

Les 12-1 Summary

Copyright Oracle Corporation, 2000. All rights reserved.®

Les 12-1 SummaryLes 12-1 Summary

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

response logic

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

response logic

Page 305: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 1

PL/SQL DocumentsChapter 13

Page 306: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 2

PL/SQL Documents

Copyright Oracle Corporation, 2000. All rights reserved.®

PL/SQL DocumentsPL/SQL Documents

Page 307: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

After this lesson, you should be able to:• Integrate PL/SQL documents into a Workflow

process• Define a procedure to generate a PL/SQL

document• Attach PL/SQL documents

After this lesson, you should be able to:• Integrate PL/SQL documents into a Workflow

process• Define a procedure to generate a PL/SQL

document• Attach PL/SQL documents

Page 308: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 4

Integrating PL/SQL Documents in Workflow Processes

Copyright Oracle Corporation, 2000. All rights reserved.®

Integrating PL/SQL Documents inWorkflow Processes

Integrating PL/SQL Documents inWorkflow Processes

• Use a PL/SQL document when the format orcontent of the document may vary.

• You integrate a PL/SQL document into a workflowprocess by defining an attribute of type documentfor an item type or message.

• The document-type attribute value tells OracleWorkflow how to construct the dynamic call to aPL/SQL procedure which generates the document.

• You embed a PL/SQL document-type messageattribute in a message body to display thedocument in a notification.

• Use a PL/SQL document when the format orcontent of the document may vary.

• You integrate a PL/SQL document into a workflowprocess by defining an attribute of type documentfor an item type or message.

• The document-type attribute value tells OracleWorkflow how to construct the dynamic call to aPL/SQL procedure which generates the document.

• You embed a PL/SQL document-type messageattribute in a message body to display thedocument in a notification.

Setting the Document Attribute Value• A PL/SQL document-type attribute should take a value of the form:PLSQL:<procedure>/<document_identifier>• <procedure> should be replaced with the PL/SQL package and procedure namein the form package.procedure.• <document_identifier> should be replaced with the PL/SQL argument string thatyou want to pass directly to the procedure. The argument string should identifythe document e.g. plsql:po_wf.show_req/2034.• If you wish to generate the PL/SQL argument string dynamically , create anotheritem attribute and specify ‘&item_attribute’ in place of the PL/SQL argumentstring. Before any activity that references this other item attribute gets executed,call the WF_ENGINE.SetItemAttribute API to dynamically set the Pl/SQLargument string value e.g. plsql:po_wf.show_req/&POREQ_NUMBER.

Page 309: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 5

Defining Procedures to Generate a PL/SQL Document

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining Procedures to Generate aPL/SQL Document

Defining Procedures to Generate aPL/SQL Document

procedure <procedure name>

(document_id in varchar2,

display_type in varchar2,

document in out varchar2,

document_type in out varchar2)

procedure <procedure name>

(document_id in varchar2,

display_type in varchar2,

document in out varchar2,

document_type in out varchar2)

Standard API for a ‘PL/SQL’ DocumentThe procedure for generating a “PL/SQL” document must follow a standard APIformat. The aspects of the procedure are as follows:

document_id: A string that uniquely identifies a document. Equivalent to thedocument identifier string you specify in the document-type attribute value(PLSQL:<procedure>/<document_identifier>).display_type: Represents how the document is displayed in the notification (alsoreferred to as the “content type” or “requested type”):

text/plain: Document is embedded inside plain text representation ofnotification as viewed from an e-mail message. Entire mail message mustbe less than or equal to 32K.

text/html: Document is embedded inside HTML representation of notificationas viewed from the Notification Web page or the HTML attachment to ane-mail message. Entire HTML representation of document must be lessthan or equal to 32K and should not include top level HTML tags like<HTML> or <BODY> as the HTML page that the document is beinginserted into already contains these tags. If the tags are included, OracleWorkflow removes them for you when the document attribute isreferenced in a message body. The procedure can alternatively generate aplain text document as the notification system can automatically surroundplain text with the appropriate HTML tags to preserve formatting.

Page 310: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 6

‘ ‘: The document is presented as a separate attachment to the notification.Any content type may be returned.

Page 311: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 7

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

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining Procedures to Generate aPL/SQL Document (continued)

Defining Procedures to Generate aPL/SQL Document (continued)

procedure <procedure name>

(document_id in varchar2,

display_type in varchar2,

document in out varchar2,

document_type in out varchar2)

procedure <procedure name>

(document_id in varchar2,

display_type in varchar2,

document in out varchar2,

document_type in out varchar2)

Standard API for a ‘PL/SQL’ Document (continued)document: Outbound text buffer where up to 32K of document text is returned.document_type: Outbound text buffer where the document content type isreturned. Also referred to as the returned type. If no type is supplied, then“text/plain” is assumed.

Page 312: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 8

PL/SQL Document Attachments

Copyright Oracle Corporation, 2000. All rights reserved.®

PL/SQL Document AttachmentsPL/SQL Document Attachments

Attach Document Content to

Notification Message

Attach PL/SQL DocumentWhen defining a message attribute in the Oracle Workflow Builder, if yourmessage attribute is a Send attribute and is of type Document, you can checkAttach Content to attach the content of the attribute to the notification message.When you view your notification from the Notification Details web page, you seea document icon following the notification message body that displays thecontents of the attached message attribute when you click on it. If you view yournotification from E-mail, the presentation of the attachment will vary dependingon what your E-mail notification preference setting is.

Note: You can attach, as well as embed (by token substitution) PL/SQLDocument attributes in the notification message and are not limited to one or theother.

Page 313: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 9

Practice Les 13-1 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Practice Les 13-1 OverviewPractice Les 13-1 Overview

This practice covers the following topics:• Creating a PL/SQL Document procedure

– for the vacation proposal requestor,report the scheduled vacation as stored inyour WFVACXX_Vacation_Schedule table

• Using a PL/SQL Document attribute in a message– create an attribute, message, and notification

to send the scheduled vacation report to therequestor when the vacation proposal isapproved

• Setting the value of a PL/SQL Document attribute• Testing a PL/SQL Document

This practice covers the following topics:• Creating a PL/SQL Document procedure

– for the vacation proposal requestor,report the scheduled vacation as stored inyour WFVACXX_Vacation_Schedule table

• Using a PL/SQL Document attribute in a message– create an attribute, message, and notification

to send the scheduled vacation report to therequestor when the vacation proposal isapproved

• Setting the value of a PL/SQL Document attribute• Testing a PL/SQL Document

Page 314: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 10

Guided Practice Les 13-1 Creating a PL/SQLDocument Procedure

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

1. Use the standard PL/SQL Document API format foryour PL/SQL specification and body.

1. Use the standard PL/SQL Document API format foryour PL/SQL specification and body.

procedure <procedure name>

(document_id in varchar2,

display_type in varchar2,

document in out varchar2,

document_type in out varchar2)

procedure <procedure name>

(document_id in varchar2,

display_type in varchar2,

document in out varchar2,

document_type in out varchar2)

a. Add to your package “WFVACXX” created inpractice Les 8-1.

b. Give your procedure a descriptive name, suchas “VACATION_SCHEDULED”.

a. Add to your package “WFVACXX” created inpractice Les 8-1.

b. Give your procedure a descriptive name, suchas “VACATION_SCHEDULED”.

Page 315: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 11

Guided Practice Les 13-1 Creating a PL/SQLDocument Procedure

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

c. Code requestor username as the value of thedocument_id to create a document displayingthe vacation scheduled for the currentrequestor.

d. Create a cursor to select all vacation schedulerows for the requestor.

c. Code requestor username as the value of thedocument_id to create a document displayingthe vacation scheduled for the currentrequestor.

d. Create a cursor to select all vacation schedulerows for the requestor.

Cursor vacation_schedule

(xrequestor in varchar2) is

Select approver_username,from_date, to_date

from WFVACXX_Vacation_Schedule

where requestor_username = xrequestor

order by from_date, to_date;

Cursor vacation_schedule

(xrequestor in varchar2) is

Select approver_username,from_date, to_date

from WFVACXX_Vacation_Schedule

where requestor_username = xrequestor

order by from_date, to_date;

Note:Include SQL date formatting on the from_date and to_date to improve theappearance of the date fields in your document.Use Workflow API WF_Directory.GetRoleDisplayName to display the approverdisplay name instead of the approver username in your document.

Page 316: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 12

Guided Practice Les 13-1 Creating a PL/SQLDocument Procedure

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

e. Build a document text buffer. You can chooseto create a document specific to thedisplay_type (text/html, text/plain, or null) orchoose to always create an html or plain textdocument.

f. Set the document_type based on the documentyou created, text/html or text/plain.

e. Build a document text buffer. You can chooseto create a document specific to thedisplay_type (text/html, text/plain, or null) orchoose to always create an html or plain textdocument.

f. Set the document_type based on the documentyou created, text/html or text/plain.

Display Typetext/html: the document is embedded in an HTML version of the notificationviewed from the Notification Details web page, or an HTML attachment to anemail message.Do not include top level HTML tags like <HTML> or <BODY>.

text/plain: the document is embedded in a plain text version of the notification asviewed in an email message.

‘‘ or null: the document is presented as a separate attachment to the notification;any content type can be returned.

Sample SolutionsRefer to PL/SQL package specification and body definition files wfvacxxs.sql andwfvacxxb.sql for sample solution.The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample proceduresused throughout the lesson practices. The procedure specific to Practice 13-1 isWFVACXX.VACATION_SCHEDULED.

Page 317: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 13

Guided Practice Les 13-1 Using a PL/SQL DocumentAttribute

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

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

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

Page 318: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 14

Guided Practice Les 13-1 Using a PL/SQL DocumentAttribute

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

d. To attach the content of the PL/SQL Documentto a message, open your Document messageattribute Properties, select a Frame Target andcheck the Attach Content checkbox.e. Create a Notification activity that sends theVacation Schedule message.f. Drag and drop the Notification activity from theBuilder Navigator to the Vacation Proposalprocess diagram. Replace the transition fromUpdate Vacation Schedule to End (Approve) withtransitions from Update Vacation Schedule to theVacation Schedule notification, and VacationSchedule notification to End (Approve).

d. To attach the content of the PL/SQL Documentto a message, open your Document messageattribute Properties, select a Frame Target andcheck the Attach Content checkbox.e. Create a Notification activity that sends theVacation Schedule message.f. Drag and drop the Notification activity from theBuilder Navigator to the Vacation Proposalprocess diagram. Replace the transition fromUpdate Vacation Schedule to End (Approve) withtransitions from Update Vacation Schedule to theVacation Schedule notification, and VacationSchedule notification to End (Approve).

Page 319: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 15

Guided Practice Les 13-1 Using a PL/SQL DocumentAttribute

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

g. Assign item attribute Requestor as theperformer on the Vacation Schedule notificationnode.

g. Assign item attribute Requestor as theperformer on the Vacation Schedule notificationnode.

Page 320: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 16

Guided Practice Les 13-1 Setting a Document AttributeValue

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 13-1Setting a Document Attribute Value

Guided Practice Les 13-1Setting a Document Attribute Value

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

In the message attribute Properties set the valueof your Document message attribute:a. To a corresponding Document item attribute.Set the item attribute value as a Constant in theitem attribute Properties Default Value or atruntime in the Initiate Workflow web page.b. To a Constant value.

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

In the message attribute Properties set the valueof your Document message attribute:a. To a corresponding Document item attribute.Set the item attribute value as a Constant in theitem attribute Properties Default Value or atruntime in the Initiate Workflow web page.b. To a Constant value.

Note:You can also set the value of the Document item attribute in a PL/SQL procedure.The PL/SQL procedure can be executed by a function activity as part of theworkflow process itself or it can be a PL/SQL procedure that issues WorkflowAPI calls to:• create the process• set item attribute values to support the process• start the process.

Token ReplacementThe ‘&REQUESTOR’ portion of sample value‘PLSQL:WFVACXX.VACATION_SCHEDULED/&REQUESTOR’ specifiesthat item attribute ‘REQUESTOR’ will be token replaced with the runtime valueof this item attribute.

Page 321: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 17

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

Copyright Oracle Corporation, 2000. All rights reserved.®

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

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

4. A PL/SQL Document is generated with display typeof text/html when the message is viewed throughthe Notification Details web page.a. Launch a Vacation Proposal work item andapprove the proposal.b. Open the Vacation Schedule notification fromthe Worklist and review your document.c. Correct any formatting or processing errorsneeded in your PL/SQL procedure. Use thebrowser Reload option to display the updatedversion of the Vacation Schedule notificationdetails.

4. A PL/SQL Document is generated with display typeof text/html when the message is viewed throughthe Notification Details web page.a. Launch a Vacation Proposal work item andapprove the proposal.b. Open the Vacation Schedule notification fromthe Worklist and review your document.c. Correct any formatting or processing errorsneeded in your PL/SQL procedure. Use thebrowser Reload option to display the updatedversion of the Vacation Schedule notificationdetails.

Page 322: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 18

Les 13-1 Summary

Copyright Oracle Corporation, 2000. All rights reserved.®

Les 13-1 SummaryLes 13-1 Summary

In this practice, you should have learned how to:• Write a PL/SQL procedure to create a document

based on application data• Embed a PL/SQL Document in a message• Attach a PL/SQL Document to a message• Set the value of a PL/SQL Document attribute

In this practice, you should have learned how to:• Write a PL/SQL procedure to create a document

based on application data• Embed a PL/SQL Document in a message• Attach a PL/SQL Document to a message• Set the value of a PL/SQL Document attribute

Sample SolutionsRefer to PL/SQL package specification and body definition files wfvacxxs.sql andwfvacxxb.sql and workflow definition file wfvacxx_131.wft for sample solutions.The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample proceduresused throughout the lesson practices. The procedure specific to Practice 13-1 isWFVACXX.VACATION_SCHEDULED.

Page 323: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 19

Practice Les 13-2 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Practice Les 13-2 OverviewPractice Les 13-2 Overview

This practice covers the following topics:• Creating a function activity with a result type

– write a supporting PL/SQL procedure to checkfor Requestor equal to Approver

– return result of Y or N• Branching on a function activity result

– if function returns Yes, reject proposal– if function returns No, continue process

This practice covers the following topics:• Creating a function activity with a result type

– write a supporting PL/SQL procedure to checkfor Requestor equal to Approver

– return result of Y or N• Branching on a function activity result

– if function returns Yes, reject proposal– if function returns No, continue process

Note:Return lookup codes ‘Y’ and ‘N’ defined in Standard lookup type Yes/No as thepossible results returned by your PL/SQL procedure.Assign Result Type Yes/No to the function activity that executes your PL/SQLprocedure. Branch on the lookup display names Yes and No.

Page 324: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 20

Guided Practice Les 13-2 Creating a PL/SQLProcedure with Result

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 13-2Creating a PL/SQL Procedure with Result

Guided Practice Les 13-2Creating a PL/SQL Procedure with Result

1. Use the standard API format for your PL/SQLspecification and body.

1. Use the standard API format for your PL/SQLspecification and body.procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

funcmode in varchar2,

resultout out varchar2)

a. Add to your package “WFVACXX” created inpractice Les 8-1.

b. Give your procedure a descriptive name, suchas CHECK_APPROVER.

a. Add to your package “WFVACXX” created inpractice Les 8-1.

b. Give your procedure a descriptive name, suchas CHECK_APPROVER.

Page 325: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 21

Guided Practice Les 13-2 RUN processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 13-2RUN processing

Guided Practice Les 13-2RUN processing

c. In your PL/SQL procedure include logic forRUN funcmode:– retrieve the values for requestor and

approver using API calls towf_engine.GetItemAttrText

– if requestor <> approver set resultout towf_engine.eng_completed||’:’||’N’

– if requestor = approver set resultout towf_engine.eng_completed||’:’||’Y’

c. In your PL/SQL procedure include logic forRUN funcmode:– retrieve the values for requestor and

approver using API calls towf_engine.GetItemAttrText

– if requestor <> approver set resultout towf_engine.eng_completed||’:’||’N’

– if requestor = approver set resultout towf_engine.eng_completed||’:’||’Y’

Page 326: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 22

Guided Practice Les 13-2 CANCEL processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 13-2CANCEL processing

Guided Practice Les 13-2CANCEL processing

d. Specific logic is not necessary for CANCELfuncmode, set resultout towf_engine.eng_completed||’:’||wf_engine.eng_null

d. Specific logic is not necessary for CANCELfuncmode, set resultout towf_engine.eng_completed||’:’||wf_engine.eng_null

Page 327: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 23

Guided Practice Les 13-2 Adding a Function Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 13-2Adding a Function ActivityGuided Practice Les 13-2

Adding a Function Activity2. In the Workflow Builder Vacation Proposal process

diagram:a. Delete the transition between the Start and

Vacation Proposal notification nodes.b. Click on the New Function icon, position the

cross-hairs between the Start and VacationProposal notification nodes, and click again toopen the properties.

c. Enter unique Internal and Display Names (suchas CHECK_APPROVER and Approver same asRequestor?), select an icon , and enter aFunction Name using format<package.procedure> for the PL/SQLprocedure you just created.

2. In the Workflow Builder Vacation Proposal processdiagram:a. Delete the transition between the Start and

Vacation Proposal notification nodes.b. Click on the New Function icon, position the

cross-hairs between the Start and VacationProposal notification nodes, and click again toopen the properties.

c. Enter unique Internal and Display Names (suchas CHECK_APPROVER and Approver same asRequestor?), select an icon , and enter aFunction Name using format<package.procedure> for the PL/SQLprocedure you just created.

Function Activity Internal NameAs a workflow development standard, use the procedure name as thecorresponding function activity internal name wherever possible.

Function Value<package.procedure> value should look like WFVACXX.CHECK_APPROVER,where ‘XX’ is the unique number assigned to your work station.

Page 328: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 24

Guided Practice Les 13-2 Adding a Function ActivityContinued

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 13-2Adding a Function Activity Continued

Guided Practice Les 13-2Adding a Function Activity Continued

d. Draw a transition from Start to Approver sameas Requestor? node.

e. Draw a transition from Approver same asRequestor? to Vacation Proposal notificationnode, select ‘No’ from Results menu.

f. Drag and drop an additional End node from theStandard item type into your diagram. On theNode properties tab, set the Result to Reject.

g. Draw a transition from Approver same asRequestor? to new End (Reject) node, select‘Yes’ or <Default> from Results menu.

d. Draw a transition from Start to Approver sameas Requestor? node.

e. Draw a transition from Approver same asRequestor? to Vacation Proposal notificationnode, select ‘No’ from Results menu.

f. Drag and drop an additional End node from theStandard item type into your diagram. On theNode properties tab, set the Result to Reject.

g. Draw a transition from Approver same asRequestor? to new End (Reject) node, select‘Yes’ or <Default> from Results menu.

Additional End (Reject) NodeUse more than one End node to simplify your diagram and to uniquely identifywhich End activity is executed when more than one path through the process canterminate with the same result. Set each End node label to a descriptive value.For example, the Vacation Proposal process can now end with a result of Rejectfor two unique reasons:1. A Vacation Proposal is submitted with the approver equal to the requestor.2. A Vacation Proposal is rejected by the approver.

Page 329: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 25

Les 13-2 Summary

Copyright Oracle Corporation, 2000. All rights reserved.®

Les 13-2 SummaryLes 13-2 Summary

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

function activity

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

function activity

Sample SolutionsRefer to PL/SQL package specification and body definition files wfvacxxs.sql andwfvacxxb.sql and workflow definition file wfvacxx_132.wft for sample solutions.The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample proceduresused throughout the lesson practices. The procedure specific to Practice 13-2 isWFVACXX.CHECK_APPROVER.

Page 330: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PL/SQL DocumentsChapter 13 - Page 26

Page 331: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 1

Selector FunctionsChapter 14

Page 332: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 2

Selector Functions

Copyright Oracle Corporation, 2000. All rights reserved.®

Selector FunctionsSelector Functions

Page 333: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

After this lesson you should be able to:• Create a standard API for a selector/callback

function• Define a selector/callback function• Call a selector/callback function

After this lesson you should be able to:• Create a standard API for a selector/callback

function• Define a selector/callback function• Call a selector/callback function

Page 334: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 4

Item Type Selector Function

Copyright Oracle Corporation, 2000. All rights reserved.®

Item Type Selector FunctionItem Type Selector Function

• An item type can have more than one runnableprocess activity associated with it.

• PL/SQL selector functions are defined todetermine which process activity to run in aparticular situation.

• Selector functions can be extended to be a generalcallback function so that item type contextinformation can be reset as needed if the SQLsession is interrupted.

• Associate a Selector Function with an Item Typethrough the item type properties.

• An item type can have more than one runnableprocess activity associated with it.

• PL/SQL selector functions are defined todetermine which process activity to run in aparticular situation.

• Selector functions can be extended to be a generalcallback function so that item type contextinformation can be reset as needed if the SQLsession is interrupted.

• Associate a Selector Function with an Item Typethrough the item type properties.

Item Type Selector FunctionFor example, if an item type had two different requisition approval processactivities, then the process executed by Oracle Workflow may be dependent onwhere the requisition originates. A selector function would determine whichprocess would be appropriate in any given situation.

Page 335: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 5

Standard API for the Selector/Callback Function

Copyright Oracle Corporation, 2000. All rights reserved.®

Standard API for the Selector/CallbackFunction

Standard API for the Selector/CallbackFunction

• You can define one PL/SQL procedure thatincludes both selector and callbackfunctionality by following a standard API.

• You can define one PL/SQL procedure thatincludes both selector and callbackfunctionality by following a standard API.

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

command in varchar2,

resultout out varchar2)

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

command in varchar2,

resultout out varchar2)

Standard API for Selector/Callback Functionprocedure <procedure name>( itemtype in varchar2, itemkey in varchar2, actid in number, command in varchar2, resultout out varchar2) is<local declarations>beginif (command = ‘RUN’) then

<your RUN executable statements>resultout:=‘<Name of process to run>‘;return;

endif;if (command = ‘SET_CTX’) then

<your executable statements for establishing context information>resultout:=‘ ‘;return;

endif;...

Page 336: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 6

Standard API for the Selector/Callback Function(continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Standard API for the Selector/CallbackFunction (continued)

Standard API for the Selector/CallbackFunction (continued)

• You can define one PL/SQL procedure thatincludes both selector and callbackfunctionality by following a standard API.

• You can define one PL/SQL procedure thatincludes both selector and callbackfunctionality by following a standard API.

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

command in varchar2,

resultout out varchar2)

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

command in varchar2,

resultout out varchar2)

Standard API for Selector/Callback Function (continued)if (command = ‘TEST_CTX’) then

<your executable statements for testing validity of current context information>resultout:=‘<TRUE or FALSE>‘;return;

endif;if (command = ‘<other commands>’) then

resultout:=‘ ‘;return;

endif;exceptionwhen others then

WF_CORE.CONTEXT (‘<package name>‘, ‘<procedure name>‘, <itemtype>, <itemkey>,

to_char(<actid>), <command>);raise;

end <procedure name>;

Page 337: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 7

Defining a Selector/Callback Function

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining a Selector/Callback FunctionDefining a Selector/Callback Function

• itemtypethe internal name for the item type.Defined in the Oracle Workflow Builder.

• itemkeya string that represents a primary keygenerated by the workflow-enabled application forthe item type. The string uniquely identifies theitem within an item type.

• actidthe ID number of the activity that thisprocedure is called from. This parameter is alwaysnull if the procedure is called with the ‘RUN’command to execute the selector function.

• itemtypethe internal name for the item type.Defined in the Oracle Workflow Builder.

• itemkeya string that represents a primary keygenerated by the workflow-enabled application forthe item type. The string uniquely identifies theitem within an item type.

• actidthe ID number of the activity that thisprocedure is called from. This parameter is alwaysnull if the procedure is called with the ‘RUN’command to execute the selector function.

Page 338: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 8

Defining a Selector/Callback Function (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining a Selector/Callback Function(continued)

Defining a Selector/Callback Function(continued)

• commanddetermines how to execute theselector/callback function.

• resultouta result may be returned depending onthe command used to call the selector/callbackfunction

• commanddetermines how to execute theselector/callback function.

• resultouta result may be returned depending onthe command used to call the selector/callbackfunction

Return Values from CommandsIf the function is called with ‘RUN’, the name of the process to run mustbe returned through the resultout parameter.If the function is called with ‘SET_CTX’, then no return value isexpected.If the function is called with ‘TEST_CTX’, then the code must return‘TRUE’ if the context is correct or ‘FALSE’ if the context is incorrect.If any other value is returned, Oracle Workflow assumes the command isnot implemented by the callback.Note: Other commands may be added in the future.

Page 339: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 9

Calling a Selector/Callback Function

Copyright Oracle Corporation, 2000. All rights reserved.®

Calling a Selector/Callback FunctionCalling a Selector/Callback Function

• RUNto select the appropriate process to startwhen either of the following conditions occur:– A process is not explicitly passed to

WF_ENGINE.CreateProcess.– A process is implicitly started by

WF_ENGINE.CompleteActivity with no priorcall to WF_ENGINE.CreateProcess.

• SET_CTXto establish any context informationthat a function activity in an item type needs toexecute, before a new database session begins.

• TEST_CTXto determine if the current item typecontext is correct before executing a function.

• RUNto select the appropriate process to startwhen either of the following conditions occur:– A process is not explicitly passed to

WF_ENGINE.CreateProcess.– A process is implicitly started by

WF_ENGINE.CompleteActivity with no priorcall to WF_ENGINE.CreateProcess.

• SET_CTXto establish any context informationthat a function activity in an item type needs toexecute, before a new database session begins.

• TEST_CTXto determine if the current item typecontext is correct before executing a function.

Oracle Workflow can call the selector/callback function Oracle Workflow can call the selector/callback function with the following commands:with the following commands:

Page 340: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 10

Practice Les 14-1 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Practice Les 14-1 OverviewPractice Les 14-1 Overview

This practice covers the following topics:• Creating additional processes in the WFVACXX

item type– duplicate the Vacation Proposal process, but

implement an alternate Vacation Proposalnotification Timeout

• Assigning a Selector function to an Item Type• Creating a Selector function to choose which

process to run based on the item key value• Testing a Selector function

This practice covers the following topics:• Creating additional processes in the WFVACXX

item type– duplicate the Vacation Proposal process, but

implement an alternate Vacation Proposalnotification Timeout

• Assigning a Selector function to an Item Type• Creating a Selector function to choose which

process to run based on the item key value• Testing a Selector function

Page 341: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 11

Guided Practice Les 14-1 Duplicating a Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 14-1Duplicating a Process

Guided Practice Les 14-1Duplicating a Process

1. In the Workflow Builder Navigator open and expandthe <WFVACXX> item type:a. Drag and drop the Vacation Proposal processonto the WFVACXX item type to create a copy.When the process properties window opens, enternew internal and display names for the duplicateprocess. For example,WFVACXX_PROCESS_ALTERNATE and AlternateVacation Proposal.

b. Open the Alternate Vacation Proposal processdiagram. Replace the Vacation Proposalnotification <Timeout> to a Loop Counter with a<Timeout> transition back to the VacationProposal notification.

1. In the Workflow Builder Navigator open and expandthe <WFVACXX> item type:a. Drag and drop the Vacation Proposal processonto the WFVACXX item type to create a copy.When the process properties window opens, enternew internal and display names for the duplicateprocess. For example,WFVACXX_PROCESS_ALTERNATE and AlternateVacation Proposal.

b. Open the Alternate Vacation Proposal processdiagram. Replace the Vacation Proposalnotification <Timeout> to a Loop Counter with a<Timeout> transition back to the VacationProposal notification.

To Create a Self <Timeout> LoopTo create a <Timeout> transition from the Vacation Proposal notification nodeback to itself, select the Vacation Proposal notification node and, holding downyour right mouse button, drag your mouse away from the node and back again.Release your right mouse button. Select <Timeout> from the Results menu.

Page 342: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 12

Guided Practice Les 14-1 Assigning a SelectorFunction

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 14-1Assigning a Selector Function

Guided Practice Les 14-1Assigning a Selector Function

2. In the Workflow Builder Navigator open theproperties for the <WFVACXX> item type and entera <package.procedure> value in the Selector field.For example, WFVACXX.SELECTOR.

2. In the Workflow Builder Navigator open theproperties for the <WFVACXX> item type and entera <package.procedure> value in the Selector field.For example, WFVACXX.SELECTOR.

Page 343: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 13

Guided Practice Les 14-1 Creating a SelectorProcedure

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 14-1 Creating a Selector Procedure

Guided Practice Les 14-1 Creating a Selector Procedure

3. Use the standard API format for your PL/SQLspecification and body.

3. Use the standard API format for your PL/SQLspecification and body.

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

command in varchar2,

resultout in out varchar2)

procedure <procedure name>

(itemtype in varchar2,

itemkey in varchar2,

actid in number,

command in varchar2,

resultout in out varchar2)

a. Add to your package “WFVACXX” created inpractice Les 8-1.

b. Give your procedure the same name assignedas the item type Selector <procedure> value.

a. Add to your package “WFVACXX” created inpractice Les 8-1.

b. Give your procedure the same name assignedas the item type Selector <procedure> value.

Page 344: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 14

Guided Practice Les 14-1 RUN processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 14-1RUN processing

Guided Practice Les 14-1RUN processing

4. In your SELECTOR procedure include logic for theRUN command:a. Evaluate the value passed in the item key.

If the upper case value of the first fourcharacters is:– ‘CNTR’ return the internal name of the

process with the Loop Counter Timeoutimplementation

– ‘SELF’ return the internal name of theprocess with the Self Loop Timeoutimplementation

– neither value, either raise an error or returnone of the processes as the default process

4. In your SELECTOR procedure include logic for theRUN command:a. Evaluate the value passed in the item key.

If the upper case value of the first fourcharacters is:– ‘CNTR’ return the internal name of the

process with the Loop Counter Timeoutimplementation

– ‘SELF’ return the internal name of theprocess with the Self Loop Timeoutimplementation

– neither value, either raise an error or returnone of the processes as the default process

Setting Resultout ParameterParameter resultout should be set to the internal name of the process that shouldbe started.Note:The selector procedure example given is contrived for class purposes only anddoes not reflect a practical implementation of selector function logic. Theselector function is generally expected to use the item key as the primary key toretrieve supporting applications data. The application data retrieved would thenbe used to determine which process is appropriate to run.

Page 345: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 15

Guided Practice Les 14-1 Testing a Selector Function

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 14-1Testing a Selector FunctionGuided Practice Les 14-1

Testing a Selector Function

5. Connect to the Oracle Workflow home page. Logon as any user with “Administrator” privileges.a. Select the Launch Processes linkb. Select your Item Type link from the listc. On the Initiate Workflow page enter:

– an item key to exercise your Selector logic(values prefixed with ‘CNTR’, ‘SELF’, etc.)

– a unique user key– a Process Name of None from the poplist– a requestor and approver– a from and to date (DD-MON-RR)

5. Connect to the Oracle Workflow home page. Logon as any user with “Administrator” privileges.a. Select the Launch Processes linkb. Select your Item Type link from the listc. On the Initiate Workflow page enter:

– an item key to exercise your Selector logic(values prefixed with ‘CNTR’, ‘SELF’, etc.)

– a unique user key– a Process Name of None from the poplist– a requestor and approver– a from and to date (DD-MON-RR)

To Run the Selector FunctionThe Workflow Engine will run the selector function only if the process parameteris not passed in the call to create the new process instance. So, when you initiatea workflow from the Initiate Workflow web page you must select None from theProcess Name poplist.To initiate a workflow (with sample itemkey value prefixed with ‘CNTR’), froma sql*plus session you would issue the following commands:1. exec wf_engine.CreateProcess(‘WFVACXX’,’CNTR<n>‘);2. for each required text item attribute:exec wf_engine.SetItemAttrText(‘WFVACXX’,’CNTR<n>‘,<attr name>,<attrvalue>);

for each required date item attribute:exec wf_engine.SetItemAttrDate(‘WFVACXX’,’CNTR<n>‘,<attr name>,<attrvalue>);3. exec wf_engine.SetItemUserKey(‘WFVACXX’,’CNTR<n>‘,<userkeyvalue>);4. exec wf_engine.SetItemOwner(‘WFVACXX’,’CNTR<n>‘,<role name>);5. exec wf_engine.StartProcess(‘WFVACXX’,’CNTR<n>‘);6. commit;

Page 346: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 16

Guided Practice Les 14-1: Monitoring the Results

Copyright Oracle Corporation, 2000. All rights reserved.®

Guided Practice Les 14-1:Monitoring the Results

Guided Practice Les 14-1:Monitoring the Results

6. Display the Monitor web pages for your work item.The process run will appear in the:– Monitor Process List, Process Name column– Monitor Activities List, Parent Activity column– Monitor Diagram, Process Title and Diagram

itself Verify that the expected process was run. If an

error occurred in your process, use the ResultException link in the Activities List to determinethe cause.

6. Display the Monitor web pages for your work item.The process run will appear in the:– Monitor Process List, Process Name column– Monitor Activities List, Parent Activity column– Monitor Diagram, Process Title and Diagram

itself Verify that the expected process was run. If an

error occurred in your process, use the ResultException link in the Activities List to determinethe cause.

Note:After starting a process from the Initiate Workflow web page, control is passed tothe Monitor Activities List web page.After starting a process from a sql*plus session, retrieve the process status byrunning the developer sql script wfstat.sql <itemtype> <itemkey> or by using theFind Processes web page.

Page 347: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 17

Les 14-1 Summary

Copyright Oracle Corporation, 2000. All rights reserved.®

Les 14-1 SummaryLes 14-1 Summary

In this practice, you should have learned how to:• Write a PL/SQL procedure to select which process

to run• Assign a Selector function to an item type• Cause the Workflow Engine to run a Selector

function• Verify that your Selector function returns the

process name expected

In this practice, you should have learned how to:• Write a PL/SQL procedure to select which process

to run• Assign a Selector function to an item type• Cause the Workflow Engine to run a Selector

function• Verify that your Selector function returns the

process name expected

Sample SolutionsRefer to PL/SQL package specification and body definition files wfvacxxs.sql andwfvacxxb.sql and workflow definition file wfvacxx_141.wft for sample solutions.The wfvacxxs.sql and wfvacxxb.sql files contain all PL/SQL sample proceduresused throughout the lesson practices. The procedure specific to Practice 14-1 isWFVACXX.SELECTOR.

Page 348: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Selector FunctionsChapter 14 - Page 18

Page 349: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 1

External System IntegrationChapter 15

Page 350: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 2

External System Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

External System IntegrationExternal System Integration

Page 351: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

After this lesson you should be able to:• Understand the options to incorporate external

system processing in a workflow process.• Describe the concept of Advanced Queues.• Describe how to pause and resume a workflow

process.

After this lesson you should be able to:• Understand the options to incorporate external

system processing in a workflow process.• Describe the concept of Advanced Queues.• Describe how to pause and resume a workflow

process.

Page 352: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 4

Oracle Workflow Terms

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow TermsOracle Workflow Terms

• BlockActivity• CompleteActivity• BlockActivity• CompleteActivity

Page 353: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 5

External Function Activity Support

Copyright Oracle Corporation, 2000. All rights reserved.®

FunctionFunctionActivityActivity External Execution

Agent• Java• CORBA• OS command

Oracle8Oracle8AdvancedAdvancedQueuesQueues

External Function Activity SupportExternal Function Activity Support

External Function Activity SupportOracle Workflow supports function activities that are external to the database,facilitating integration with external products and legacy systems.The workflow engine:

• Leverages Oracle8 advanced queues to support the execution of externalfunction activities• Inserts messages into the outbound queue that external execution agentscan consume; the external execution agents must support Java, CORBA,or OS command activities• Expects the external function to return information to the inbound queue

Advanced Queues is also being used to improve the throughput of the backgroundengine.

Page 354: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 6

Advanced Queues Processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Advanced Queues ProcessingAdvanced Queues Processing

• Oracle Workflow queue APIs are called to handleworkflow Advanced Queues Processing.

• An ‘outbound’ and ‘inbound’ queue is established.• A package of data on the queue is referred to as

an event or a message.• Events are enqueued in the outbound queue for

agents to consume and process.• An agent may enqueue a message to the inbound

queue for the Workflow Engine to consume andprocess.

• Outbound and inbound queues facilitate theintegration of external activities into the workflowprocess.

• Oracle Workflow queue APIs are called to handleworkflow Advanced Queues Processing.

• An ‘outbound’ and ‘inbound’ queue is established.• A package of data on the queue is referred to as

an event or a message.• Events are enqueued in the outbound queue for

agents to consume and process.• An agent may enqueue a message to the inbound

queue for the Workflow Engine to consume andprocess.

• Outbound and inbound queues facilitate theintegration of external activities into the workflowprocess.

Note:A message in the context of AQ processing is different from the messagesassociated with notification activities.Agents may be any application that is external to the database.

Page 355: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 7

Advanced Queue Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

Advanced Queue IntegrationAdvanced Queue Integration

Workflow

WorkflowEngine

BackgroundEngine

Advanced QueueWF Outbound

WF Inbound

WF Deferred

Oracle Server

External Inbound

External Outbound

External Process

External System

Workflow Outbound, Inbound, and Deferred queues are established in theworkflow account.

Page 356: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 8

Advanced Queue Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

Advanced Queue IntegrationAdvanced Queue Integration

Workflow

WorkflowEngine

BackgroundEngine

Advanced QueueWF Outbound

WF Inbound

WF Deferred

Oracle Server

External Inbound

External Outbound

External Process

External System

When an external function activity is encountered by the Workflow Engine amessage is written to the outbound queue. The payload of the message willinclude any activity attribute name - value pairs.

Page 357: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 9

Advanced Queue Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

Advanced Queue IntegrationAdvanced Queue Integration

Workflow

WorkflowEngine

BackgroundEngine

Advanced QueueWF Outbound

WF Inbound

WF Deferred

Oracle Server

External Inbound

External Outbound

External Process

External System

A message on the workflow outbound queue is read by an external agent, possiblyinto an external inbound queue.

Page 358: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 10

Advanced Queue Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

Advanced Queue IntegrationAdvanced Queue Integration

Workflow

WorkflowEngine

BackgroundEngine

Advanced QueueWF Outbound

WF Inbound

WF Deferred

Oracle Server

External Inbound

External Outbound

External Process

External System

The external system consumes and processes the message and may write it to anexternal outbound queue.

Page 359: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 11

Advanced Queue Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

Advanced Queue IntegrationAdvanced Queue Integration

Workflow

WorkflowEngine

BackgroundEngine

Advanced QueueWF Outbound

WF Inbound

WF Deferred

Oracle Server

External Inbound

External Outbound

External Process

External System

The external agent enqueues a message in the workflow inbound queue for OracleWorkflow to consume and process. The workflow inbound queue can be thoughtof as the “reply” to the original workflow outbound queue message. The inboundqueue message payload can include activity attribute name - value pairs withupdated values.

Page 360: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 12

Advanced Queue Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

Advanced Queue IntegrationAdvanced Queue Integration

Workflow

WorkflowEngine

BackgroundEngine

Advanced QueueWF Outbound

WF Inbound

WF Deferred

Oracle Server

External Inbound

External Outbound

External Process

External System

The Workflow Background Engine consumes and processes the inbound messageand completes the original function activity.Advanced Queue Processing APIsThe following WF_QUEUE package APIs support use of external functionactivities:EnqueueInbound()DequeueOutbound()DequeueEventDetail()PurgeEvent()PurgeItemType()ProcessInboundQueue()GetMessageHandle()Deferred_queue()Inbound_queue()Outbound_queue()ClearMsgStack()CreateMsg()WriteMsg()SetMsgAttr()SetMsgResult()

Page 361: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 13

Advanced Queue Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

Advanced Queue IntegrationAdvanced Queue Integration

Workflow

WorkflowEngine

BackgroundEngine

Advanced QueueWF Outbound

WF Inbound

WF Deferred

Oracle Server

External Inbound

External Outbound

External Process

External System

The Workflow Engine also integrates with Advanced Queues to carry outdeferred processing. When the Workflow Engine encounters an activity fordeferred processing a message is written to a separate “deferred” queue. TheBackground Engine consumes and processes the deferred queue messages,executing and completing the deferred activity.

Page 362: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 14

Block Activity

Copyright Oracle Corporation, 2000. All rights reserved.®

Block ActivityBlock Activity

• is a standard function activity alternative toincorporating external system processing.

• lets you pause a process until an external programor manual step completes.

• delays a process until a particular condition is met.• requires a program to issue a call to

WF_ENGINE.CompleteActivity to resume theprocess at the Block activity.

• is a standard function activity alternative toincorporating external system processing.

• lets you pause a process until an external programor manual step completes.

• delays a process until a particular condition is met.• requires a program to issue a call to

WF_ENGINE.CompleteActivity to resume theprocess at the Block activity.

Page 363: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 15

CompleteActivity

Copyright Oracle Corporation, 2000. All rights reserved.®

CompleteActivityCompleteActivity

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

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

procedure CompleteActivity

(itemtype in varchar2,

itemkey in varchar2,

activity in varchar2,

result_code in varchar2);

procedure CompleteActivity

(itemtype in varchar2,

itemkey in varchar2,

activity in varchar2,

result_code in varchar2);

WF_ENGINE.CompleteActivity APICall WF_ENGINE.CompleteActivity to indicate an activity is completed. Thisprocedure requires that the activity currently has a status of 'Notified'. An optionalactivity completion result can also be passed. (Result is not applicable for thestandard Block activity.) The result can determine which transition the processtakes next.Provide the activity node's label name. If the activity node label name does notuniquely identify the subprocess you can precede the label name with the internalname of its parent process. For example,<parent_process_internal_name>:<label_name>.

Page 364: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

External System IntegrationChapter 15 - Page 16

Page 365: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous ProcessingChapter 16 - Page 1

Forced SynchronousProcessingChapter 16

Page 366: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous ProcessingChapter 16 - Page 2

Forced Synchronous Processing

Copyright Oracle Corporation, 2000. All rights reserved.®

Forced Synchronous ProcessingForced Synchronous Processing

Page 367: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous ProcessingChapter 16 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

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

Page 368: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous ProcessingChapter 16 - Page 4

Forced Synchronous Processes

Copyright Oracle Corporation, 2000. All rights reserved.®

Forced Synchronous ProcessesForced Synchronous Processes

• A synchronous process includes consecutivefunction activities in a single thread that are notdeferred to the background engine.

• A forced synchronous process completes in asingle SQL session and never inserts or updatesany database tables.

• A forced synchronous process, therefore,generates a result more quickly than asynchronous process.

• A synchronous process includes consecutivefunction activities in a single thread that are notdeferred to the background engine.

• A forced synchronous process completes in asingle SQL session and never inserts or updatesany database tables.

• A forced synchronous process, therefore,generates a result more quickly than asynchronous process.

Forced Synchronous ProcessingTo create a forced synchronous process, you need to set the itemkey ofyour process to #SYNCH or wf_engine.eng_synch, which returns the#SYNCH constant when you call the necessary WF_ENGINE APIs.Because a forced synchronous process never writes to the database, usinga non-unique itemkey such as #SYNCH is not an issue.

Page 369: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous ProcessingChapter 16 - Page 5

Process Definition Restrictions

Copyright Oracle Corporation, 2000. All rights reserved.®

Process Definition RestrictionsProcess Definition Restrictions

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

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

Process Definition RestrictionsNo notification activities are allowed.Limited blocking-type activities are allowed. A process can blockand restart with a call to WF_ENGINE.CompleteActivity only ifthe blocking and restarting activities:

Occur in the same database session.Contain no intervening calls to Oracle Workflow.Contain no intervening commits.

No Error Processes can be assigned to the process or the process’sactivities.Each function activity behaves as if On Revisit is set to Loop, andis run in non-canceling mode, regardless of its actual On Revisitsetting. Loops are allowed in the process.No Master/Detail coordination activities are allowed.No parallel flows are allowed in the process, as transitions fromeach activity must have a distinct result. This also means that no<Any> transitions are allowed because they cause parallel flows.

Page 370: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous ProcessingChapter 16 - Page 6

Process Definition Restrictions (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Process Definition Restrictions(continued)

Process Definition Restrictions(continued)

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

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

Process Definition Restrictions (continued)None of the following Standard activities are allowed:

AndBlock (restricted by the conditions stated in the LimitedBlocking bullet point above.)Defer ThreadWaitContinue Flow/Wait for FlowRole ResolutionVotingCompare Execution TimeNotify

No use of the background engine; that is, activities are neverdeferred.No data is ever written to the Oracle Workflow tables and as aresult:

The process cannot be viewed from the Workflow Monitor.No auditing is available for the process.

Page 371: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous ProcessingChapter 16 - Page 7

Process Definition Restrictions (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Process Definition Restrictions(continued)

Process Definition Restrictions(continued)

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

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

Process Definition Restrictions (continued)Only the following WF_ENGINE API calls are allowed to bemade, and in all cases, the itemkey supplied to these APIs must bespecified as #SYNCH or wf_engine.eng_synch:

WF_ENGINE.CreateProcessWF_ENGINE.StartProcessWF_ENGINE.GetItemAttributeWF_ENGINE.SetItemAttributeWF_ENGINE.GetActivityAttributeWF_ENGINE.CompleteActivity (for the limited usage ofblocking-type activities)

WF_ENGINE API calls for any item, except the item for thecurrent synchronous item, are not allowed.

Page 372: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Forced Synchronous ProcessingChapter 16 - Page 8

Page 373: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PurgeChapter 17 - Page 1

PurgeChapter 17

Page 374: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PurgeChapter 17 - Page 2

Purge

Copyright Oracle Corporation, 2000. All rights reserved.®

PurgePurge

Page 375: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PurgeChapter 17 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

Object PurgingThe persistence type of an item type controls when Oracle Workflow purges runtimestatus information for instances of a workflow; the persistence values are:

• Temporary: Item will be deleted in n days• Permanent: Item will be deleted only when forced

Page 376: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PurgeChapter 17 - Page 4

Purging Obsolete Workflow Data

Copyright Oracle Corporation, 2000. All rights reserved.®

Purging Obsolete Workflow DataPurging Obsolete Workflow Data

• Purge APIs delete obsolete runtime data andactivity versions no longer in use.

• The most commonly used WF_PURGE APIs:– Items – purge all runtime data associated with

completed items, their processes, andnotifications sent by them.

– Activities – purge obsolete versions ofactivities that are no longer in use by any item.

– Total – purge both item data and activity data.– AdHocDirectory - purge users and roles in the

WF_LOCAL_* tables whose expiration datehas elapsed and that are not referenced in anynotification.

• Purge APIs delete obsolete runtime data andactivity versions no longer in use.

• The most commonly used WF_PURGE APIs:– Items – purge all runtime data associated with

completed items, their processes, andnotifications sent by them.

– Activities – purge obsolete versions ofactivities that are no longer in use by any item.

– Total – purge both item data and activity data.– AdHocDirectory - purge users and roles in the

WF_LOCAL_* tables whose expiration datehas elapsed and that are not referenced in anynotification.

Common WF_PURGE API ParametersMany of the Purge APIs accept the following parameters:

• Item Type - item type associated with the obsolete runtime data you want todelete. Leave null to delete obsolete data for all item types.• Item Key - string generated from the application object’s primary key. Thestring uniquely identifies the item within an item type. If null, purges all items inthe specified item type.• Enddate - Specified date to delete up to.

Note: WF_PURGE APIs only purge data associated with Temporary item types, whosepersistence, in days, has expired. A persistence type PL/SQL variable is set to ‘TEMP’(Temporary) by default and should not be changed.Use API WF_PURGE.TotalPERM to delete all eligible obsolete runtime data associatedwith item types of Permanent persistence type.

Page 377: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PurgeChapter 17 - Page 5

Purging Obsolete Workflow Data in Oracle Applications

Copyright Oracle Corporation, 2000. All rights reserved.®

Purging Obsolete Workflow Datain Oracle Applications

Purging Obsolete Workflow Datain Oracle Applications

• Use the concurrent program Purge ObsoleteWorkflow Runtime Data, short name FNDWFPR.

• Systems administrator should add the concurrentprogram to the security group for theresponsibility you wish to run this program from.

• Navigate to the Submit Request form in OracleApplications.

• Supply the following parameters:– Item Type– Item Key– Age– Persistence Type

• Use the concurrent program Purge ObsoleteWorkflow Runtime Data, short name FNDWFPR.

• Systems administrator should add the concurrentprogram to the security group for theresponsibility you wish to run this program from.

• Navigate to the Submit Request form in OracleApplications.

• Supply the following parameters:– Item Type– Item Key– Age– Persistence Type

Concurrent Program ParametersItem Type - item type associated with the obsolete runtime data you want to delete. Leavenull to delete obsolete data for all item types.Item Key - string generated from the application object’s primary key. The stringuniquely identifies the item within an item type. If null, purges all items in the specifieditem type.Age - minimum age of data to purge, in days if Persistence Type is set to ‘Temporary’.Default is 0.Persistence Type - persistence type to be purged, either ‘Temporary’ or ‘Permanent’.Default is ‘Temporary’.

Page 378: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PurgeChapter 17 - Page 6

Purging Obsolete Workflow Data in Oracle Applications(continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

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

in Oracle Applications (continued)

Page 379: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PurgeChapter 17 - Page 7

Demonstration

Copyright Oracle Corporation, 2000. All rights reserved.®

DemonstrationDemonstration

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

In Oracle Workflow we will demonstrate how to:In Oracle Workflow we will demonstrate how to:

Page 380: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

PurgeChapter 17 - Page 8

Page 381: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 1

Document ManagementIntegrationChapter 18

Page 382: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 2

Document Management Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

Document Management IntegrationDocument Management Integration

Page 383: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

Workflow.

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

Workflow.

Page 384: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 4

Document Management Integration

Copyright Oracle Corporation, 2000. All rights reserved.®

Document Management IntegrationDocument Management Integration

NotificationNotificationActivitiesActivities

DocumentDocumentManagementManagement

SystemSystem

PL/SQL Interface Layer

Document Management IntegrationOracle Workflow is integrated with targeted document managementsystems to allow you to incorporate third-party documents and documentmanagement operations in a workflow process.The new server PL/SQL interface layer (an open API layer) consists ofprocedures that let you define standard workflow operations as userinterface actions which can be taken on an item attribute. The standarddocument management operations include:

View: Fetch a document for read-only useCheck Out: Retrieve a document for updateCheck In/Unlock: Submit a document updateVersion History: List all changes to a documentSearch: Retrieve a list of documents that match specified searchcriteriaGet/Set Document Attribute: Get or set attributes for a document

You complete the document management functions using the documentmanagement system user interface.

Page 385: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 5

Document Management

Copyright Oracle Corporation, 2000. All rights reserved.®

Document ManagementDocument Management

Attached Document

Document can be viewed online

Document Management IntegrationThe Notification Details web page displays document references asdefined by document-type attributes. This provides you direct access to aspecified document through the document management interface layerusing a browser session. This interface layer allows you to attachdocuments to notification responses.For users viewing e-mail notifications, the notification mailer fetches thedocument contents and attaches them to the e-mail notification.The following WF_ENGINE package APIs support documentmanagement integration:

SetItemAttrDocument()

ItemStatus()

GetItemAttrDocument()

Before you can use document management integration, you need to definea node for the document management system in the Document Nodespage.

Page 386: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 6

Defining Document Management Repositories

Copyright Oracle Corporation, 2000. All rights reserved.®

Defining Document ManagementRepositories

Defining Document ManagementRepositories

• Seamless open integration• Communications through a web server agent

interface

• Seamless open integration• Communications through a web server agent

interface

Defining Document Management RepositoriesOracle Workflow provides seamless open integration with variousthird-party document management (DM) systems. These systemsare still to be announced.Oracle Workflow communicates with these DM systems through aweb server agent interface.To register the DM system with Oracle Workflow, use the OracleWorkflow Document Nodes web page to identify the DM systemas a document node.

Page 387: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 7

Document Management Integration in Notifications

Copyright Oracle Corporation, 2000. All rights reserved.®

Document Management Integration inNotifications

Document Management Integration inNotifications

• To access a referenced DM document in a specificnotification, view it from the Notification Detailsweb page and select the document link.

• To respond to a notification by attaching adocument, select the paper clip icon whichappears next to the field that requires a documentresponse.

• To access a referenced DM document in a specificnotification, view it from the Notification Detailsweb page and select the document link.

• To respond to a notification by attaching adocument, select the paper clip icon whichappears next to the field that requires a documentresponse.

Page 388: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 8

Accessing a DM Document Sent by a Notification

Copyright Oracle Corporation, 2000. All rights reserved.®

Accessing a DM Document Sent by aNotification

Accessing a DM Document Sent by aNotification

• When you view a notification from the NotificationDetails web page, the body of the message mayinclude a reference link to a DM document. Thislink allows access to the DM system.

• Click on the link to display a DM integration screenin a new browser window.

• The screen displays a Launch Document toolbarand the content of the referenced DM document.The toolbar buttons are fixed and representstandard functions regardless of the DM systemyou are integrating with.

• Click on any of the toolbar buttons to perform anyof the standard functions.

• When you view a notification from the NotificationDetails web page, the body of the message mayinclude a reference link to a DM document. Thislink allows access to the DM system.

• Click on the link to display a DM integration screenin a new browser window.

• The screen displays a Launch Document toolbarand the content of the referenced DM document.The toolbar buttons are fixed and representstandard functions regardless of the DM systemyou are integrating with.

• Click on any of the toolbar buttons to perform anyof the standard functions.

Standard Functions Associated with the Oracle Workflow DM Toolbar ButtonsEach function is carried out by the integrated DM system, therefore the actualimplementation of these functions may vary between DM vendors.

Document Name: Displays the name of the referenced documentDisplay: Displays the content of the document in its native format.Fetch: Fetch the contents of the document to your local file system.Check Out: Check out the document from your DM system and fetch onto

your local file system.Check In: Check in a new version of a document into the DM system.Unlock: Remove a lock on the document without checking in a new version

of the document.Show History: Display the history of the information about the referenced

document.Help: Display online help.

Note: For further information on the above functions please see the OracleWorkflow Guide (Release 2.5), chapter 10 Viewing Notifications andProcessing Responses.

Page 389: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 9

Responding to a Notification with a DM Document

Copyright Oracle Corporation, 2000. All rights reserved.®

Responding to a Notification with a DMDocument

Responding to a Notification with a DMDocument

• When you view a notification from the NotificationDetails web page, certain response fields maydisplay paper clip icons. These fields prompt for aDM document as part of the notification response.The paper clip icon provides the direct access tothe DM system.

• Click on the paper clip icon to display a DM screenin a new browser window.

• The screen displays a Launch Document toolbarand the default DM system’s native search screen.The toolbar buttons are fixed and representstandard functions regardless of the DM systemyou are integrating with.

• Click on any of the toolbar buttons to perform anyof the standard functions.

• When you view a notification from the NotificationDetails web page, certain response fields maydisplay paper clip icons. These fields prompt for aDM document as part of the notification response.The paper clip icon provides the direct access tothe DM system.

• Click on the paper clip icon to display a DM screenin a new browser window.

• The screen displays a Launch Document toolbarand the default DM system’s native search screen.The toolbar buttons are fixed and representstandard functions regardless of the DM systemyou are integrating with.

• Click on any of the toolbar buttons to perform anyof the standard functions.

Standard Functions Associated with the Oracle Workflow DM Toolbar ButtonsEach function is carried out by the integrated DM system, therefore the actualimplementation of these functions may vary between DM vendors.

Change Document home: Displays the Change Document Home web page sothat you can choose a different DM node from which to select yourdocument.

Node Name: Displays the name of the current DM node.Search: Search across all authorized documents and optionally across multiple

document versions for a document matching the content or metadatacriteria that you specify.

Create new: Create a new document in the current DM system for a file storedin your local file system.

Browse: Browse for a document by navigating through the DM system folderhierarchy.

Help: Display online help.

Note: For further information on the above functions please see the OracleWorkflow Guide (Release 2.5), chapter 10 Viewing Notifications andProcessing Responses.

Page 390: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Document Management IntegrationChapter 18 - Page 10

Page 391: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 1

Setting Up Oracle WorkflowChapter 19

Page 392: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 2

Setting Up Oracle Workflow

Copyright Oracle Corporation, 2000. All rights reserved.®

Setting Up Oracle WorkflowSetting Up Oracle Workflow

Page 393: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

After this lesson you should be able to:• Define the required setup steps of Oracle

Workflow.• Define the optional setup steps of Oracle

Workflow.• Understand the access protection feature of

Oracle Workflow.• Transfer workflow definitions between a database

and flat file.

After this lesson you should be able to:• Define the required setup steps of Oracle

Workflow.• Define the optional setup steps of Oracle

Workflow.• Understand the access protection feature of

Oracle Workflow.• Transfer workflow definitions between a database

and flat file.

Page 394: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 4

Required Set Up Steps

Copyright Oracle Corporation, 2000. All rights reserved.®

Required Set Up StepsRequired Set Up Steps

BackgroundEngines

Step 6

Step 3

WF_LANGUAGESView

Step 4

Step 1

Global User Preferences

http_proxyEnvironment

Variable

Step 5

Step 2

DirectoryService

WF_RESOURCESEnvironment

Variable

BackgroundWorkflowEngines

Overview of Required Set Up Steps for the Standalone Version of OracleWorkflow

1. Set up the default Oracle Workflow user preferences using the GlobalPreferences Web page.2. Map Oracle Workflow’s directory service to the users and roles currently definedin your organization’s directory repository by constructing views based on those tables.3. Create a view called WF_LANGUAGES that identifies the languages defined inyour Oracle8 installation.4. Define an environment variable called http_proxy if you plan to use theNotification Mailer.5. Define an environment variable called WF_RESOURCES if your Workflowserver is installed on a UNIX platform.6. Set up background Workflow Engines to control the load and throughput of theprimary Workflow Engine.

Page 395: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 5

Step 1 Setting Global User Preferences

Copyright Oracle Corporation, 2000. All rights reserved.®

Step 1Setting Global User Preferences

Step 1Setting Global User Preferences

• Use the Global Preferences web page to:– define the Workflow administrator role and

Workflow web agent.– set default user preference values for the

entire enterprise.• Entries in User Preferences web page override

those defaults set in the Global Preferences webpage.

• Both web pages are accessible from the OracleWorkflow Home page.

• Global Preferences web page only available to theWorkflow administrator role.

• Use the Global Preferences web page to:– define the Workflow administrator role and

Workflow web agent.– set default user preference values for the

entire enterprise.• Entries in User Preferences web page override

those defaults set in the Global Preferences webpage.

• Both web pages are accessible from the OracleWorkflow Home page.

• Global Preferences web page only available to theWorkflow administrator role.

Note:The Language, Territory, and Notification preference settings in the GlobalPreferences and User Preferences web pages are valid only if your directoryservice views map the Language, Territory, and Notification_Preference columnsto the Oracle Workflow preferences table.

Page 396: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 6

Step 2 Setting Up an Oracle Workflow Directory Service

Copyright Oracle Corporation, 2000. All rights reserved.®

Step 2Setting Up an Oracle Workflow Directory

Service

Step 2Setting Up an Oracle Workflow Directory

Service

• offers flexibility in defining who the workflowusers and roles are.

• references any directory repository for users androles information by creating views based on thedatabase tables making up that repository.

• provides local tables that contain columns similarto those defined in the views. These tables areused to store users and roles not included in theexisting directory repository.

• provides predefined Directory Service viewdefinition and verification scripts

• offers flexibility in defining who the workflowusers and roles are.

• references any directory repository for users androles information by creating views based on thedatabase tables making up that repository.

• provides local tables that contain columns similarto those defined in the views. These tables areused to store users and roles not included in theexisting directory repository.

• provides predefined Directory Service viewdefinition and verification scripts

Oracle Workflow :

Oracle Workflow Directory Service ViewsWF_USERSWF_ROLESWF_USER_ROLESOracle Workflow Directory Service Local TablesWF_LOCAL_USERSWF_LOCAL_ROLESWF_LOCAL_USER_ROLESOracle Workflow Directory Service Scripts• wfdirhrv.sql: maps users and roles over a unified Oracle Applications environment• wfdirouv.sql: maps users and roles onto the native users and roles defined in Oracle 8i• wfdircsv.sql: maps users and roles to the Oracle Workflow Local tables.

If you create your own or modify any of the predefined directory service viewdefinitions, run the script wfdirchk.sql to verify your directory service model.

Page 397: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 7

Step 3 Verifying the WF_LANGUAGES View

Copyright Oracle Corporation, 2000. All rights reserved.®

Step 3Verifying the WF_LANGUAGES View

Step 3Verifying the WF_LANGUAGES View

• WF_LANGUAGES view is predefined in OracleWorkflow Directory Services scripts.

• Verify that the view definition identifies thelanguages defined in your Oracle installation.

• Customize the view definition if necessary.• WF_LANGUAGES allows for translation of field

values in the property pages of Oracle WorkflowBuilder and workflow notifications.

• WF_LANGUAGES view is predefined in OracleWorkflow Directory Services scripts.

• Verify that the view definition identifies thelanguages defined in your Oracle installation.

• Customize the view definition if necessary.• WF_LANGUAGES allows for translation of field

values in the property pages of Oracle WorkflowBuilder and workflow notifications.

Mandatory Columns of the WF_LANGUAGES ViewCode - the language code.Display_Name - the display name of the language.NLS_Language - the value of the Oracle NLS_LANGUAGE initialization parameter thatspecifies the default language-dependent behavior of a session.NLS_Territory - the value of the Oracle NLS_TERRITORY initialization parameter thatspecifies the default territory-dependent date and numeric formatting of a session.NLS_Codeset - the character set for the language.Installed_Flag - flag to indicate if the language is installed and available for use.

Note:A sample WF_LANGUAGES view is included in the script of each of the predefineddirectory services that Oracle Workflow provides.

Page 398: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 8

Step 4 Setting the http_proxy Environment Variable

Copyright Oracle Corporation, 2000. All rights reserved.®

Step 4Setting the http_proxy Environment

Variable

Step 4Setting the http_proxy Environment

Variable

• If you are planning to use the Notification Mailer,set up the http_proxy variable to point to yourproxy server before starting the Oracle WorkflowDatabase or the Notification Mailer. Only requiredif you plan to attach URL content that existsoutside your organization firewall.

• For example, in UNIX, use the following commandto set the http_proxy variable:

setenv http_proxy “http://www-proxy.yourcompany.com:80/”

• If you are planning to use the Notification Mailer,set up the http_proxy variable to point to yourproxy server before starting the Oracle WorkflowDatabase or the Notification Mailer. Only requiredif you plan to attach URL content that existsoutside your organization firewall.

• For example, in UNIX, use the following commandto set the http_proxy variable:

setenv http_proxy “http://www-proxy.yourcompany.com:80/”

http_proxy Variable UseThe Notification Mailer can fetch the URL content of a URL attribute, if the attribute hasAttach Content checked in its Attribute property page. If the referenced URL is outsideyour organization’s firewall, the Notification Mailer must go through your organization’sproxy server to fetch the URL content.

Page 399: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 9

Step 5 Setting the WF_RESOURCES EnvironmentVariable

Copyright Oracle Corporation, 2000. All rights reserved.®

Step 5Setting the WF_RESOURCES

Environment Variable

Step 5Setting the WF_RESOURCES

Environment Variable

• If you are using the standalone version of OracleWorkflow and the Workflow server is installed on aUNIX platform, set the WF_RESOURCESenvironment variable.

• This environment variable points to the language-dependent Oracle Workflow resource filewf<language>.res.

• The resource file is generally found in the ressubdirectory of the Oracle Workflow serverdirectory structure.

• If you are using the standalone version of OracleWorkflow and the Workflow server is installed on aUNIX platform, set the WF_RESOURCESenvironment variable.

• This environment variable points to the language-dependent Oracle Workflow resource filewf<language>.res.

• The resource file is generally found in the ressubdirectory of the Oracle Workflow serverdirectory structure.

Page 400: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 10

Step 6 Setting Up Background Workflow Engines

Copyright Oracle Corporation, 2000. All rights reserved.®

Step 6Setting Up Background Workflow

Engines

Step 6Setting Up Background Workflow

Engines• Background engines are set up to handle costly

‘deferred’ activities allowing the Workflow Engineto continue to the next available activity.

• Background engines are also set up to handletimed out notifications.

• You can define and start up as many backgroundengines as you like.

• A background engine runs until it completes alleligible activities.

• You should set the background engine up to runperiodically.

• Background engines are set up to handle costly‘deferred’ activities allowing the Workflow Engineto continue to the next available activity.

• Background engines are also set up to handletimed out notifications.

• You can define and start up as many backgroundengines as you like.

• A background engine runs until it completes alleligible activities.

• You should set the background engine up to runperiodically.

To Start a Background EngineIf you are using the standalone version of Oracle Workflow, then use theWF_ENGINE.BACKGROUND( ) API to start up a background engine. Sample scriptsthat repeatedly run the background engine are provided with the standalone version ofOracle Workflow.If you are using the version of Oracle Workflow embedded in Oracle Applications, start abackground engine by submitting the Background Process concurrent program using theSubmit Requests form.Note:Make sure you have a least one background engine that can check for timed out activitiesand one that can process deferred activities. At a minimum, you need to set up onebackground engine that can handle both timed out and deferred activities.

Page 401: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 11

Optional Setup Steps

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Setup StepsOptional Setup Steps

Step 4

Step 3

Step 5

Step 2

NotificationMailer

MessageTemplates

Workflow WebPage Logo

CustomIcons

Step 1Document

ManagementRepositories

Overview of Optional Generic Setup Steps1. Define a node for the document management system in the Document Nodes webpage if you will be integrating a certified DM system with Oracle Workflow.2. Set up the Notification Mailer program if users are to receive notifications byemail.3. Modify the templates for your electronic mail notifications.4. Customize the company logo that appears in the Oracle Workflow’s web pages.5. Include additional icons in your Oracle Workflow Icons subdirectory tocustomize the diagrammatic representation of your workflow processes.

Page 402: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 12

Optional Step 1 Document Management Repositories

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 1Document Management Repositories

Optional Step 1Document Management Repositories

• Oracle Workflow communicates with specific DMsystems through a web server agent interface. Thesyntax for identifying the DM systems web serveris <protocol>://<server:port>/.

• If you plan to use DM system integration, you mustregister the DM system with Oracle Workflow byusing the Document Nodes web page to identifythe DM system as a document node.

• Oracle Workflow uses the document node as thegateway to a specific DM system and uses theinformation defined in the node to construct theURLs that display the DM system documents.

• Oracle Workflow communicates with specific DMsystems through a web server agent interface. Thesyntax for identifying the DM systems web serveris <protocol>://<server:port>/.

• If you plan to use DM system integration, you mustregister the DM system with Oracle Workflow byusing the Document Nodes web page to identifythe DM system as a document node.

• Oracle Workflow uses the document node as thegateway to a specific DM system and uses theinformation defined in the node to construct theURLs that display the DM system documents.

Page 403: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 13

Optional Step 2 Notification Mailer

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 2Notification MailerOptional Step 2

Notification Mailer• Implement the Notification Mailer if users are to

receive notifications by e-mail as well as from theNotifications Worklist web page.

• The Notification Mailer is a program that performsemail send and response processing for theOracle Workflow Notification System.

• The Notification Mailer also processes responsesby interpreting the text of messages mailed to itsresponse account and calling the appropriateNotification API to complete the notification.

• Once set up, the Notification Mailer continuallypolls for messages to send and checks forresponses to process.

• Implement the Notification Mailer if users are toreceive notifications by e-mail as well as from theNotifications Worklist web page.

• The Notification Mailer is a program that performsemail send and response processing for theOracle Workflow Notification System.

• The Notification Mailer also processes responsesby interpreting the text of messages mailed to itsresponse account and calling the appropriateNotification API to complete the notification.

• Once set up, the Notification Mailer continuallypolls for messages to send and checks forresponses to process.

Full MIME SupportOracle Workflow fully supports Multi-purpose Internet Mail Extensions (MIME)encoded messages. This means that the Notification Mailer can exchange messages withworkflow users containing languages with different character sets and multimediaencoded content.Notification PreferencesOracle Workflow allows you to determine how you view notifications by setting anotification preference in the User Preferences web page.There are five types of notification preferences:

• MAILTEXTplain text mail: The notification message appears as plain textwith no attachments.

• MAILHTMLHTML mail: The notification message appears as HTML-formatted text with at least one other attachment that is a link to the notificationin the Notifications Web page.

• MAILATTHplain text mail with HTML attachments: The notification messageappears as plain text with at least two other attachments. One being an HTML-formatted version of the message, the other being the link to the notification inthe Notifications Web page.

• SUMMARYplain text summary mail: The message is a plain text summary ofall open notifications.

• QUERYdo not send me mail: The Notification Mailer does not send you emailnotifications.

Page 404: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 14

Optional Step 2 Notification Mailer Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 2Notification Mailer Overview

Optional Step 2Notification Mailer Overview

Notifications

Oracle server

Advanced Queues

OracleInternet

Messaging

SMTP

MAPI

Oracle Workflow Notification Mailer

HTMLPlain text

VariousMail

Applications

Netscape Lotus Notes MS Exchange Unix Sendmail Others

Notification Mailer FeaturesThe Notification Mailer sends e-mail and processes responses for the Oracle WorkflowNotifications System. The Notification Mailer:• Polls the database for messages to send.• Resolves the e-mail address of the recipient role, which itself can be a mail distributionlist.• Switches its database session to be the preferred language of the role and territorysetting.• Selects information from the database as defined by the attributes of the message.• Generates the message using a message template.• Sends the message via UNIX Sendmail, Oracle Internet Messaging, or a MAPI-compliant mail application.• Processes responses returned and calls the appropriate Notification API to complete thenotification activity.• Notification Mailer remains running unless a database failure occurs or the PL/SQLpackage state changes for the session.

Note:For the standalone version of Oracle Workflow, create and run a perpetual shell scriptthat restarts the Notification Mailer, should it shutdown. Example: UNIX shell scriptwfmail.csh located in the Oracle Workflow server bin subdirectory.

Page 405: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 15

Optional Step 2 continued Notification Mailer

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 2 continuedNotification Mailer

Optional Step 2 continuedNotification Mailer

• You can set up the Notification Mailer to runagainst UNIX SendMail, Oracle Internet Messaging4.2, or a MAPI-compliant mail application onWindows NT.

• Set up at least one mail account dedicated to theNotification Mailer processing in one of these mailapplications.

• Define three folders/files in the mail account forresponse processing.

• Use the sample configuration file, wfmail.cfg, tocreate a configuration file of Notification Mailerinput arguments.

• You can set up the Notification Mailer to runagainst UNIX SendMail, Oracle Internet Messaging4.2, or a MAPI-compliant mail application onWindows NT.

• Set up at least one mail account dedicated to theNotification Mailer processing in one of these mailapplications.

• Define three folders/files in the mail account forresponse processing.

• Use the sample configuration file, wfmail.cfg, tocreate a configuration file of Notification Mailerinput arguments.

Page 406: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 16

Optional Step 2 continued Running the NotificationMailer

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 2 continuedRunning the Notification Mailer

Optional Step 2 continuedRunning the Notification Mailer

For the standalone version of Oracle Workflow, runthe Notification Mailer using one of the followingoperating system commands:• Integrating with Oracle Internet Messaging:

– wfmail.ofc -f <config_file>

• Integrating with UNIX Sendmail:– wfmail.snd -f <config_file>

• Integrating with MAPI-compliant applications:– wfmlr20.exe -f <config_file>

• Replace <config_file> with the path and nameof the configuration file.

For the standalone version of Oracle Workflow, runthe Notification Mailer using one of the followingoperating system commands:• Integrating with Oracle Internet Messaging:

– wfmail.ofc -f <config_file>

• Integrating with UNIX Sendmail:– wfmail.snd -f <config_file>

• Integrating with MAPI-compliant applications:– wfmlr20.exe -f <config_file>

• Replace <config_file> with the path and nameof the configuration file.

Location of the Notification MailerThe Oracle Internet Messaging and UNIX Sendmail Notification Mailer executablesreside on your server in the $ORACLE_HOME/bin subdirectory.The MAPI-compliant Notification Mailer executable resides on your Windows NT PC in<drive>:\<ORACLE_HOME>\bin subdirectory.

Page 407: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 17

Optional Step 2 continued Running the NotificationMailer

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 2 continuedRunning the Notification Mailer

Optional Step 2 continuedRunning the Notification Mailer

To run the Notification Mailer for Oracle Workflowembedded in Oracle Applications:

• Integrating with UNIX Sendmail or Oracle InternetMessaging, submit the Notification Mailerconcurrent program from the Submit Requestform. You can also run the concurrent programfrom the command line:– WFMAIL apps/pwd 0 Y FILE <config_file>

• Integrating with MAPI-compliant mail applications,install the Notification Mailer on Windows NT andrun:– wfmlr20.exe -f <config_file>

• Replace <config_file> with the path and name ofthe configuration file.

To run the Notification Mailer for Oracle Workflowembedded in Oracle Applications:

• Integrating with UNIX Sendmail or Oracle InternetMessaging, submit the Notification Mailerconcurrent program from the Submit Requestform. You can also run the concurrent programfrom the command line:– WFMAIL apps/pwd 0 Y FILE <config_file>

• Integrating with MAPI-compliant mail applications,install the Notification Mailer on Windows NT andrun:– wfmlr20.exe -f <config_file>

• Replace <config_file> with the path and name ofthe configuration file.

Notification Mailer Concurrent Program• By default the concurrent program links to the Sendmail version of the mailer program,but can be relinked to the Oracle Internet Messaging version.• Your system administrator needs to add the Notification Mailer concurrent program toa request security group for the responsibility that you want to run the program from.

Notification Mailer Configuration File• In the Submit Requests Parameters window, enter the path and filename of theconfiguration file.• The configuration file lists the parameters you want to run with the program and musthave the following format:

#Description

PARAMETER1=value1

#Description

PARAMETER2=value2

. . .

Page 408: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 18

Optional Step 2 continued Notification MailerArguments

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 2 continuedNotification Mailer Arguments

Optional Step 2 continuedNotification Mailer Arguments

• CONNECT (required)• ACCOUNT (required)• NODE (required)• FROM• SUMMARYONLY (required)• DIRECT_RESPONSE• AUTOCLOSE_FYI• ALLOW_FORWARDED_RESPONSE• IDLE• LOG• SHUTDOWN

• CONNECT (required)• ACCOUNT (required)• NODE (required)• FROM• SUMMARYONLY (required)• DIRECT_RESPONSE• AUTOCLOSE_FYI• ALLOW_FORWARDED_RESPONSE• IDLE• LOG• SHUTDOWN

Notification Mailer Argument Definitions• CONNECT:<username/password>@<db> to connect to the Workflow databaseaccount.• ACCOUNT: <username/password> to connect to the mail account.• NODE: Identifier for current Notification Mailer.• FROM: Value that appears in the From: field of notifications.• SUMMARYONLY: Y or N to send notification summaries.• DIRECT_RESPONSE: Y or N to implement direct response processing fornotifications sent to roles with MAILTEXT or MAILATTH only.• AUTOCLOSE_FYI: Y or N to automatically close notifications that do not require aresponse after sending the notification by e-mail.• ALLOW_FORWARDED_RESPONSE: Y or N to allow a user to respond to an e-mailnotification that has been forwarded (using e-mail) from another role.• IDLE: Seconds to wait between checks.• LOG: Name of log file.• SHUTDOWN: Filename that cues program to shut down.

Page 409: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 19

Optional Step 2 continued Notification MailerArguments

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 2 continuedNotification Mailer Arguments

Optional Step 2 continuedNotification Mailer Arguments

• FAILCOMMAND• DEBUG• TEST_ADDRESS• REPLYTO• HTMLAGENT• HTMLDESC• HTMLTYPE• DISCARD• PROCESS• UNPROCESS• TAGFILE

• FAILCOMMAND• DEBUG• TEST_ADDRESS• REPLYTO• HTMLAGENT• HTMLDESC• HTMLTYPE• DISCARD• PROCESS• UNPROCESS• TAGFILE

Notification Mailer Argument Definitions (continued)• FAILCOMMAND: Command to run if program encounters error.• DEBUG: Y or N to print debugging information in log.• TEST_ADDRESS: Test e-mail address to send all outgoing e-mail notifications.• REPLYTO: E-mail address to reply to.• HTMLAGENT: Path that identifies the HTML Web agent that handles HTMLresponses.• HTMLDESC: Description of the default attachment used by Oracle InternetMessaging.• HTMLTYPE: HTML attachment type number used by Oracle Internet Messaging.• DISCARD: Name of mail folder/file for discarded incoming mail.• PROCESS: Name of mail folder/file for processed responses.• UNPROCESS: Name of mail folder/file for responses awaiting processing.• TAGFILE: File that lists strings found in unusual messages and the statuses to assignto those messages. For example, tag file entries might include:

– ERROR "-- Unsent message follows --"– UNAVAIL "Returned mail:"– IGNORE "POSTMASTER"

Page 410: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 20

Optional Step 3 Message Templates

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 3Message Templates

Optional Step 3Message Templates

Messages sent by the Notification Mailer arecomposed using one of six templates defined in theSystem: Mailer item type. This item type is defined inthe wfmail.wft workflow definition file.• Copy wfmail.wft and store in your source

controlled file system.• Open your file copy of the System: Mailer item

type in your Workflow Builder.• Select one of the message templates.• Display the property sheet for the message.• Edit the Subject or Body of the message.

Messages sent by the Notification Mailer arecomposed using one of six templates defined in theSystem: Mailer item type. This item type is defined inthe wfmail.wft workflow definition file.• Copy wfmail.wft and store in your source

controlled file system.• Open your file copy of the System: Mailer item

type in your Workflow Builder.• Select one of the message templates.• Display the property sheet for the message.• Edit the Subject or Body of the message.

Mail Templates• Open Mail: For notifications that require a response.• Open FYI Mail: For notifications that do not require a response.• Canceled Mail: Informs recipient that a notification is cancelled.• Invalid Mail: Informs recipient that the response to the notification is invalid.• Closed Mail: Informs recipient that a previously sent notification is now closed.• Summary Mail: For notification summaries.• Warning Mail: Informs recipient of unsolicited mail that he/she sent

Page 411: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 21

Optional Step 3 continued Message Templates

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 3 continuedMessage Templates

Optional Step 3 continuedMessage Templates

• Do not add, delete, or modify any attributes in theSystem: Mailer item type.

• Verify your edits using File -> Verify and Save.• Source control your edited version of the System:

Mailer item type.• Load your System: Mailer item type to your

database using the Workflow Loader program orthe Workflow Builder Save As menu option.

• Test use of your modified templates using the testaccount capability of the Notification Mailer.

•• Do not add, delete, or modify any attributes in theDo not add, delete, or modify any attributes in theSystem: Mailer item type.System: Mailer item type.

•• Verify your edits using File -> Verify and Save.Verify your edits using File -> Verify and Save.•• Source control your edited version of the System:Source control your edited version of the System:

Mailer item type.Mailer item type.•• Load your System: Mailer item type to yourLoad your System: Mailer item type to your

database using the Workflow Loader program ordatabase using the Workflow Loader program orthe Workflow Builder Save As menu option.the Workflow Builder Save As menu option.

•• Test use of your modified templates using the testTest use of your modified templates using the testaccount capability of the Notification Mailer.account capability of the Notification Mailer.

Note:Always use flat file data stores (.wft files) for edits rather than editing directly against adatabase datastore. Source control your workflow definitions.

Page 412: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 22

Optional Step 4 Workflow Web Page Logo

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 4Workflow Web Page Logo

Optional Step 4Workflow Web Page Logo

• Once the web server is installed and set up, youcan customize the company logo that appears onOracle Workflow’s web pages.

• Create your company logo file in gif format andsave as filename WFLOGO.gif.

• Move WFLOGO.gif to the physical directoryassociated with your web server’s /OA_MEDIA/virtual directory.

• Once the web server is installed and set up, youcan customize the company logo that appears onOracle Workflow’s web pages.

• Create your company logo file in gif format andsave as filename WFLOGO.gif.

• Move WFLOGO.gif to the physical directoryassociated with your web server’s /OA_MEDIA/virtual directory.

Page 413: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 23

Optional Step 5 Custom Icons

Copyright Oracle Corporation, 2000. All rights reserved.®

Optional Step 5Custom Icons

Optional Step 5Custom Icons

• Oracle Workflow provides a variety of icons thatyou can use with your activities and processes.You can add additional icon files as long as theyare of the appropriate format.

• Create custom icon files and convert to gif files.• Oracle Workflow Builder looks for Windows icon

files (.ico) in the Icon subdirectory of the OracleWorkflow area on your PC.

• Oracle Workflow Monitor and web pages look forgif files (.gif) in/OA_MEDIA/oracle/apps/fnd/wf/iconswhere /OA_MEDIA/ is a virtual directory mappingdefined in your web server.

• Oracle Workflow provides a variety of icons thatyou can use with your activities and processes.You can add additional icon files as long as theyare of the appropriate format.

• Create custom icon files and convert to gif files.• Oracle Workflow Builder looks for Windows icon

files (.ico) in the Icon subdirectory of the OracleWorkflow area on your PC.

• Oracle Workflow Monitor and web pages look forgif files (.gif) in/OA_MEDIA/oracle/apps/fnd/wf/iconswhere /OA_MEDIA/ is a virtual directory mappingdefined in your web server.

Adding Custom Icons to Oracle Workflow• Convert the icon files (.ico) to gif format (.gif)• Copy the .gif files to a directory where Workflow Monitor can access them:

– /OA_JAVA/oracle/apps/fnd/wf/iconsNote: /OA_JAVA/ is a virtual directory mapping defined in your Web server whenOracle Workflow is installed.

Page 414: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 24

Oracle Workflow Access Protection

Copyright Oracle Corporation, 2000. All rights reserved.®

Oracle Workflow Access ProtectionOracle Workflow Access Protection

Oracle Workflow Access Protection:• Allows a “customer” of a workflow definition to

modify objects to meet their needs.• Prevents a “customer” of a workflow definition

from modifying “seed data” objects.• Preserves legitimate customizations of workflow

objects during a workflow definition upgrade.

Oracle Workflow Access Protection:Oracle Workflow Access Protection:•• Allows a “customer” of a workflow definition toAllows a “customer” of a workflow definition to

modify objects to meet their needs.modify objects to meet their needs.•• Prevents a “customer” of a workflow definitionPrevents a “customer” of a workflow definition

from modifying “seed data” objects.from modifying “seed data” objects.•• Preserves legitimate customizations of workflowPreserves legitimate customizations of workflow

objects during a workflow definition upgrade.objects during a workflow definition upgrade.

Access ProtectionUse access protection to allow or discourage your customers from modifying your “seeddata” workflow definitions, yet preserve valid customizations during a workflowdefinition upgrade.All workflow objects except lookup codes, function attributes, and message attributescontain an Access tab in their property pages. Lookup codes, function attributes, andmessage attributes “inherit” their access settings from their “parent” lookup type,function, or message, respectively.The Access tab lets you define whether:

• Future customizations to the object are preserved during a workflow definitionupgrade.

• The object can be edited by users operating at a higher access level.

Page 415: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 25

Access Levels

Copyright Oracle Corporation, 2000. All rights reserved.®

Access LevelsAccess Levels

• Each user of Oracle Workflow Builder operates thesystem at a certain access level.

• The access levels are defined as follows:– 0-9—reserved for Oracle Workflow– 10-19—reserved for Oracle Application Object

Library– 20-99—reserved for Oracle Applications– 100-999—reserved for customer organizations– 1000—Public

• Each user of Oracle Workflow Builder operates thesystem at a certain access level.

• The access levels are defined as follows:– 0-9—reserved for Oracle Workflow– 10-19—reserved for Oracle Application Object

Library– 20-99—reserved for Oracle Applications– 100-999—reserved for customer organizations– 1000—Public

Protection LevelIf you protect an object from customization, you effectively assign the object a protectionlevel equal to your current access level.

• Objects protected against customizations are considered “seed data.”• Only users operating at an access level equal or lower than the protection level of

the object can modify the object.• Users operating at an access level greater than the protection level of the object

will see a small lock on the icon for the object in the navigator tree indicating thatthe object is read-only.

Customization Level• If you set an object to be customizable, its protection level is set to 1000.• The customization level of an object is set to the access level of the initial user

who customizes the object.• A customized object is locked from further modification except from users with

access levels equal to the customization level of the object.• The customization level is relevant only with respect to unprotected workflow

objects.• If an object is protected at a certain level, it shouldn’t be modified at all except

by an access level equal to or less than the protected level of the object.

Page 416: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 26

Setting Access Level

Copyright Oracle Corporation, 2000. All rights reserved.®

Setting Access LevelSetting Access Level

Access Level defaults to 100 when Oracle WorkflowBuilder is installed.Your access level can be modified from the Helpmenu in the “About Oracle Workflow Builder” dialogbox.• Enter an integer value in the Access Level field and

click OK.• Your access level setting will be maintained by the

Workflow Builder.

Access Level defaults to 100 when Oracle WorkflowAccess Level defaults to 100 when Oracle WorkflowBuilder is installed.Builder is installed.Your access level can be modified from the HelpYour access level can be modified from the Helpmenu in the “About Oracle Workflow Builder” dialogmenu in the “About Oracle Workflow Builder” dialogbox.box.•• Enter an integer value in the Access Level field andEnter an integer value in the Access Level field and

click OK.click OK.•• Your access level setting will be maintained by theYour access level setting will be maintained by the

Workflow Builder.Workflow Builder.

Oracle Workflow Client InstallationIf you previously installed Oracle Workflow Builder on a PC and you change your accesslevel to a value other than 100, reinstalling Oracle Workflow Builder will not modify theaccess level at which you previously operated.“Allow modifications of customized objects” Checkbox

• Checked: Workflow Builder saves your edits, overwriting protected objects youhave access to modify as well as any previously customized objects (equivalent toWorkflow Definitions Loader Upload mode).

• Unchecked: Workflow Builder saves edits only to protected objects that youhave access to change and does not overwrite previously customized objects(equivalent to Workflow Definitions Loader Upgrade mode).

Page 417: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 27

Setting Access, Protection, and Customization Levels

Copyright Oracle Corporation, 2000. All rights reserved.®

Setting Access, Protection, andCustomization Levels

Setting Access, Protection, andCustomization Levels

Access Properties PageSelect the Access tab to display the Access property page.

• Use the Options region to set the protection/customization level of an object.– Preserve Customizations: Prevents customized objects from being

overwritten during a workflow definition upgrade.– Lock at this Access Level: Protects the object at the current access level

and does not allow the object to be customized by higher access levels.• The Levels region shows the Customization, Access, and Protection levels of the

object based on how you set the check boxes in the Options region.• The indicator bar provides a visual range of access levels that can edit the object.

– Black vertical line: Current access level– White range: Cannot edit the object– Solid Green: Can edit the object– Cross-hatch Green: Usually cannot modify the object because it has been

customized, but can now do so because Oracle Workflow Builder is set toUpload mode so that Customized objects can be modified.

Page 418: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 28

Example of Access Protection

Copyright Oracle Corporation, 2000. All rights reserved.®

Example of Access ProtectionExample of Access Protection

Assume you have an access level of 100.Assume you have an access level of 100.

Resulting LevelCustomization = 0

Access = 100Protection = 1000

Customization = 100Access = 100

Protection = 1000

Customization = 0Access = 100

Protection = 100

Customization = 100Access = 100

Protection = 100

Checkbox

None

PreserveCustomizationsLock at thisAccess Level

Both

Edit Range

0-100

100-1000

0-100

100

Protection and Customization LevelsAssuming an access level of 100, these protection and customization levels result whenthe following check boxes are selected in the Options region:

• None: Object can be updated at any time by any access level.• Preserve Customizations: Disallows customized objects from being overwritten

during a workflow upgrade.– Object may be updated by access levels 100-1000.– If the Allow modifications of customized objects check box is selected,

customized objects can also be updated by access levels 0-99 during anupgrade, as represented by red crosshatches in the indicator bar.

• Lock at this Access Level: Protects the object at the current access level and doesnot allow the object to be customized, except by access levels 0-100.

• Both: Object can only be updated by the access level at which the object isprotected.

– Object may only be updated by access level 100.– If the Allow modifications of customized objects check box is selected,

customized objects can also be updated by access levels 0-99 during anupgrade, as represented by red crosshatches in the indicator bar.

Page 419: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 29

Workflow Definitions Loader

Copyright Oracle Corporation, 2000. All rights reserved.®

Workflow Definitions LoaderWorkflow Definitions Loader

• Use the Workflow Definitions Loader to transferworkflow definitions between a flat file and adatabase.

• The loader is a server-executable program that ishandy to use when definitions need to be backedup to a file prior to a database upgrade.

• Workflow definition files are identified by the fileextension .wft.

• Use the Workflow Definitions Loader to transferworkflow definitions between a flat file and adatabase.

• The loader is a server-executable program that ishandy to use when definitions need to be backedup to a file prior to a database upgrade.

• Workflow definition files are identified by the fileextension .wft.

Page 420: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 30

Transferring Workflow Definitions: Oracle WorkflowStandalone

Copyright Oracle Corporation, 2000. All rights reserved.®

Transferring Workflow Definitions:Oracle Workflow Standalone

Transferring Workflow Definitions:Oracle Workflow Standalone

• To upgrade a definition and preservecustomizations using the access level listed in theinput file:wfload -u <username/password@database><input file>

• To upload a new version of a definition using theaccess level listed in the input file:wfload -u <username/password@database><input file>

•• To upgrade a definition and preserveTo upgrade a definition and preservecustomizations using the access level listed in thecustomizations using the access level listed in theinput file:input file:wfload -u <username/password@database><input file>

•• To upload a new version of a definition using theTo upload a new version of a definition using theaccess level listed in the input file:access level listed in the input file:wfload -u <username/password@database><input file>

Page 421: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 31

Transferring Workflow Definitions: Oracle WorkflowStandalone

Copyright Oracle Corporation, 2000. All rights reserved.®

Transferring Workflow Definitions:Oracle Workflow Standalone

Transferring Workflow Definitions:Oracle Workflow Standalone

• To force an upload of a definition regardless of anobject’s protection level:wfload -f <username/password@database><input file>

• To download a definition:wfload [-d <date>]<username/password@database> <output file><item_type1> <item_type2> … <item_typeN>

•• To force an upload of a definition regardless of anTo force an upload of a definition regardless of anobject’s protection level:object’s protection level:wfload -f <username/password@database><input file>

•• To download a definition:To download a definition:wfload [-d <date>]<username/password@database> <output file><item_type1> <item_type2> … <item_typeN>

Downloading a Definition• Download one or more item type definitions.• Replace <item_typeN> with an * to download all item types.• Specify the -d option with a date to download definitions that were effective at aspecific date. Use the format YYYY/MM/DD HH24:MI:SS to specify the effective date.• The access level of the resulting output file is set to the value stored in theWF_ACCESS_LEVEL environment variable.

Page 422: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Setting Up Oracle WorkflowChapter 19 - Page 32

Transferring Workflow Definitions: Oracle Workflowembedded in Oracle Applications

Copyright Oracle Corporation, 2000. All rights reserved.®

Transferring Workflow Definitions:Oracle Workflow embedded in

Oracle Applications

Transferring Workflow Definitions:Oracle Workflow embedded in

Oracle ApplicationsRun the Workflow Definitions Loader concurrentprogram using one of the following modes:• Upgrade: Upgrade to a definition in an input file,

preserving customizations, using access level ininput file.

• Upload: Upload the definition from an input file,overwriting accidental customizations, using thedefault access level.

• Force: Upload a definition from an input fileregardless of access level.

• Download: Download specified item typedefinitions from the database to an output file.

Run the Workflow Definitions Loader concurrentRun the Workflow Definitions Loader concurrentprogram using one of the following modes:program using one of the following modes:•• Upgrade: Upgrade to a definition in an input file,Upgrade: Upgrade to a definition in an input file,

preserving customizations, using access level inpreserving customizations, using access level ininput file.input file.

•• Upload: Upload the definition from an input file,Upload: Upload the definition from an input file,overwriting accidental customizations, using theoverwriting accidental customizations, using thedefault access level.default access level.

•• Force: Upload a definition from an input fileForce: Upload a definition from an input fileregardless of access level.regardless of access level.

•• Download: Download specified item typeDownload: Download specified item typedefinitions from the database to an output file.definitions from the database to an output file.

Page 423: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination ActivitiesChapter 20 - Page 1

Master/Detail CoordinationActivitiesChapter 20

Page 424: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination ActivitiesChapter 20 - Page 2

Master/Detail Coordination Activities

Copyright Oracle Corporation, 2000. All rights reserved.®

Master/Detail Coordination ActivitiesMaster/Detail Coordination Activities

Page 425: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination ActivitiesChapter 20 - Page 3

Objectives

Copyright Oracle Corporation, 2000. All rights reserved.®

ObjectivesObjectives

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

activities.

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

activities.

Page 426: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination ActivitiesChapter 20 - Page 4

Master/Detail Coordination Activities

Copyright Oracle Corporation, 2000. All rights reserved.®

Master/Detail Coordination ActivitiesMaster/Detail Coordination Activities

• Master/Detail coordination activities allow you tocoordinate the flow of master and detailprocesses.

• Spawning a detail process from a master process,in effect, creates a separate detail process with itsown unique item type and item key.

• Master/Detail coordination activities allow you tocoordinate the flow of master and detailprocesses.

• Spawning a detail process from a master process,in effect, creates a separate detail process with itsown unique item type and item key.

Defining the Master/Detail RelationshipThe relationship between two processes is defined by making a call to theWorkflow Engine API SetItemParent after you call theCreateProcess API and before calling the StartProcess API when youcreate the detail process.Two activities are used to coordinate the flow in the master and detail processes.One activity pauses a process and the other signals the halted process tocontinue. One activity is placed in the master process the other in the detailprocess.Each of the activities contains two attributes used to identify the coordinatingactivity in the other process.

Wait for Flow ActivityPlace this activity in a master or detail process to pause the flow until the othercorresponding detail or master process completes a specified activity. Thisactivity calls a PL/SQL procedure WF_STANDARD.WAITFORFLOW.

The Wait for Flow activity contains two attributes:Continuation Flow: Specify whether this activity is waiting for a

corresponding ‘Master’ or ‘Detail’ process to complete.Continuation Activity: Specify the label of the activity node that must

complete in the corresponding process before the current processcontinues. Default value is CONTINUEFLOW.

Page 427: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination ActivitiesChapter 20 - Page 5

Master/Detail Coordination Activities (continued)

Copyright Oracle Corporation, 2000. All rights reserved.®

Master/Detail Coordination Activities(continued)

Master/Detail Coordination Activities(continued)

• Master/Detail coordination activities allow you tocoordinate the flow of master and detailprocesses.

• Spawning a detail process from a master process,in effect, creates a separate detail process with itsown unique item type and item key.

• Master/Detail coordination activities allow you tocoordinate the flow of master and detailprocesses.

• Spawning a detail process from a master process,in effect, creates a separate detail process with itsown unique item type and item key.

Defining the Master/Detail Relationship (continued)Continue Flow ActivityUse this activity to mark the position in the corresponding detail or masterprocess where, upon completion, the halted process is to continue. Thisactivity calls a PL/SQL procedure WF_STANDARD.CONTINUEFLOW.The Continue Flow activity contains two attributes:

Waiting Flow: Specify whether the halted process which is waitingfor this activity to complete is a ‘Master’ or ‘Detail’ flow.Waiting Activity: Specify the label of the activity node in thehalted process that is waiting for this activity to complete.

Page 428: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination ActivitiesChapter 20 - Page 6

Example of Master Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Example of Master ProcessExample of Master Process

Master ProcessIn the master process above, the Start Detail Flows activity initiatesseveral detail processes. The master process then completes Activity 1before it pauses at the Wait for Flow activity. Wait for Flow is defined towait for all its detail processes to complete a Continue Flow activitybefore allowing the master process to transition to Activity 2.

Page 429: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination ActivitiesChapter 20 - Page 7

Example of Detail Process

Copyright Oracle Corporation, 2000. All rights reserved.®

Example of Detail ProcessExample of Detail Process

Detail ProcessWhen a detail process begins it completes Activity A, when it reaches theContinue Flow activity it signals to the Workflow Engine that the masterprocess can now continue from the Wait for Flow activity. The detailprocess itself then transitions to Activity B.

Note: For further information on Master/Detail Coordination Activitiesplease see the Oracle Workflow Guide (Release 2.5), chapter 6 PredefinedWorkflow Activities.

Page 430: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Master/Detail Coordination ActivitiesChapter 20 - Page 8

Page 431: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra PracticesChapter 21 - Page 1

Extra PracticesChapter 21

Page 432: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra PracticesChapter 21 - Page 2

Extra Practices

Copyright Oracle Corporation, 2000. All rights reserved.®

Extra PracticesExtra Practices

Page 433: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra PracticesChapter 21 - Page 3

Extra Practice 1 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Extra Practice 1 OverviewExtra Practice 1 Overview

This practice covers the following topics:• Creating a function or process activity that uses

an activity attribute to control processing

This practice covers the following topics:• Creating a function or process activity that uses

an activity attribute to control processing

Page 434: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra PracticesChapter 21 - Page 4

Extra Practice 2 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Extra Practice 2 OverviewExtra Practice 2 Overview

This practice covers the following topics:• Changing the Vacation Proposal notification into a

“vote” and implementing RUN and TIMEOUTfunction mode logic in the post-notificationfunction– check the Expand Roles checkbox on the

notification activity– with the potential for multiple responses to the

Vacation Proposal, how should the result bedetermined?

– should the SCHEDULE_UPDATE logic bemoved to the post-notification procedure?

This practice covers the following topics:• Changing the Vacation Proposal notification into a

“vote” and implementing RUN and TIMEOUTfunction mode logic in the post-notificationfunction– check the Expand Roles checkbox on the

notification activity– with the potential for multiple responses to the

Vacation Proposal, how should the result bedetermined?

– should the SCHEDULE_UPDATE logic bemoved to the post-notification procedure?

Page 435: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra PracticesChapter 21 - Page 5

Extra Practice 3 Overview

Copyright Oracle Corporation, 2000. All rights reserved.®

Extra Practice 3 OverviewExtra Practice 3 Overview

This practice covers the following topics:• Anticipating customization of a process by end

users– build in customization points for

enhancements such as:– allowing users to self-approve vacation

under certain circumstances– hooking the Vacation Proposal process into

communicating with a time reportingapplication

– featuring Block/Complete Activity orAdvanced Queue integration

This practice covers the following topics:• Anticipating customization of a process by end

users– build in customization points for

enhancements such as:– allowing users to self-approve vacation

under certain circumstances– hooking the Vacation Proposal process into

communicating with a time reportingapplication

– featuring Block/Complete Activity orAdvanced Queue integration

Page 436: Oracle Workflow Student Guide

Copyright © Oracle Corporation, 2000. All rights reserved.

Extra PracticesChapter 21 - Page 6