Academia.eduAcademia.edu

D50948

R12 Implement Oracle Workflow y m Volume 3 - Student Guide e d a D49191GC10 Edition 1.0 June 2007 D50948 a r O e l c e l c a r O ly & On l a e n r s e t U n I c A Copyright © 2007, Oracle. All rights reserved. This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract. Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Authors Clara Jaeckel, Melody Yang Technical Contributors and Reviewers Leta Davis, Donna Johnson, Gary Lemmons, Michael Morrison, Georgia Price, Robert Wunderlich This book was published using: a r O e l c oracletutor e d a e l c a r O ly & On l a e n r s e t U n I y m c A Table of Contents Introduction to Oracle Workflow ..................................................................................................................1-1 Introduction to Oracle Workflow ..................................................................................................................1-3 Objectives ......................................................................................................................................................1-4 Enabling E-Business......................................................................................................................................1-5 Inter-Enterprise Business Processes ..............................................................................................................1-6 Traditional Workflow ....................................................................................................................................1-7 Workflow-Driven Business Processes...........................................................................................................1-8 Sample Workflow Process.............................................................................................................................1-10 Event-Based Workflow .................................................................................................................................1-11 Subscription-Based Processing......................................................................................................................1-12 System Integration with Oracle Workflow ....................................................................................................1-13 Business Process-Based Integration ..............................................................................................................1-14 Supported System Integration Types.............................................................................................................1-15 Designing Applications for Change...............................................................................................................1-16 Designing Applications for Integration .........................................................................................................1-19 Oracle Workflow in Oracle E-Business Suite ...............................................................................................1-21 Guided Demonstration - Loading and Running a Workflow Process........................................................1-22 Summary........................................................................................................................................................1-24 Oracle Workflow Components.......................................................................................................................2-1 Oracle Workflow Components ......................................................................................................................2-3 Objectives ......................................................................................................................................................2-4 Oracle Workflow Architecture ......................................................................................................................2-5 Oracle Workflow Components ......................................................................................................................2-9 Workflow Engine ..........................................................................................................................................2-10 Workflow Processes ......................................................................................................................................2-11 Supported Process Constructs........................................................................................................................2-13 Oracle Workflow Builder ..............................................................................................................................2-17 Business Event System Architecture .............................................................................................................2-18 Business Event System Components.............................................................................................................2-19 Advanced Queuing, an Enabling Technology ...............................................................................................2-20 Oracle Database Communication Alternatives..............................................................................................2-21 Accessing Oracle Workflow Web Pages .......................................................................................................2-23 Oracle Workflow Home Pages ......................................................................................................................2-24 Notification System .......................................................................................................................................2-25 Worklist Web Pages ......................................................................................................................................2-26 E-Mail Notifications ......................................................................................................................................2-27 Directory Services .........................................................................................................................................2-28 Status Monitor Web Pages.............................................................................................................................2-29 Workflow Definitions Loader........................................................................................................................2-30 Workflow XML Loader.................................................................................................................................2-31 Workflow Manager........................................................................................................................................2-32 Service Components ......................................................................................................................................2-33 Oracle Workflow Documentation..................................................................................................................2-34 Review Questions ..........................................................................................................................................2-36 Summary........................................................................................................................................................2-37 y m e d a e l c e l c a r O ly & On l a e n r s e t U n I c A Planning a Workflow Process.........................................................................................................................3-1 Planning a Workflow Process........................................................................................................................3-3 Objectives ......................................................................................................................................................3-4 Workflow Process Components ....................................................................................................................3-5 Oracle Workflow Builder ..............................................................................................................................3-7 Standard Activities ........................................................................................................................................3-8 a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents i Planning a Workflow Process........................................................................................................................3-10 Activity Results and Lookup Types...............................................................................................................3-13 Practice - Planning a Workflow Process....................................................................................................3-15 Solution – Planning a Workflow Process ..................................................................................................3-16 Summary........................................................................................................................................................3-17 Diagramming a Workflow Process ................................................................................................................4-1 Diagramming a Workflow Process................................................................................................................4-3 Objectives ......................................................................................................................................................4-4 Creating a New Workflow Process................................................................................................................4-5 Creating a New Process from Top Down ......................................................................................................4-6 Creating a New Process from Bottom Up .....................................................................................................4-7 Diagramming a Process .................................................................................................................................4-8 Quick Start Wizard ........................................................................................................................................4-9 Defining an Item Type...................................................................................................................................4-12 Defining a Process Activity ...........................................................................................................................4-14 Diagramming a Process .................................................................................................................................4-16 Top-Down Design .........................................................................................................................................4-17 Diagramming a Process .................................................................................................................................4-18 <Default> Transition .....................................................................................................................................4-19 <Any> Transition ..........................................................................................................................................4-20 Editing a Transition .......................................................................................................................................4-21 Self-Looping Transitions ...............................................................................................................................4-23 Customizing an Activity Node ......................................................................................................................4-24 Show Label in Designer Menu Options.........................................................................................................4-26 Display Modes...............................................................................................................................................4-27 Verifying a Process Definition ......................................................................................................................4-28 Validation Performed by the Verify Command.............................................................................................4-29 Saving Process Definitions ............................................................................................................................4-31 Practice - Creating a Workflow Process ....................................................................................................4-32 Solution – Creating a Workflow Process...................................................................................................4-33 Summary........................................................................................................................................................4-35 y m e d a c A Defining Item Type Attributes and Lookup Types.......................................................................................5-1 Defining Item Type Attributes and Lookup Types........................................................................................5-3 Objectives ......................................................................................................................................................5-4 Defining Item Type Attributes.......................................................................................................................5-5 Attribute Data Types .....................................................................................................................................5-7 Defining Item Type Attributes.......................................................................................................................5-9 URL Attributes ..............................................................................................................................................5-10 Form Attributes .............................................................................................................................................5-13 Document Attributes......................................................................................................................................5-16 Deleting Item Attributes ................................................................................................................................5-19 Defining Lookup Types.................................................................................................................................5-20 Defining Lookup Codes.................................................................................................................................5-21 Practice - Defining Item Type Attributes...................................................................................................5-22 Solution – Defining Item Type Attributes ................................................................................................5-23 Summary........................................................................................................................................................5-26 e l c a r O ly & On l a e n r s e t U n I Defining Messages and Notification Activities ..............................................................................................6-1 Defining Messages and Notification Activities .............................................................................................6-3 Objectives ......................................................................................................................................................6-4 Notification Activities ...................................................................................................................................6-5 Defining a Message .......................................................................................................................................6-6 Defining a Message Attribute........................................................................................................................6-8 Defining a Respond Attribute........................................................................................................................6-10 Defining a Message Result ............................................................................................................................6-11 Notification Details Web Page ......................................................................................................................6-12 e l c a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents ii HTML E-mail Notifications ..........................................................................................................................6-13 Plain Text E-mail Notifications Using Templated Response ........................................................................6-14 Plain Text E-mail Notifications Using Direct Response ...............................................................................6-15 Practice - Defining Messages ....................................................................................................................6-16 Solution – Defining Messages ..................................................................................................................6-17 Defining a Notification Activity....................................................................................................................6-20 Standard Voting Activity...............................................................................................................................6-22 Defining a Notification Activity Node ..........................................................................................................6-23 Defining a Timeout for a Notification ...........................................................................................................6-24 Defining a Dynamic Priority for a Notification.............................................................................................6-25 Defining a Performer for a Notification ........................................................................................................6-26 Special Message Attributes............................................................................................................................6-27 Action History ...............................................................................................................................................6-34 Special Message Function .............................................................................................................................6-35 Embedding Oracle Application Framework Regions in Notifications ..........................................................6-37 Practice - Defining Notification Activities ................................................................................................6-38 Solution – Defining Notification Activities...............................................................................................6-39 Summary........................................................................................................................................................6-41 Testing and Monitoring Workflow Processes ...............................................................................................7-1 Testing and Monitoring Workflow Processes................................................................................................7-3 Objectives ......................................................................................................................................................7-4 Testing Workflow Processes .........................................................................................................................7-5 Administrator Monitor...................................................................................................................................7-8 Viewing Workflows in the Administrator Monitor .......................................................................................7-10 Viewing Activity History in the Administrator Monitor ...............................................................................7-12 Viewing a Status Diagram in the Administrator Monitor..............................................................................7-13 Viewing Responses in the Administrator Monitor ........................................................................................7-15 Viewing Workflow Details in the Administrator Monitor.............................................................................7-17 Viewing Error Information in the Administrator Monitor.............................................................................7-18 Viewing Child Workflows in the Administrator Monitor .............................................................................7-19 Self-Service Monitor .....................................................................................................................................7-20 Viewing Workflows in the Self-Service Monitor..........................................................................................7-21 Viewing Notification History in the Self-Service Monitor............................................................................7-23 Viewing a Status Diagram in the Self-Service Monitor ................................................................................7-24 Viewing Responses in the Self-Service Monitor ...........................................................................................7-26 Viewing Error Information in the Self-Service Monitor ...............................................................................7-28 Practice - Running a Workflow Process ....................................................................................................7-29 Solution – Running a Workflow Process...................................................................................................7-30 Summary........................................................................................................................................................7-31 y m e d a e l c a r O ly & On l a e n r s e t U n I c A Viewing and Responding to Notifications......................................................................................................8-1 Viewing and Responding to Notifications.....................................................................................................8-3 Objectives ......................................................................................................................................................8-4 Viewing Notifications from a Web Browser .................................................................................................8-5 Worklist Pages...............................................................................................................................................8-6 Advanced Worklist ........................................................................................................................................8-7 Notification Details........................................................................................................................................8-9 Reassigning Notifications..............................................................................................................................8-12 Requesting More Information........................................................................................................................8-14 Certificate-Based Digital Signatures .............................................................................................................8-15 Granting Worklist Access..............................................................................................................................8-17 Administrator Search for Notifications..........................................................................................................8-21 Reviewing Electronic Signature Details ........................................................................................................8-23 Personal Worklist ..........................................................................................................................................8-25 Simple Search for Notifications.....................................................................................................................8-27 Advanced Search for Notifications................................................................................................................8-28 Creating a Personal Worklist View ...............................................................................................................8-30 e l c a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents iii Practice - Responding to Notifications ......................................................................................................8-32 Solution – Responding to Notifications.....................................................................................................8-33 Viewing Notifications Through E-mail .........................................................................................................8-34 E-mail Response Methods .............................................................................................................................8-36 HTML-Formatted E-mail Notifications.........................................................................................................8-37 Plain Text E-mail Notifications Using Templated Response ........................................................................8-39 Plain Text E-mail Notifications Using Direct Response ...............................................................................8-40 Viewing an E-mail Summary of Notifications ..............................................................................................8-41 Vacation Rules...............................................................................................................................................8-42 Maintaining Vacation Rules ..........................................................................................................................8-43 Defining Vacation Rules ...............................................................................................................................8-44 Practice - Modifying A Workflow Process................................................................................................8-47 Solution – Modifying a Workflow Process ...............................................................................................8-49 Summary........................................................................................................................................................8-52 Worklist Flexfields...........................................................................................................................................9-1 Worklist Flexfields ........................................................................................................................................9-3 Objectives ......................................................................................................................................................9-4 Worklist Flexfields ........................................................................................................................................9-5 Benefits of Worklist Flexfields......................................................................................................................9-6 Defining a Specialized Worklist View Using Worklist Flexfields ................................................................9-7 Message Attributes in Worklist Flexfields Rules ..........................................................................................9-8 How Worklist Flexfields Rules Operate........................................................................................................9-9 Phase Numbers ..............................................................................................................................................9-10 Customization Levels ....................................................................................................................................9-11 Core Rules .....................................................................................................................................................9-12 Limit and User Rules.....................................................................................................................................9-14 Combining Core, Limit, and User Rules .......................................................................................................9-17 Worklist Flexfields Rules Example ...............................................................................................................9-18 Defining a Worklist Flexfields Rule: Entering General Properties ...............................................................9-20 Defining a Worklist Flexfields Rule: Selecting Filter Criteria ......................................................................9-22 Defining a Worklist Flexfields Rule: Selecting Message Attributes .............................................................9-23 Defining a Worklist Flexfields Rule: Mapping Attributes to Columns .........................................................9-25 Resolving Conflicts Between Worklist Flexfields Rules...............................................................................9-27 Maintaining Worklist Flexfields Rules..........................................................................................................9-28 Storing Message Attribute Values in Worklist Flexfields Columns..............................................................9-30 Performing a Worklist Flexfields Rule Simulation .......................................................................................9-31 Defining a Securing Function........................................................................................................................9-34 Creating a Personalized View for the Personal Worklist...............................................................................9-35 Restarting Oracle HTTP Server.....................................................................................................................9-37 Practice - Defining a Specialized Worklist View Using Worklist Flexfields ............................................9-38 Solution – Defining a Specialized Worklist View Using Worklist Flexfields...........................................9-41 Summary........................................................................................................................................................9-45 y m e d a e l c a r O ly & On l a e n r s e t U n I c A Oracle Workflow Directory Service...............................................................................................................10-1 Oracle Workflow Directory Service ..............................................................................................................10-3 Objectives ......................................................................................................................................................10-4 Oracle Workflow Directory Service ..............................................................................................................10-5 Predefined Directory Service.........................................................................................................................10-6 Directory Service Views................................................................................................................................10-7 WF_USERS View .........................................................................................................................................10-8 WF_ROLES View.........................................................................................................................................10-11 WF_USER_ROLES View.............................................................................................................................10-13 WF_USER_ROLE_ASSIGNMENTS_V View ............................................................................................10-16 Local Directory Service Tables .....................................................................................................................10-18 Ad Hoc Users and Roles................................................................................................................................10-20 Validating a Directory Service Data Model...................................................................................................10-21 Setting Workflow Preferences.......................................................................................................................10-22 e l c a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents iv Loading Roles................................................................................................................................................10-23 Summary........................................................................................................................................................10-24 Defining Function Activities ...........................................................................................................................11-1 Defining Function Activities .........................................................................................................................11-3 Objectives ......................................................................................................................................................11-4 Function Activities ........................................................................................................................................11-5 Defining a Function Activity .........................................................................................................................11-6 Practice - Defining a Function Activity .....................................................................................................11-8 Solution – Defining a Function Activity....................................................................................................11-10 External Function Activities ..........................................................................................................................11-13 Assigning a Cost to a Function Activity........................................................................................................11-15 Practice - Branching on a Function Activity Result ..................................................................................11-16 Solution – Branching on a Function Activity Result .................................................................................11-18 PL/SQL Procedures for Function Activities ..................................................................................................11-21 Standard API for PL/SQL Procedures Called by Function Activities ...........................................................11-22 Standard API Parameters...............................................................................................................................11-24 Function Activity Execution Modes ..............................................................................................................11-25 Standard API Resultout Parameter ................................................................................................................11-27 Exception Handling .......................................................................................................................................11-28 Exception Handling Example ........................................................................................................................11-29 Defining Activity Details...............................................................................................................................11-30 Error Handling...............................................................................................................................................11-32 Looping .........................................................................................................................................................11-33 Defining an Activity Attribute.......................................................................................................................11-34 Setting Activity Attribute Values ..................................................................................................................11-35 Practice - Using the Standard Assign Activity...........................................................................................11-36 Solution – Using the Standard Assign Activity .........................................................................................11-38 Summary........................................................................................................................................................11-44 y m e d a Workflow Engine.............................................................................................................................................12-1 Workflow Engine ..........................................................................................................................................12-3 Objectives ......................................................................................................................................................12-4 Overview of the Workflow Engine................................................................................................................12-5 Initiating a Workflow Process .......................................................................................................................12-7 Workflow Engine Processing ........................................................................................................................12-9 Activity Statuses ............................................................................................................................................12-12 Calling the Workflow Engine........................................................................................................................12-13 Background Engines......................................................................................................................................12-14 Stuck Processes .............................................................................................................................................12-15 Timed Out Activities .....................................................................................................................................12-16 Deferred Processing.......................................................................................................................................12-17 Oracle Workflow APIs ..................................................................................................................................12-19 Workflow Engine APIs .................................................................................................................................12-21 Workflow Engine Bulk APIs.........................................................................................................................12-28 Practice - Implementing Timeout Processing ............................................................................................12-29 Solution – Implementing Timeout Processing...........................................................................................12-30 Practice - Implementing Deferred Processing ...........................................................................................12-33 Solution – Implementing Deferred Processing ..........................................................................................12-34 Summary........................................................................................................................................................12-36 e l c a r O ly & On l a e n r s e t U n I c A Business Events ................................................................................................................................................13-1 Business Events .............................................................................................................................................13-3 Objectives ......................................................................................................................................................13-4 Business Events .............................................................................................................................................13-5 Event Properties.............................................................................................................................................13-6 Generate Functions ........................................................................................................................................13-8 License Status for Events ..............................................................................................................................13-10 e l c a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents v Defining an Event..........................................................................................................................................13-11 Event Groups .................................................................................................................................................13-12 Defining an Event Group...............................................................................................................................13-13 Maintaining Events........................................................................................................................................13-14 Raising Events ...............................................................................................................................................13-16 Event Message Structure ...............................................................................................................................13-18 Raising an Event Manually............................................................................................................................13-19 Predefined Events ..........................................................................................................................................13-20 Practice - Defining an Event......................................................................................................................13-21 Solution – Defining an Event.....................................................................................................................13-22 Practice - Raising an Event........................................................................................................................13-24 Solution – Raising an Event ......................................................................................................................13-25 Summary........................................................................................................................................................13-27 Event Subscriptions.........................................................................................................................................14-1 Event Subscriptions .......................................................................................................................................14-3 Objectives ......................................................................................................................................................14-4 Event Subscriptions .......................................................................................................................................14-5 Event Manager Subscription Processing .......................................................................................................14-6 Local Event Subscription Processing ............................................................................................................14-7 External Event Subscription Processing ........................................................................................................14-9 Subscription Properties..................................................................................................................................14-10 Subscription Actions......................................................................................................................................14-14 Subscription Actions: Sending an Event to a Workflow Process ..................................................................14-15 Subscription Actions: Sending an Event to an Agent....................................................................................14-17 Subscription Actions: Sending a Notification................................................................................................14-19 Subscription Actions: Sending and Receiving Oracle XML Gateway Messages..........................................14-21 Subscription Actions: Running a Custom Rule Function ..............................................................................14-22 Subscription Properties..................................................................................................................................14-25 License Status for Subscriptions....................................................................................................................14-28 Deferred Subscription Processing..................................................................................................................14-29 PL/SQL and Java Subscription Processing....................................................................................................14-31 Defining a Subscription .................................................................................................................................14-33 Maintaining Subscriptions .............................................................................................................................14-35 Predefined Subscriptions ...............................................................................................................................14-36 Practice - Defining a Subscription .............................................................................................................14-37 Solution – Defining a Subscription............................................................................................................14-39 Summary........................................................................................................................................................14-44 y m e d a e l c a r O ly & On l a e n r s e t U n I c A Systems and Agents .........................................................................................................................................15-1 Systems and Agents.......................................................................................................................................15-3 Objectives ......................................................................................................................................................15-4 Systems..........................................................................................................................................................15-5 System Properties ..........................................................................................................................................15-6 Local System .................................................................................................................................................15-7 External Systems ...........................................................................................................................................15-8 Defining a System .........................................................................................................................................15-9 Maintaining Systems .....................................................................................................................................15-10 Agents............................................................................................................................................................15-12 Standard Agents.............................................................................................................................................15-14 Agent Properties ............................................................................................................................................15-16 Custom Queue Handlers ................................................................................................................................15-21 Agents on External Systems ..........................................................................................................................15-22 Defining an Agent .........................................................................................................................................15-24 Agent Groups.................................................................................................................................................15-26 Defining an Agent Group ..............................................................................................................................15-27 Maintaining Agents .......................................................................................................................................15-28 External System Registration ........................................................................................................................15-29 e l c a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents vi Retrieving System Identifier Information......................................................................................................15-31 Registering Systems ......................................................................................................................................15-33 Review Questions ..........................................................................................................................................15-36 Summary........................................................................................................................................................15-38 Defining Event Activities.................................................................................................................................16-1 Defining Event Activities ..............................................................................................................................16-3 Objectives ......................................................................................................................................................16-4 Event Activities .............................................................................................................................................16-5 Event-Based Workflow Processes .................................................................................................................16-6 Event Activity Actions ..................................................................................................................................16-7 Receive Event Activities ...............................................................................................................................16-8 Receive Event Activities: Event Filter..........................................................................................................16-9 Receive Event Activities: Sending an Event to One Process........................................................................16-10 Receive Event Activities: Sending an Event to Multiple Processes .............................................................16-12 Receive Event Activities: Receiving an Event ..............................................................................................16-13 Raise Event Activities ...................................................................................................................................16-15 Send Event Activities ....................................................................................................................................16-16 Defining an Event Activity............................................................................................................................16-17 Event Details .................................................................................................................................................16-19 Defining Event Details: Receive ...................................................................................................................16-20 Defining Event Details: Raise .......................................................................................................................16-21 Defining Event Details: Send ........................................................................................................................16-23 Example: Order Processing ...........................................................................................................................16-25 Standard Activities ........................................................................................................................................16-26 Practice - Defining Event Activities ..........................................................................................................16-27 Solution – Defining Event Activities.........................................................................................................16-29 Summary........................................................................................................................................................16-38 y m e d a Business Event System APIs ...........................................................................................................................17-1 Business Event System APIs .........................................................................................................................17-3 Objectives ......................................................................................................................................................17-4 Business Event System datatypes ..................................................................................................................17-5 Event Message Structure ...............................................................................................................................17-6 Agent Structure..............................................................................................................................................17-10 Parameter List Structure ................................................................................................................................17-12 Parameter Structure .......................................................................................................................................17-13 Raising Events Programmatically..................................................................................................................17-15 Event Data Generate Functions .....................................................................................................................17-22 Standard API for PL/SQL Event Data Generate Functions...........................................................................17-23 Standard API for Java Event Data Generate Functions .................................................................................17-24 Queue Handlers .............................................................................................................................................17-27 Standard APIs for PL/SQL Queue Handlers .................................................................................................17-28 Standard APIs for Java Queue Handlers........................................................................................................17-29 Subscription Rule Functions..........................................................................................................................17-31 Standard API for PL/SQL Subscription Rule Functions ...............................................................................17-32 Standard API for Java Subscription Rule Functions......................................................................................17-34 Predefined Subscription Rule Functions........................................................................................................17-36 Event APIs.....................................................................................................................................................17-38 Event Function APIs......................................................................................................................................17-40 Adding a Correlation ID to an Event Message ..............................................................................................17-41 Business Event System Cleanup API ............................................................................................................17-43 Summary........................................................................................................................................................17-44 e l c e l c a r O ly & On l a e n r s e t U n I a r O c A Error Handling ................................................................................................................................................18-1 Error Handling...............................................................................................................................................18-3 Objectives ......................................................................................................................................................18-4 Error Handling for Workflow Processes .......................................................................................................18-5 Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents vii Default Error Process.....................................................................................................................................18-7 Retry-only Process.........................................................................................................................................18-9 Error Handling for Subscription Processing ..................................................................................................18-11 Stop and Rollback Error Handling ................................................................................................................18-13 Skip to Next Error Handling..........................................................................................................................18-15 Standard Error Agents ...................................................................................................................................18-17 Error Handling Subscriptions ........................................................................................................................18-18 Warning Conditions in Subscription Processing ...........................................................................................18-19 Unexpected Events ........................................................................................................................................18-20 Default Event Error Process ..........................................................................................................................18-21 Event Warnings .............................................................................................................................................18-22 External Event Errors ....................................................................................................................................18-23 Local Event Errors.........................................................................................................................................18-24 Guided Demonstration - Error Handling ...................................................................................................18-25 Summary........................................................................................................................................................18-26 PL/SQL Documents.........................................................................................................................................19-1 PL/SQL Documents.......................................................................................................................................19-3 Objectives ......................................................................................................................................................19-4 PL/SQL Documents.......................................................................................................................................19-5 Integrating PL/SQL Documents into Workflow Processes ...........................................................................19-6 Including PL/SQL Documents in Messages ..................................................................................................19-8 Standard API for a PL/SQL Document .........................................................................................................19-9 Standard API for a PL/SQL CLOB Document..............................................................................................19-11 Standard API for a PL/SQL BLOB Document..............................................................................................19-13 Practice - Using a PL/SQL Document Attribute........................................................................................19-15 Solution – Using a PL/SQL Document Attribute ......................................................................................19-17 Summary........................................................................................................................................................19-22 y m e d a Post-Notification Functions.............................................................................................................................20-1 Post-Notification Functions ...........................................................................................................................20-3 Objectives ......................................................................................................................................................20-4 PL/SQL Procedures for Notification Activities.............................................................................................20-5 Standard API for PL/SQL Procedures Called by Notification Activities ......................................................20-6 Post-Notification Function Execution Modes................................................................................................20-9 Standard API Resultout Parameter for a Post-Notification Function ............................................................20-11 Post-Notification Function Context Information ...........................................................................................20-12 Practice - Defining a Post-Notification Function.......................................................................................20-13 Solution – Defining a Post-Notification Function .....................................................................................20-15 Exception Handling .......................................................................................................................................20-19 Summary........................................................................................................................................................20-20 e l c a r O ly & On l a e n r s e t U n I c A Forced Synchronous Processing .....................................................................................................................21-1 Forced Synchronous Processing ....................................................................................................................21-3 Objectives ......................................................................................................................................................21-4 Forced Synchronous Processes......................................................................................................................21-5 Process Definition Restrictions......................................................................................................................21-6 Summary........................................................................................................................................................21-9 Selector/Callback Functions ...........................................................................................................................22-1 Selector/Callback Functions ..........................................................................................................................22-3 Objectives ......................................................................................................................................................22-4 Item Type Selector/Callback Functions.........................................................................................................22-5 Defining a Selector/Callback Function for an Item Type ..............................................................................22-6 Standard API for a Selector/Callback Function.............................................................................................22-7 Standard API Parameters...............................................................................................................................22-9 Selector/Callback Function Commands.........................................................................................................22-11 Practice - Defining a Selector Function .....................................................................................................22-13 Solution – Defining a Selector Function....................................................................................................22-15 e l c a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents viii Summary........................................................................................................................................................22-20 Master/Detail Coordination Activities ...........................................................................................................23-1 Master/Detail Coordination Activities...........................................................................................................23-3 Objectives ......................................................................................................................................................23-4 Master/Detail Coordination Activities...........................................................................................................23-5 Wait for Flow Activity ..................................................................................................................................23-9 Continue Flow Activity .................................................................................................................................23-11 Master Process Example................................................................................................................................23-12 Detail Process Example .................................................................................................................................23-13 Continue Flow Processing .............................................................................................................................23-14 Summary........................................................................................................................................................23-15 Customizing Workflow Processes ..................................................................................................................24-1 Customizing Workflow Processes .................................................................................................................24-3 Objectives ......................................................................................................................................................24-4 Customizing Workflow Processes .................................................................................................................24-5 Access Protection ..........................................................................................................................................24-7 Access Levels ................................................................................................................................................24-8 Setting the Access Level................................................................................................................................24-10 Setting Protection and Customization Levels ................................................................................................24-11 Example of Access Protection .......................................................................................................................24-13 Unsupported Customizations.........................................................................................................................24-15 Workflow Definitions Loader........................................................................................................................24-16 Preserving Customizations ............................................................................................................................24-17 Summary........................................................................................................................................................24-18 y m Workflow Loaders...........................................................................................................................................25-1 Workflow Loaders.........................................................................................................................................25-3 Objectives ......................................................................................................................................................25-4 Workflow Definitions Loader........................................................................................................................25-5 Workflow XML Loader.................................................................................................................................25-7 Summary........................................................................................................................................................25-11 e d a c A Specialized Workflow Monitoring .................................................................................................................26-1 Specialized Workflow Monitoring ................................................................................................................26-3 Objectives ......................................................................................................................................................26-4 Assigning Specialized Workflow Monitoring Privileges ..............................................................................26-5 Granting Restricted Access to Workflow Monitoring Data...........................................................................26-7 Granting Restricted Access Based on Item Types .........................................................................................26-8 Granting Restricted Access Based on Functional Criteria.............................................................................26-9 Granting Permissions for Administrative Actions.........................................................................................26-11 Guided Demonstration - Setting Up Specialized Workflow Monitoring...................................................26-12 Summary........................................................................................................................................................26-15 e l c a r O ly & On l a e n r s e t U n I Setting Up Oracle Workflow ..........................................................................................................................27-1 Setting Up Oracle Workflow .........................................................................................................................27-3 Objectives ......................................................................................................................................................27-4 Required Setup Steps.....................................................................................................................................27-5 Step 1 Setting Global Workflow Preferences ................................................................................................27-6 Step 2 Setting Up an Oracle Workflow Directory Service ............................................................................27-9 Step 3 Running Background Engines ............................................................................................................27-13 Step 4 Configuring the Business Event System.............................................................................................27-16 Step 4 Event Message Communication .........................................................................................................27-17 Step 4 Setting Up Database Links and Queues..............................................................................................27-18 Step 4 Checking Database Parameters...........................................................................................................27-19 Step 4 Scheduling Agent Listeners................................................................................................................27-20 Step 4 Scheduling Propagation......................................................................................................................27-23 Guided Demonstration - Scheduling Agent Listeners and Propagation ....................................................27-27 e l c a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents ix Step 4 Synchronizing License Statuses .........................................................................................................27-29 Step 4 Cleaning Up the WF_CONTROL Queue...........................................................................................27-30 Step 4 Tuning Performance ...........................................................................................................................27-31 Step 4 Specifying the BPEL Server...............................................................................................................27-33 Optional Setup Steps .....................................................................................................................................27-34 Optional Step 1 Partitioning Workflow Tables .............................................................................................27-36 Optional Step 2 Setting Up Additional Languages........................................................................................27-38 Optional Step 3 Implementing Notification Mailers .....................................................................................27-40 Optional Step 4 Customizing Message Templates ........................................................................................27-43 Optional Step 5 Adding Worklist Functions to User Responsibilities...........................................................27-46 Optional Step 6 Setting the Notification Reassign Mode ..............................................................................27-48 Optional Step 7 Setting Up Notification Handling Options ..........................................................................27-49 Optional Step 8 Setting Up for Electronic Signatures ...................................................................................27-51 Optional Step 9 Customizing the Workflow Web Page Logo .......................................................................27-53 Optional Step 10 Adding Custom Icons ........................................................................................................27-54 Version Compatibility ...................................................................................................................................27-55 Review Questions ..........................................................................................................................................27-56 Summary........................................................................................................................................................27-58 Managing Service Components ......................................................................................................................28-1 Managing Service Components.....................................................................................................................28-3 Objectives ......................................................................................................................................................28-4 Oracle Workflow Manager ............................................................................................................................28-5 Service Components ......................................................................................................................................28-6 Service Component Containers .....................................................................................................................28-7 Service Component Types.............................................................................................................................28-8 Accessing Service Components in Oracle Workflow Manager.....................................................................28-9 Managing Service Components.....................................................................................................................28-10 Service Component Container Logs ..............................................................................................................28-12 Service Component Startup Modes ...............................................................................................................28-13 Agent Listeners..............................................................................................................................................28-14 Agent Listener Configuration Wizards..........................................................................................................28-17 Notification Mailers.......................................................................................................................................28-20 Outbound Notification Mailer Processing .....................................................................................................28-21 Inbound Notification Mailer Processing........................................................................................................28-23 Notification Mailer Setup ..............................................................................................................................28-25 Connecting to Mail Servers Through SSL.....................................................................................................28-27 Notification Mailer Basic Configuration .......................................................................................................28-28 Notification Mailer Advanced Configuration................................................................................................28-30 Component Details for Notification Mailers .................................................................................................28-37 Notification Mailer Throughput ....................................................................................................................28-39 Guided Demonstration - Service Components ..........................................................................................28-40 Handling Notification Mailer Errors..............................................................................................................28-42 Summary........................................................................................................................................................28-43 y m e d a e l c a r O ly & On l a e n r s e t U n I c A Managing System Status and Throughput ....................................................................................................29-1 Managing System Status and Throughput .....................................................................................................29-3 Objectives ......................................................................................................................................................29-4 Workflow System Status ...............................................................................................................................29-5 Workflow Status in Oracle Applications Manager ........................................................................................29-7 Oracle Workflow Administration ..................................................................................................................29-9 Work Items ....................................................................................................................................................29-10 Oracle Workflow Administration ..................................................................................................................29-15 Purging Workflow Data.................................................................................................................................29-16 Completed Work Items..................................................................................................................................29-21 Workflow Purge APIs ...................................................................................................................................29-24 Oracle Workflow Administration ..................................................................................................................29-25 Background Engines......................................................................................................................................29-26 e l c a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents x Oracle Workflow Administration ..................................................................................................................29-29 Control Queue Cleanup .................................................................................................................................29-30 Oracle Workflow Administration ..................................................................................................................29-32 Queue Propagation ........................................................................................................................................29-33 Oracle Workflow Administration ..................................................................................................................29-34 Agent Activity ...............................................................................................................................................29-35 Searching Messages on an Agent ..................................................................................................................29-36 Guided Demonstration - System Status and Throughput...........................................................................29-37 Summary........................................................................................................................................................29-40 Sample Solutions..............................................................................................................................................30-1 Sample Solutions ...........................................................................................................................................30-3 Overview .......................................................................................................................................................30-4 Vacation Proposal Process Sketch.................................................................................................................30-5 wfvacxx.html .................................................................................................................................................30-6 wfvacxxc.sql..................................................................................................................................................30-7 wfvacxxs.sql ..................................................................................................................................................30-9 wfvacxxb.sql..................................................................................................................................................30-14 wfvacxxd.sql..................................................................................................................................................30-28 wfslctxx.sql....................................................................................................................................................30-30 y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents xi c A y m e d a a r O e l c e l c a r O ly & On l a e n r s e t U n I c A Preface Profile Before You Begin This Course • Thorough knowledge of Oracle Database and Oracle Application Server technology • Thorough knowledge of Oracle E-Business Suite Prerequisites • Introduction to Oracle Database: SQL Basics • Oracle Database: Program with PL/SQL How This Course Is Organized R12 Implement Oracle Workflow is an instructor-led course featuring lecture and hands-on exercises. Online demonstrations and written practice sessions reinforce the concepts and skills introduced. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents xiii c A Related Publications Oracle Publications Title Part Number Oracle Workflow Administrator's Guide B31431 Oracle Workflow Developer's Guide B31433 Oracle Workflow User's Guide B31432 Oracle Workflow API Reference B31434 Oracle Workflow Client Installation Guide B31435 Oracle Workflow Documentation Resources, Release 12 OracleMetaLink note 396314.1 Additional Publications • System release bulletins • Installation and user’s guides • Read-me files • International Oracle User’s Group (IOUG) articles • Oracle Magazine e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents xiv y m c A e d a Typographic Conventions Typographic Conventions in Text Convention Bold italic Caps and lowercase Courier new, case sensitive (default is lowercase) Initial cap Element Glossary term (if there is a glossary) Buttons, check boxes, triggers, windows Code output, directory names, filenames, passwords, pathnames, URLs, user input, usernames Arrow Brackets Commas Graphics labels (unless the term is a proper noun) Emphasized words and phrases, titles of books and courses, variables Interface elements with long names that have only initial caps; lesson and chapter titles in crossreferences SQL column names, commands, functions, schemas, table names Menu paths Key names Key sequences Plus signs Key combinations Italic Quotation marks Uppercase e l c Example The algorithm inserts the new key. Click the Executable button. Select the Can’t Delete Card check box. Assign a When-Validate-Item trigger to the ORD block. Open the Master Schedule window. Code output: debug.set (‘I”, 300); Directory: bin (DOS), $FMHOME (UNIX) Filename: Locate the init.ora file. Password: User tiger as your password. Pathname: Open c:\my_docs\projects URL: Go to http://www.oracle.com User input: Enter 300 Username: Log on as scott Customer address (but Oracle Payables) y m Do not save changes to the database. For further information, see Oracle7 Server SQL Language Reference Manual. Enter [email protected], where user_id is the name of the user. Select “Include a reusable module component” and click Finish. e d a e l c a r O ly & On l a e n r s e t U n I c A This subject is covered in Unit II, Lesson 3, “Working with Objects.” Use the SELECT command to view information stored in the LAST_NAME column of the EMP table. Select File > Save. Press [Enter]. Press and release keys one at a time: [Alternate], [F], [D] Press and hold these keys simultaneously: [Ctrl]+[Alt]+[Del] a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents xv Typographic Conventions in Code Convention Caps and lowercase Lowercase Element Oracle Forms triggers Column names, table names Example When-Validate-Item Passwords DROP USER scott IDENTIFIED BY tiger; OG_ACTIVATE_LAYER (OG_GET_LAYER (‘prod_pie_layer’)) SELECT last_name FROM s_emp; PL/SQL objects Lowercase italic Uppercase CREATE ROLE role Syntax variables SQL commands and SELECT userid FROM emp; functions Typographic Conventions in Oracle Application Navigation Paths This course uses simplified navigation paths, such as the following example, to direct you through Oracle Applications. (N) Invoice > Entry > Invoice Batches Summary (M) Query > Find (B) Approve This simplified path translates to the following: e d a c A 1. (N) From the Navigator window, select Invoice then Entry then Invoice Batches Summary. 2. (M) From the menu, select Query then Find. 3. (B) Click the Approve button. Notations: e l c a r O ly & On l a e n r s e t U n I (N) = Navigator (M) = Menu (T) = Tab (B) = Button e l c (I) = Icon a r O (H) = Hyperlink (ST) = Sub Tab Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents xvi y m Typographical Conventions in Oracle Application Help System Paths This course uses a “navigation path” convention to represent actions you perform to find pertinent information in the Oracle Applications Help System. The following help navigation path, for example— (Help) General Ledger > Journals > Enter Journals —represents the following sequence of actions: 1. In the navigation frame of the help system window, expand the General Ledger entry. 2. Under the General Ledger entry, expand Journals. 3. Under Journals, select Enter Journals. 4. Review the Enter Journals topic that appears in the document frame of the help system window. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents xvii c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle Corporation, 2007. All rights reserved. R12 Implement Oracle Workflow Table of Contents xviii c A Forced Synchronous Processing y m Chapter 21 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 2 c A Forced Synchronous Processing y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 3 c A Objectives y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 4 c A Forced Synchronous Processes y m e d a e l c a r O ly & On l a e n r s e t U n I c A Forced Synchronous Processing To create a forced synchronous process, you must set the item key of your process to #SYNCH, or to wf_engine.eng_synch, which returns the #SYNCH constant when you call the necessary WF_ENGINE APIs. Because a forced synchronous process never writes to the database, it’s not a problem to use a non-unique item key such as #SYNCH. Also, because a forced synchronous process never writes workflow information to the database, a forced synchronous process completes faster than a normal synchronous process. However, for the same reason, you cannot view the process from the Status Monitor and no auditing is available for the process. Note: Although the Workflow Engine does not write workflow information to the database during a forced synchronous process, you can still use custom function activities that write to database tables as part of a forced synchronous process. e l c a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 5 Process Definition Restrictions y m e d a e l c a r O ly & On l a e n r s e t U n I c A Process Definition Restrictions • No notification activities are allowed. • Limited blocking-type activities are allowed. A process can block and restart with a call to WF_ENGINE.CompleteActivity only if the blocking and restarting activities: - Occur in the same database session - Contain no intervening calls to Oracle Workflow - Contain no intervening commits • No error processes can be assigned to the process or the process’s activities. • Each function activity behaves as if On Revisit is set to Loop and is executed in noncanceling mode, regardless of its actual On Revisit setting. Loops are allowed in the process. • No master/detail coordination activities are allowed. • No parallel flows are allowed in the process because transitions from each activity must have a distinct result. This also means that no <Any> transitions are allowed because they cause parallel flows. e l c a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 6 Process Definition Restrictions y m e d a e l c a r O ly & On l a e n r s e t U n I c A Process Definition Restrictions • None of the following Standard activities is allowed: - And - Block (restricted by the conditions stated for limited blocking) - Defer Thread - Wait - Continue Flow/Wait for Flow - Role Resolution - Voting - Compare Execution Time - Notify • No use of the background engine is allowed; that is, activities are never deferred. • No data is ever written to the Oracle Workflow tables, and as a result: - The process cannot be viewed from the Status Monitor. - No auditing is available for the process. e l c a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 7 Process Definition Restrictions y m e d a e l c a r O ly & On l a e n r s e t U n I c A Process Definition Restrictions • Only the following WF_ENGINE API calls are allowed to be made, and in all cases, the item key supplied to these APIs must be specified as #SYNCH or wf_engine.eng_synch: - WF_ENGINE.CreateProcess - WF_ENGINE.StartProcess - WF_ENGINE.GetItemAttribute - WF_ENGINE.SetItemAttribute - WF_ENGINE.GetActivityAttribute - WF_ENGINE.CompleteActivity (for the limited usage of blocking-type activities) • WF_ENGINE API calls for any item except the current synchronous item are not allowed. e l c a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 8 Summary y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 9 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Forced Synchronous Processing Chapter 21 - Page 10 c A Selector/Callback Functions y m Chapter 22 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 2 c A Selector/Callback Functions y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 3 c A Objectives y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 4 c A Item Type Selector/Callback Functions y m e d a e l c a r O ly & On l a e n r s e t U n I c A Item Type Selector/Callback Functions A selector function is a PL/SQL procedure that automatically identifies the specific process definition to run when a workflow is initiated for a particular item type, but when no process name is provided. If your item type has more than one runnable process activity associated with it, define a PL/SQL selector function that determines which process activity to run in a particular situation. For example, you may have two different requisition approval process activities associated with the same item type. The process that Oracle Workflow runs varies depending on how and where the requisition originates. Your selector function determines which process is appropriate in any given situation. This functionality gives you more flexibility at run time to determine dynamically which process to run. You can also extend the selector function to be a general callback function so that you can reset item type context information as needed if the SQL session is interrupted during the execution of a process. e l c a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 5 Defining a Selector/Callback Function for an Item Type y m e d a e l c a r O ly & On l a e n r s e t U n I Defining a Selector/Callback Function for an Item Type For example, the WFDEMO item type has a selector function named WF_REQDEMO.SELECTOR. e l c a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 6 c A Standard API for a Selector/Callback Function y m e d a e l c a r O ly & On l a e n r s e t U n I Standard API for a Selector/Callback Function c A procedure <procedure name>( itemtype in varchar2, itemkey in varchar2, actid in number, command in varchar2, resultout out varchar2) is <local declarations> begin if (command = ‘RUN’) then <your RUN executable statements> resultout:=‘<Name of process to run>’; return; endif; if (command = ‘SET_CTX’) then <your executable statements for establishing context information> resultout:=‘ ‘; return; endif; e l c a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 7 if (command = ‘TEST_CTX’) then <your executable statements for testing validity of current context information> resultout:=‘<TRUE or FALSE or NOTSET>’; return; endif; if (command = ‘<other commands>’) then resultout:=‘ ‘; return; endif; exception when others then WF_CORE.CONTEXT (‘<package name>’, ‘<procedure name>’, <itemtype>, <itemkey>, to_char(<actid>), <command>); raise; end <procedure name>; y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 8 c A Standard API Parameters y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 9 c A Standard API Parameters y m e d a e l c a r O ly & On l a e n r s e t U n I c A Standard API Parameters The different commands for a selector/callback function require different return values. • If the function is called with the RUN command, the name of the process to run must be returned through the resultout parameter. • If the function is called with the TEST_CTX command, then the code must return TRUE if the context is correct, FALSE if the context is incorrect, or NOTSET if the context has not been initialized yet. • If the function is called with the SET_CTX command, then no return value is expected. e l c a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 10 Selector/Callback Function Commands y m e d a e l c a r O ly & On l a e n r s e t U n I c A Selector/Callback Function Commands Use the TEST_CTX command when you want to check that the user context is correct before permitting processing to start on a workflow process. Use this mode to check that the organization is correctly set in a multi-organization environment. • If the function returns the result value TRUE in TEST_CTX mode when the workflow is being processed by a background engine, this result indicates that the application context is set correctly, and the Workflow Engine keeps the current context. • If the function returns the result value NOTSET in TEST_CTX mode, then the Workflow Engine executes the function again in SET_CTX mode to set the context. • If the function returns the result value FALSE in TEST_CTX mode, and the Workflow Engine permits context switching at this point in its processing, then the Workflow Engine executes the function again in SET_CTX mode to set the correct context. However, if the result value is FALSE, but the Workflow Engine requires the current context to be preserved, the Workflow Engine defers the activity to be processed by a background engine instead. Use the SET_CTX mode to set up all your PL/SQL variables. In this way, you can ensure that PL/SQL variables are always set for asynchronous processes when you restart these processes. e l c a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 11 For example, you can use this mode to set a bind variable so that specific views are correct, or to set global variables. If you are developing a custom process, you should use this mode to set your organization context. Note: Oracle Workflow also uses the TEST_CTX mode to determine whether a form can be launched with the current item type context information just before the Notification Details Web page launches a reference form. When you view a notification from the Notification Details Web page and attempt to launch a form that is associated with the notification, Oracle Workflow calls the selector/callback function for your item type in TEST_CTX mode to test the context before turning the form launch over to the Oracle Application Object Library function security system. In TEST_CTX mode, the selector/callback function can perform whatever logic is necessary to determine whether it is appropriate to launch the form. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 12 c A Practice - Defining a Selector Function Overview In this practice, you will define a selector function to determine which process to run in the Vacation Proposal item type that you created in the Creating a Workflow Process practice. Note: Because many students access the system and create objects during this course, you need a way to distinguish between the objects created by you and by your classmates. Therefore, you will be assigned a terminal number by your instructor. Use this number as a prefix wherever you see XX included in the name of something that you are defining. In this way, you can ensure that the definitions you create are unique. Note: In order to use the sample solution scripts provided for these practices, you must enter the internal names for all objects that you define exactly as shown in the instructions. Otherwise, you must modify the sample code to reference the object names that you define. Assumptions • You must have access to an Oracle Applications Vision database, or a comparable training or test instance at your site on which to complete this practice. • The instructor will provide you with the connect string for the class database and the user name and password of the Oracle Workflow database account. • The instructor will provide you with the user name and password of a user with workflow administrator privileges. The workflow administrator is defined on the Workflow Configuration page. • The instructor will provide you with the URL for the login page and the name of a Workflow administrator responsibility. The user name that you use to log in should have this responsibility assigned to it. • The instructor will provide you with the names of users that you can assign as the requestor and approver in the Vacation Proposal process. These user names should have Workflow administrator and user responsibilities assigned to them. y m e d a Tasks e l c a r O ly & On l a e n r s e t U n I c A Defining an Additional Process e l c Define a new process within the Vacation Proposal item type that you created in the Creating a Workflow Process practice. a r O Assigning a Selector Function Assign a selector function to the Vacation Proposal item type. Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 13 Defining a Selector Function Define the PL/SQL procedure for the selector function that determines which process to run in the Vacation Proposal item type. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 14 c A Solution – Defining a Selector Function Defining an Additional Process 1. Start the Oracle Workflow Builder. 2. From the File menu, select Open to open the wfvacXX.wft data store you defined in the Creating a Workflow Process practice. 3. In the navigator tree, select and expand your WFVACXX item type. 4. In the navigator tree, drag and drop the Vacation Proposal process onto the WFVACXX item type to create a copy of the process. The property pages for the copied process open automatically so that you can enter new internal and display names for the new process. − Internal Name: WFVACXX_ALTERNATE_PROCESS − Display Name: XX Alternate Vacation Proposal 5. Open the process diagram window for the Alternate Vacation Proposal process. 6. Delete the Loop Counter node. The transitions to and from the node are automatically deleted as well. 7. Create a timeout transition from the Vacation Proposal notification back to itself. To do so, right-click the Vacation Proposal node and hold down the right mouse button. Drag the cursor away from the notification and then back to the notification, and then release the right mouse button. Select <Timeout> from the transition results menu. e d a Assigning a Selector Function e l c a r O ly & On l a e n r s e t U n I c A 8. In the navigator tree, select your item type. 9. Open the property pages for the item type. In the Selector field, enter WFVACXX.SELECTOR as the selector function for the item type. 10. In the Navigator window, click the Verify button to verify your workflow. 11. From the File menu, select Save to save your work to your workflow definition file. e l c y m a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 15 12. From the File menu, select Save As and save your item type to the class database, using the database user name, password, and connect string provided by the instructor. y m 13. Close the data store. Defining a Selector Function e d a 14. Your selector function will be a PL/SQL procedure named SELECTOR. You can either use the sample SELECTOR procedure provided in the sample WFVACXX package specification and body scripts, or you can delete the sample SELECTOR procedure from the sample scripts and practice writing your own new PL/SQL procedure instead. • e l c a r O ly & On l a e n r s e t U n I c A The sample scripts are named wfvacxxs.sql and wfvacxxb.sql, respectively. They contain all the sample PL/SQL procedures for all practices in this course. The procedure specific to this practice is WFVACXX.SELECTOR. Open a copy of each sample file and replace all instances of XX with your own terminal number. Save the files and rename them by replacing xx with your terminal number. Note: If you have already copied and edited the complete sample package specification and body scripts containing all the sample procedures for all practices, you do not need to repeat these steps. • If you plan to use the sample WFVACXX.SELECTOR procedure provided in the sample scripts, skip to step 17. • If you want to practice writing your own new PL/SQL procedure, delete the sample WFVACXX.SELECTOR procedure from the scripts and continue to step 15. e l c a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 16 15. In the WFVACXX package, create a new procedure named SELECTOR that determines which process to run in the Vacation Proposal item type. Use the standard Selector Function API for the SELECTOR procedure. procedure <procedure_name> (itemtype in varchar2, itemkey in varchar2, actid in number, command in varchar2, resultout in out varchar2) 16. In the SELECTOR procedure, include logic for the RUN command. • Evaluate the value passed in the item key. • If the uppercase value of the first four characters is CNTR, set resultout to ‘WFVACXX_PROCESS’ (the internal name of the process with the Loop Counter timeout implementation). • If the uppercase value of the first four characters is SELF, set resultout to ‘WFVACXX_ALTERNATE_PROCESS’ (the internal name of the process with the selflooping timeout implementation). • If the uppercase value of the first four characters is neither CNTR nor SELF, either raise an error or set resultout to the internal name for one of the processes as the default process. • Save your scripts. y m e d a c A Note: This example is contrived for class purposes only and does not reflect a practical implementation of selector function logic. The selector function is generally expected to use the item key as the primary key to retrieve supporting application data. That application data would then be used to determine which process is appropriate to run. e l c a r O ly & On l a e n r s e t U n I Note: It is not possible to use the value of an item attribute in the selector function, because at the time the selector function is called by the Workflow Engine, the item attributes for the work item have not yet been created. 17. Log in to SQL*Plus using the database user name, password, and connect string provided by the instructor. Run the package specification and package body scripts in that order by entering the following commands from the directory where the scripts are located: @wfvacxxs e l c @wfvacxxb a r O Alternatively, you can run the scripts from the default prompt if you include the directory path for the scripts in the commands. For example, if your scripts are located in the E:\Labs folder, then enter the following commands: Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 17 @E:\Labs\wfvacxxs @E:\Labs\wfvacxxb Note: If you have already run the complete sample package specification and body scripts containing all the sample procedures for all practices, and you did not make any changes to the scripts for this practice, you do not need to repeat this step. 18. Use SQL*Plus to launch your workflow process and test your work. First, launch a work item with an item key that begins with CNTR. Do not specify the process to run within the item type, so that the Workflow Engine will run the selector function for the item type to determine which process to run. The Workflow Engine will run the selector function only if the process parameter is not passed in the call to create the new work item. Next, launch a work item with an item key that begins with SELF. Again, do not specify the process to run within the item type. Finally, launch a work item with an item key that begins neither with CNTR nor with SELF. For example, use an item key that begins with TEST. Again, do not specify the process to run within the item type. Note: The selector function provided in the sample solution package raises an error if the item key begins neither with CNTR nor with SELF, so if you are using the sample solution, the expected behavior when you attempt to launch the process in this case is an ORA20002: Invalid itemkey error message. y m e d a You can use the sample work item launch script to launch these three work items all at once. • • c A Copy and edit the sample work item launch script named wfslctxx.sql. Open a copy of the sample file and replace all instances of XX with your own terminal number. Also, replace all instances of <requestor_username> with the user name of the requestor, all instances of <approver_username> with the user name of the approver, all instances of <from_date> with the from date, and all instances of <to_date> with the to date. Then save the file and rename it by replacing xx with your terminal number. e l c a r O ly & On l a e n r s e t U n I Log in to SQL*Plus using the database user name, password, and connect string provided by the instructor. Run the work item launch script by entering the following command from the directory where the script is located: @wfslctxx Alternatively, you can run the script from the default prompt if you include the directory path for the script in the command. For example, if your script is located in the E:\Labs folder, then enter the following command: e l c @E:\Labs\wfslctxx a r O 19. You can use the Worklist Web pages to view the notifications sent by the processes and use the Status Monitor Web pages to review the status of the processes. For each process you Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 18 launched, verify that the expected process was run. The process that was run appears in the following administrator Status Monitor pages: • Activity History, in the Activity and Parent Activity columns • Status Diagram, in the process title and the diagram itself 20. For extra practice, you can optionally create another process within your item type that implements timeout processing in which you transition to a reminder notification when the Vacation Proposal notification times out. Add a timeout loop for the reminder notification as well. Then modify your selector function to run this new process when the upper case value of the first four characters of the item key is RMND, and test your changes. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 19 c A Summary y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Selector/Callback Functions Chapter 22 - Page 20 c A Master/Detail Coordination Activities y m Chapter 23 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 2 c A Master/Detail Coordination Activities y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 3 c A Objectives y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 4 c A Master/Detail Coordination Activities y m e d a e l c a r O ly & On l a e n r s e t U n I c A Master/Detail Coordination Activities When you spawn a detail process from a master process, you are creating a separate process with its own unique item type and item key. You define the master/detail relationship between the two processes by calling the Workflow Engine SetItemParent API after you call the CreateProcess API and before you call the StartProcess API when you create the detail process. Two activities are used to coordinate the flow in the master and detail processes: the Wait for Flow activity and the Continue Flow activity. One activity is placed in the master process; the other is placed in the detail process. Each of the activities contains two attributes used to identify the coordinating activity in the other process. Example The following code sample shows an example of launching a set of detail processes from a master process. This API is the PL/SQL procedure for the Spawn Detail Processes function activity in the Workflow Agent Ping/Acknowledge process. The procedure is named WF_EVENT_PING_PKG.Launch_Processes. procedure LAUNCH_PROCESSES ( ITEMTYPE in varchar2, ITEMKEY in varchar2, e l c a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 5 ACTID in number, FUNCMODE in varchar2, RESULTOUT out varchar2 ) is ----------------------------------------------------------CURSOR c_external_in_agents IS SELECT wfa.name AGENT, wfs.name SYSTEM FROM wf_systems wfs, wf_agents wfa WHERE wfa.name != 'WF_ERROR‘ and wfa.status = 'ENABLED‘ and wfa.direction = 'IN‘ and wfa.system_guid = wfs.guid and upper(wfa.queue_handler) = 'WF_EVENT_QH'; l_eventname l_eventkey l_itemkey l_event_t l_msg l_clob begin varchar2(100); varchar2(240); varchar2(100); wf_event_t; varchar2(32000); clob; e l c a r O ly & On l a e n r s e t U n I c A if (funcmode = 'RUN') then l_eventname := wf_engine.GetActivityAttrText( itemtype => itemtype, itemkey => itemkey, actid => actid, aname => 'EVNTNAME'); e l c for x in c_external_in_agents loop --- For every agent launch detail process -- a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 6 e d a y m l_eventkey := x.agent||'@'||x.system||'@'||itemkey; l_itemkey := l_eventkey; wf_engine.CreateProcess( itemtype => itemtype, itemkey => l_itemkey, process => 'WFDTLPNG'); wf_engine.SetItemAttrText( itemtype => itemtype, itemkey => l_itemkey, aname => 'EVNTNAME', avalue => l_eventname); wf_engine.SetItemAttrText( itemtype => itemtype, itemkey => l_itemkey, aname => 'EVNTKEY', avalue => l_eventkey); e d a y m wf_engine.SetItemAttrText( itemtype => itemtype, itemkey => l_itemkey, aname => 'TOAGENT', avalue => x.agent||'@'||x.system); e l c a r O ly & On l a e n r s e t U n I c A -- Initialize the wf_event_t wf_event_t.initialize(l_event_t); l_event_t.setcorrelationid(l_itemkey); l_msg := '<PING>Test Ping</PING>'; dbms_lob.createtemporary(l_clob, FALSE, DBMS_LOB.CALL); dbms_lob.write(l_clob, length(l_msg), 1 , l_msg); l_event_t.SetEventData(l_clob); wf_engine.SetItemAttrEvent( itemtype => itemtype, itemkey => l_itemkey, name => 'EVNTMSG', event => l_event_t); e l c a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 7 wf_engine.SetItemParent( itemtype => itemtype, itemkey => l_itemkey, parent_itemtype => itemtype, parent_itemkey => itemkey, parent_context => null); wf_engine.StartProcess( itemtype => itemtype, itemkey => l_itemkey); end loop; resultout := wf_engine.eng_completed||':'||wf_engine.eng_null; return; y m elsif (funcmode = 'CANCEL') then null; end if; e l c a r O ly & On l a e n r s e t U n I e d a c A exception when others then WF_CORE.CONTEXT('WF_EVENT_PING_PKG', 'LAUNCH_PROCESSES', ITEMTYPE, ITEMKEY, to_char(ACTID), FUNCMODE); raise; end LAUNCH_PROCESSES; For more information, see Oracle Workflow Developer’s Guide, “Workflow Agent Ping/Acknowledge.” e l c a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 8 Wait for Flow Activity y m e d a e l c a r O ly & On l a e n r s e t U n I c A Wait for Flow Activity The Wait for Flow activity contains two attributes: • Continuation Flow: Specify whether this activity is waiting for a corresponding Master or Detail process to complete. • Continuation Activity: Specify the label of the activity node that must complete in the corresponding process before the current process continues. The default value is CONTINUEFLOW. For more information, see Oracle Workflow Developer’s Guide, “Predefined Workflow Activities.” Using Multiple Wait for Flow Activities You can use multiple Wait for Flow activities in the same workflow process. For example, if a master process launches two different sets of detail processes at different stages, the master process should include a separate Wait for Flow activity node for each set of detail processes. In this case, when you call the WF_ENGINE.SetItemParent API to associate a detail process with the master process, you must specify the parent context as the activity label name for the Wait for Flow activity node that corresponds to this detail process. (If the parent process e l c a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 9 contains only one Wait for Flow activity, however, you can leave the parent context parameter of the WF_ENGINE.SetItemParent API null.) y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 10 c A Continue Flow Activity y m e d a e l c a r O ly & On l a e n r s e t U n I c A Continue Flow Activity The Continue Flow activity contains two attributes: • Waiting Flow: Specify whether the halted process which is waiting for this activity to complete is a Master or Detail flow. • Waiting Activity: Specify the label of the activity node in the halted process that is waiting for this activity to complete. For more information, see Oracle Workflow Developer’s Guide, “Predefined Workflow Activities.” e l c a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 11 Master Process Example y m e d a e l c a r O ly & On l a e n r s e t U n I c A Master Process Example In the master process above, the Start Detail Flows activity initiates several detail processes. The master process then completes Activity 1 before it pauses at the Wait for Flow activity. The Wait for Flow activity is defined to wait for all its detail processes to complete a Continue Flow activity before allowing the master process to transition to Activity 2. e l c a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 12 Detail Process Example y m e d a e l c a r O ly & On l a e n r s e t U n I c A Detail Process Example When a detail process begins, it completes Activity A. When the process reaches the Continue Flow activity, it signals to the Workflow Engine that the master process can now continue from the Wait for Flow activity. The detail process itself then transitions to Activity B. e l c a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 13 Continue Flow Processing y m e d a e l c a r O ly & On l a e n r s e t U n I c A Continue Flow Processing When a Continue Flow activity is executed, the WF_STANDARD.CONTINUEFLOW procedure checks whether the corresponding Wait for Flow activity is associated with any other processes that have not yet completed their Continue Flow activities. If so, the waiting process continues to wait for those other processes. If the Wait for Flow activity is not waiting for any other processes, then the WF_STANDARD.CONTINUEFLOW procedure completes the Wait for Flow activity so that the process that was waiting now continues to the next activity. In the master and detail process example, when a detail process executes its Continue Flow activity, it will check whether the Wait for Flow activity in the master process is still waiting for any other detail processes. If all the other detail processes have already completed, then the master process will proceed to Activity 2. If some of the other detail processes have not completed yet, the master process will continue waiting until these processes are complete. For more information, see Oracle Workflow Developer’s Guide, “Predefined Workflow Activities.” e l c a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 14 Summary y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 15 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Master/Detail Coordination Activities Chapter 23 - Page 16 c A Customizing Workflow Processes y m Chapter 24 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 2 c A Customizing Workflow Processes y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 3 c A Objectives y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 4 c A Customizing Workflow Processes y m e d a e l c a r O ly & On l a e n r s e t U n I c A Customizing Workflow Processes Follow these guidelines when customizing workflow processes provided by an Oracle product: 1. Verify that all setup steps have been completed as documented in the Oracle Workflow Administrator’s Guide and the product-specific user’s guides. 2. Test the unmodified seeded workflow, event, or subscription on a test database, and ensure that it runs successfully with the setup and data specific to your environment. 3. Refer to the product-specific user’s guide and any documentation updates for the specific workflow, event, or subscription of interest. These documentation sources specifically mention what you should not modify. Oracle Support Services will not support modifications to any object that is specifically documented as not modifiable. 4. Gradually build in customizations step-by-step, and test the customized workflow or subscription after each step. 5. When creating PL/SQL procedures, conform to the standard PL/SQL API templates documented in the Oracle Workflow Developer’s Guide. Be sure to handle exceptions in the event of an error so that you can track down the procedure where the error has occurred. e l c a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 5 6. Do not implement the customized workflow, event, or subscription in production without fully ensuring that it works successfully on a test database that is a replica of your production setup. Modifying workflow processes, events, and subscriptions can fundamentally change the behavior of the applications that use them, so you should thoroughly test your changes before deploying them in production. The following types of customizations are supported: 1. Oracle supports any customization that is stated as required in the seeded workflow’s product-specific user’s guide or documentation update. 2. Oracle supports customization examples documented in the product-specific user’s guide or documentation update. Any issues that arise are fully supported to resolution, to the extent that the customization example was followed as documented. Any deviation from what is documented amounts to a custom development issue that needs further evaluation. See number 3 below. 3. Customizations that are not explicitly stated as unsupported customizations, as required customizations, or as supported customization examples are supported to the extent that the customer must first isolate the problem following the customization guidelines listed above. If upon evaluation, Oracle Support Services deems that the isolated problem stems from an Oracle product, Oracle will supply a solution. Otherwise, it is the responsibility of the customer to correct the custom development issue. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 6 c A Access Protection y m e d a e l c a r O ly & On l a e n r s e t U n I c A Access Protection As a workflow developer, you can use access protection to enable or discourage “customers” of your workflows from modifying your “seed data” workflow definitions. As a customer of predefined workflows provided by Oracle, you can use access protection to preserve valid customizations that you have made to a predefined workflow during a workflow definition upgrade. All workflow objects except lookup codes, function attributes, and message attributes contain an Access tab on their property pages. Lookup codes, function attributes, and message attributes inherit their access settings from their parent lookup type, function, or message, respectively. The Access tab lets you define the following properties: • Whether future customizations to the object are preserved during a workflow definition upgrade. • Whether the object can be edited by users operating at a higher access level. e l c a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 7 Access Levels y m e d a e l c a r O ly & On l a e n r s e t U n I c A Access Levels Protection Levels • If you protect an object against customization, you effectively assign the object a protection level equal to your current access level. • Objects protected against customizations are considered “seed data.” • Only users operating at an access level equal to or lower than the protection level of the object can modify the object. • Users operating at an access level greater than the protection level of the object will see a small lock on the icon for the object in the navigator tree, indicating that the object is readonly. Customization Levels • 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. e l c a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 8 • The customization level is relevant only with respect to unprotected workflow objects. • If an object is protected at a certain level, it should not be modified at all except by an access level equal to or less than the protected level of the object. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 9 c A Setting the Access Level y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting Access Levels You can view your access level in the About Oracle Workflow Builder dialog box available from the Help menu. The Allow Modifications of Customized Objects check box also appears in the About Oracle Workflow Builder dialog box. Usually you do not need to change this setting. • Selected: The Workflow Builder saves edits only to protected objects that you have access to change and does not overwrite previously customized objects (equivalent to Workflow Definitions Loader Upgrade mode). This option is recommended. • Checked: The Workflow Builder saves your edits, overwriting protected objects that you have access to modify, as well as any previously customized objects (equivalent to Workflow Definitions Loader Upload mode). e l c a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 10 Setting Protection and Customization Levels y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting Protection and Customization Levels • The indicator bar provides a visual range of access levels that can edit the object: - Black vertical line: Current access level. - White range: Cannot edit the object. - Solid green: Can edit the object. - Cross-hatch green: Usually cannot modify the object because it has been customized, but can now do so because Oracle Workflow Builder is set to Allow Modifications of Customized Objects mode so that you can modify customized objects. • 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. • Use the Options region to set the protection and customization levels of an object: - Preserve Customizations: Prevents you from overwriting customized objects during a workflow definition upgrade. - Lock at this Access Level: Protects the object at the current access level and does not allow higher access levels to customize the object. e l c a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 11 • Oracle E-Business Suite customers should select both the Preserve Customizations and Lock at this Access Level check boxes to protect your workflow objects during upgrades. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 12 c A Example of Access Protection y m e d a e l c a r O ly & On l a e n r s e t U n I c A Protection and Customization Levels Assuming an access level of 100, these protection and customization levels result when the following check boxes are selected in the Access properties region: • None: Any access level can update an object at any time. • Preserve Customizations: Prohibits anyone from overwriting customized objects during a workflow upgrade. - Access levels 100-1000 can update an object. - If the Allow modifications of customized objects check box is selected, access levels 0-99 (as represented by green crosshatches in the indicator bar) can also update customized objects. • Lock at this Access Level: Protects the object at the current access level and allows only access levels 0-100 to customize the object. • Both: Only the access level at which the object is protected can update the object. • Only access level 100 can update the object. e l c a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 13 - If the Allow Modifications of Customized Objects check box is selected, access levels 0-99 (as represented by green crosshatches in the indicator bar) can update customized objects. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 14 c A Unsupported Customizations y m e d a e l c a r O ly & On l a e n r s e t U n I c A Unsupported Customizations Oracle does not support the following types of customizations: • Oracle does not support customizations that are explicitly documented as being unsupported in the seeded workflow’s product-specific user’s guide or documentation update notes. These customizations include modifying processes, attributes, function activities, event activities, notifications, lookup types, messages, events, or subscriptions that are specifically documented as not to be modified. • Oracle does not support manual modifications of Workflow tables with a prefix of WF_ or FND_ , unless these modifications are documented in the Oracle Workflow guides or required by Oracle Support Services. e l c a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 15 Workflow Definitions Loader y m e d a e l c a r O ly & On l a e n r s e t U n I c A Workflow Definitions Loader You can run the Workflow Definitions Loader in the following modes: • Upgrade: Upgrade to a definition in an input file, preserving customizations and using the access level in the input file. This mode is recommended. • Upload: Upload the definition from an input file, ignoring preserve customizations settings and using the access level in the input file. • Force: Force the upload of a definition from an input file to a database regardless of an object's protection level. • Download: Download specified item type definitions from the database to an output file. Oracle E-Business Suite customers should always operate the Oracle Workflow Builder and Workflow Definitions Loader at an access level of 100. e l c a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 16 Preserving Customizations y m e d a e l c a r O ly & On l a e n r s e t U n I c A Preserving Customizations During an Oracle Workflow seed data upgrade, the Workflow Definitions Loader is always run in Upgrade mode at an access level less than 100. As a result, the upgrade will not overwrite any object with a customization level of 100 or higher. e l c a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 17 Summary y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Customizing Workflow Processes Chapter 24 - Page 18 c A Workflow Loaders y m Chapter 25 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 2 c A Workflow Loaders y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 3 c A Objectives y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 4 c A Workflow Definitions Loader y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 5 c A Workflow Definitions Loader y m e d a e l c a r O ly & On l a e n r s e t U n I c A Workflow Definitions Loader Specify one of the following modes: • Upgrade: Upgrade to a definition in an input file, preserving customizations, using the access level in the input file. This mode is recommended. • Upload: Upload the definition from an input file, ignoring preserve customizations settings and using the access level in the input file. This mode is useful to someone who is developing a workflow process on a test system. It enables the developer to save definitions to the database without concern that accidental customizations to existing objects might prevent the upload of some process definition elements. • Force: Force the upload of a definition from an input file to a database regardless of an object's protection level. This mode is useful for fixing data integrity problems in a database with a known, reliable file backup. • Download: Download the specified item type definition from the database to an output file. e l c a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 6 Workflow XML Loader y m e d a e l c a r O ly & On l a e n r s e t U n I c A Workflow XML Loader When you download Business Event System object definitions from a database, Oracle Workflow saves the definitions as an XML file. When you upload object definitions to a database, Oracle Workflow loads the definitions from the source XML file into the Business Event System tables in the database, creating new definitions or updating existing definitions as necessary. e l c a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 7 Workflow XML Loader y m e d a e l c a r O ly & On l a e n r s e t U n I c A Workflow XML Loader To run the Workflow XML Loader, you must have Java Development Kit (JDK) Version 5.0 installed. For detailed information on the commands to run the Workflow XML Loader, see Oracle Workflow Administrator’s Guide, “Setting Up Oracle Workflow.” e l c a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 8 Workflow XML Loader y m e d a e l c a r O ly & On l a e n r s e t U n I c A Workflow XML Loader You can download Business Event System object definitions in either normal download mode or exact download mode: • Normal download mode: Saves a generic copy of object definitions from one system that you can use to create similar definitions in other systems. In normal download mode, the Workflow XML Loader replaces certain system-specific data within the object definitions with tokens. Select normal download mode, for example, when you want to save Business Event System object definitions from a development system as seed data that you can upload to a production system. • Exact download mode: Saves object definitions exactly as they are specified in the database. In exact download mode, the Workflow XML Loader does not convert any data to tokens; instead, all values, including system-specific values, are copied to the XML file. Select exact download mode, for example, when you want to save Business Event System object definitions from one production system so that you can replicate them to another production system that communicates with the first. You can upload Business Event System object definitions in either normal upload mode or force upload mode: e l c a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 9 • Normal upload mode: Loads the object definitions from the source XML file into the Business Event System tables in the database, but does not update any event or subscription definition with a customization level of User. Oracle Workflow uses this mode to preserve your customizations during upgrades. • Force upload mode: Loads the object definitions from the source XML file into the Business Event System tables in the database and overwrites any existing definitions, even for events or subscriptions with a customization level of User. Use this mode when you want to update the definitions for your own custom events and subscriptions. Note: To report more extensive debugging information in the program output, you can run the Workflow XML Loader in debug mode by including the DebugMode argument just before the -d, -de, -u, or -uf option. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 10 c A Summary y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 11 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Workflow Loaders Chapter 25 - Page 12 c A Specialized Workflow Monitoring y m Chapter 26 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 2 c A Specialized Workflow Monitoring y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 3 c A Objectives y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 4 c A Assigning Specialized Workflow Monitoring Privileges y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 5 c A Assigning Specialized Workflow Monitoring Privileges y m e d a e l c a r O ly & On l a e n r s e t U n I c A Assigning Specialized Workflow Monitoring Privileges Users cannot perform any actions on workflows that they own themselves, irrespective of any permissions granted to them. Only users with full workflow administrator privileges assigned in the Workflow Configuration page can perform administrative actions on workflows that they own themselves. If a user has full workflow administrator privileges assigned on the Workflow Configuration page, then those privileges override any specialized workflow monitoring privileges assigned to that user. That is, a user with full workflow administrator privileges can access all workflows, irrespective of any restrictions defined for any specialized privileges. e l c a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 6 Granting Restricted Access to Workflow Monitoring Data y m e d a e l c a r O ly & On l a e n r s e t U n I c A Granting Restricted Access to Workflow Monitoring Data Grants based on functional criteria depend on item attribute values. Consequently, these grants are most effective when combined with grants for item types that share the same item attributes. e l c a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 7 Granting Restricted Access Based on Item Types y m e d a e l c a r O ly & On l a e n r s e t U n I c A Granting Restricted Access Based on Item Types The following excerpt shows a sample predicate for an instance set on the object WORKFLOW_ITEMS. &TABLE_ALIAS.ITEM_TYPE = &GRANT_ALIAS.PARAMETER1 To create a grant, first specify appropriate security context information such as grantee and responsibility. Then specify the following data context information: • Object: WORKFLOW_ITEMS • Data Context Type: Instance Set • Instance Set: The instance set that you created on WORKFLOW_ITEMS • PARAMETER1: The internal name of the item type to which you want to grant access • Permission Set: Business workflow item permission set For more information about creating instance sets and grants, see: Defining Data Security Policies, Oracle Applications System Administrator's Guide - Security and Assigning Permissions to Roles, Oracle Applications System Administrator's Guide - Security. e l c a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 8 Granting Restricted Access Based on Functional Criteria y m e d a e l c a r O ly & On l a e n r s e t U n I c A Granting Restricted Access Based on Functional Criteria The following excerpt shows a sample predicate for an instance set on the object WORKFLOW_ITEM_ATTR_VALUES, defining criteria for HR data using the CURRENT_PERSON_ID item attribute. &TABLE_ALIAS.NAME='CURRENT_PERSON_ID' and EXISTS (SELECT 'Y' FROM per_people_f WHERE person_id = &TABLE_ALIAS.TEXT_VALUE AND TRUNC (SYSDATE) BETWEEN effective_start_date AND effective_end_date) As another example, if the workflows for a particular organization are marked with an item attribute named ORG_ID, the following excerpt shows a sample predicate that allows access only to workflows associated with the user's current organization context. &TABLE_ALIAS.NAME = 'ORG_ID' and &TABLE_ALIAS.TEXT_VALUE = substr (sys_context('USERENV','CLIENT_INFO'),1,10) e l c a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 9 To create a grant, first specify appropriate security context information such as grantee and responsibility. Then specify the following data context information: • Object: WORKFLOW_ITEM_ATTR_VALUES • Data Context Type: Instance Set • Instance Set: The instance set that you created on WORKFLOW_ITEM_ATTR_VALUES • Permission Set: Business workflow item attribute permission set y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 10 c A Granting Permissions for Administrative Actions y m e d a e l c a r O ly & On l a e n r s e t U n I c A Granting Permissions for Administrative Actions You can grant a user the following permissions for administrative actions in the Status Monitor. • Skip Workflow Activity (WF_SKIP) • Retry Activity (WF_RETRY) • Rewind Workflow (WF_REWIND) • Suspend Workflow (WF_SUSPEND) • Cancel Workflow (WF_CANCEL) • Update Workflow Item Attributes (WF_UPDATE_ATTR) • Monitor Data (WF_MON_DATA) See: Assigning Permissions to Roles, Oracle Applications System Administrator's Guide Security. e l c a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 11 Guided Demonstration - Setting Up Specialized Workflow Monitoring Granting Restricted Access to Workflow Monitoring Data 1. Use a Web browser to connect to the Functional Developer responsibility. 2. Enter Workflow Items in the Name field and click Go. 3. Click the Workflow Items name link to access the Workflow Items Object page. 4. Click Create Instance Set in the Object Instance Sets tab. 5. Enter the following values for the instance set: − Name: Workflow Vacation Instance Set − Code: WFVACSET − Description: Object Instance Set for Workflow Vacation − Predicate: &TABLE_ALIAS.ITEM_TYPE = &GRANT_ALIAS.PARAMETER1 • Click Apply. 6. Select the Grants tab and click Update. 7. Select Create Grant in the Grants tab to access the Define Grant page. 8. Enter the following values to create a grant: − Name: Workflow Vacation Grant − Description: Grant Workflow Vacation Instance Set − Grantee Type: Specific User − Grantee: Douglas, Carl (email: [email protected]) − Responsibility: Workflow Administrator Web Applications responsibility − Data Security Object: WORKFLOW_ITEMS e l c a r O ly & On l a e n r s e t U n I c A • Click Next − Data Context Type: Instance Set − Instance Set: Workflow Vacation Instance Set • Click Next − PARAMETER1: WFVACXX − Permission Set: Business workflow item permission set (Code: WF_ADMIN_ITEM_PSET) • Click Next to review your grant and then click Finish. e l c a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 12 e d a y m Assigning Privileges for Administrative Actions in the Status Monitor 9. Use a Web browser to connect to the User Management responsibility. 10. Click the Users link to access the User Maintenance page. 11. Search for the user Carl Douglas with the email address [email protected] and click Go. 12. Click the Update icon for Carl Douglas to access the Update User page. 13. Select Assign Roles. 14. Select Code in the Search By field and enter WF_ADMIN_ROLE as the code to search by. 15. Select Workflow Admin Role from the search results and click Select to return to the Update User page. 16. Enter “Assign workflow admin role with privileges for all administrative actions within the Status Monitor to specialized workflow administrator” as the justification. 17. Click Save. Associating the Workflow Administrator Web Applications Responsibility with a User e d a 18. Use a Web browser to connect to the System Administrator responsibility. 19. Select Security: User > Define to open the Users window. y m c A 20. Query CDOUGLAS as the user name by selecting View > Query by Example > Enter. Enter the user name CDOUGLAS and then execute the query by selecting View > Query by Example > Run to display the user details. e l c a r O ly & On l a e n r s e t U n I 21. Click the New record icon from the application toolbar to add the Workflow Administrator Web Applications responsibility. 22. Save your record and close the Users window. Launching the Vacation Proposal Workflow 23. Use a Web browser to connect to a Workflow administrator responsibility. Log in as a user with workflow administrator privileges. 24. Use the Developer Studio to launch the Vacation Proposal workflow process that you loaded in the Loading and Running a Workflow Process demonstration. e l c a r O Note: Do not log in as an approver to approve the vacation proposal, but leave the notification open, so that the workflow process will remain active and you can verify the CDOUGLAS user’s privileges to perform administrative actions in the Status Monitor. After Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 13 a workflow process is completed, you can no longer perform administrative actions for that process in the Status Monitor, even if you have privileges to perform such actions. Verifying Specialized Workflow Monitoring Privileges 25. Log off and log in as the user CDOUGLAS. 26. Use a Web browser to connect to the Workflow Administrator Web Applications responsibility. 27. Use the Status Monitor Web pages to review the status of the Vacation Proposal process that you launched. The overall process status should still be Active. 28. Click the Action History button and verify that the following administrative action buttons are available in the Action History page: • Retry • Skip • Update Attributes • Rewind • Suspend Workflow • Cancel Workflow e l c y m e d a e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 14 c A Summary y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 15 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Specialized Workflow Monitoring Chapter 26 - Page 16 c A Setting Up Oracle Workflow y m Chapter 27 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 2 c A Setting Up Oracle Workflow y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 3 c A Objectives y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 4 c A Required Setup Steps y m e d a e l c a r O ly & On l a e n r s e t U n I c A Required Setup Steps 1. Set system-wide preferences and default user preferences for your installation of Oracle Workflow using the Workflow Configuration page. 2. Ensure that a directory service is set up to provide information about the individuals and roles in your organization who may utilize Oracle Workflow functionality and receive workflow notifications. 3. Set up background Workflow engines to manage the load on the primary Workflow Engine by processing deferred and timed out activities and stuck processes. 4. Configure the Business Event System for event communication. For more information, refer to the “Setting Up Oracle Workflow” chapter in the Oracle Workflow Administrator’s Guide. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 5 Step 1 Setting Global Workflow Preferences y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting Global Workflow Preferences Use a Web browser to navigate to the Workflow Configuration page, using a responsibility and navigation path specified by your system administrator. Some possible navigation paths in the seeded Workflow responsibilities are: • Workflow Administrator Web Applications: Administration > Workflow Preferences • Workflow Administrator Web (New): Administration > Workflow Preferences • Workflow Administrator Event Manager: Administration > Workflow Preferences You can also navigate to the Workflow Configuration page from other Oracle Workflow administrator Web pages by choosing the Administration tab or selecting the Administration link at the end of the page. You must have workflow administrator privileges to set global workflow preferences on the Workflow Configuration page. If you do not have administrator privileges, you can view global workflow preferences, but you cannot modify them. Workflow System Administrator e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 6 Select the role to which you want to assign workflow administrator privileges. If you want all users and roles to have workflow administrator privileges, such as in a development environment, enter an asterisk (*). LDAP If you are integrating with Oracle Internet Directory, specify the Lightweight Directory Access Protocol (LDAP) server information for the LDAP directory to which you will connect. If you already configured these parameters while installing Oracle Application Server with Oracle EBusiness Suite, Oracle Workflow displays those values here. For more information, see: Installing Oracle Application Server 10g with Oracle E-Business Suite Release 12 (OracleMetaLink note 376811.1) and Oracle Single Sign-On Integration, Oracle Applications System Administrator's Guide - Security. • Host: The host on which the LDAP directory resides. • Port: The port on the host. • Username: The LDAP user account used to connect to the LDAP server. This user name must have write privileges and is required to bind to the LDAP directory. • Old Password: Enter your current LDAP password. Oracle Workflow validates this password before letting you change it. • New Password: Enter the new LDAP password you want to use. The password must be at least five characters long. • Repeat Password: Enter your new LDAP password again in this field to confirm it. • Change Log Base Directory: The LDAP node under which change logs are located. • User Base Directory: The LDAP node under which user records can be found. Business Event Local System Specify the system name for the database where this installation of Oracle Workflow is located, to identify it in the Business Event System. Oracle Workflow automatically creates the system definition for this database in the Event Manager during installation. Select the execution status for the local system. • Enabled: Subscriptions are executed on all events. Oracle Workflow sets the system status to Enabled by default. • Local Only: Subscriptions are executed only on events raised on the local system. • External Only: Subscriptions are executed only on events received by inbound agents on the local system. • Disabled: No subscriptions are executed on any events. Notification Style Specify whether Oracle Workflow should send e-mail notifications to users, and if so, in what format. A user can override this default setting by specifying a different notification style in his or her individual Oracle E–Business Suite preferences. • HTML mail with attachments • Plain text mail with HTML attachments • Plain text mail • Plain text summary mail • Do not send me mail y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 7 c A • HTML mail • HTML summary mail Browser Signing DLL Location Specify the location of the Capicom.dll file that is used for Web page operations with encryption in the Microsoft Internet Explorer browser. This preference is required only if you plan to use certificate-based digital signatures to confirm notification responses, and your users access Oracle Applications with Microsoft Internet Explorer. By default, this preference is set to a URL at which the Capicom.dll file can be downloaded from Microsoft’s Web site. In most cases, you do not need to change this setting. However, you can update this preference if the location of the Capicom.dll file changes, or if you choose to store a copy of the file on your local network and point to that location instead. JInitiator Review details about the JInitiator plugin in your Oracle E-Business Suite installation. Oracle Workflow uses JInitiator to launch Oracle Applications forms linked to notifications. • Class ID: The class identifier for this version of JInitiator. • Download Location: The location where the JInitiator executable is staged for download to users’ client machines. • Version: The JInitiator version number. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 8 c A Step 2 Setting Up an Oracle Workflow Directory Service y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting Up an Oracle Workflow Directory Service In the predefined directory service implementation, Oracle Workflow automatically creates directory service views to integrate with the appropriate source tables. You can also create your own directory service by defining custom views with the required columns. However, note that only the predefined directory service provided by Oracle Workflow is supported by Oracle. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 9 Step 2 Setting Up an Oracle Workflow Directory Service y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 10 c A Step 2 Setting Up an Oracle Workflow Directory Service y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting Up an Oracle Workflow Directory Service You only need to run the bulk synchronization program for products that are not successfully performing incremental synchronization. The Synchronize Workflow LOCAL Tables request set contains ten instances of the Synchronize WF Local Tables program, one for each originating system. You can use this request set to submit requests for all the originating systems at once. Use the Submit Requests form to submit the request set or concurrent program. Enter the following parameters: • Orig System (single concurrent program only): Select the name of the originating system whose user and role information you want to synchronize with the WF_LOCAL tables. • Parallel Processes: Enter the number of parallel processes to run. The default value for this parameter is 1. However, if your hardware resources allow, you can optionally set this parameter to a higher value in order to parallelize the queries during execution of the program. • Logging: Select the logging mode you want. This mode determines whether redo log data is generated for database operations performed by the bulk synchronization process. The default value for this parameter is LOGGING, which generates redo log data normally. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 11 You can optionally set the logging mode to NOLOGGING to suppress redo log data, obtaining a performance gain. Without this redo log data, however, no media recovery is possible for the Workflow directory tables and indexes. • Temporary Tablespace: Select the temporary tablespace the program should use. • Raise Errors: Select Yes or No to indicate whether the program should raise an exception if it encounters an error. Usually you can leave this parameter set to the default value, which is Yes. Note: Products that use role hierarchies do not participate in bulk synchronization. These products must perform incremental synchronization. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 12 c A Step 3 Running Background Engines y m e d a e l c a r O ly & On l a e n r s e t U n I c A Running Background Engines Ensure that you have at least one background engine that can check for timed out activities, one that can process deferred activities, and one that can handle stuck processes. At a minimum, you need to set up one background engine that can handle all three types of issues. However, for performance reasons we recommend that you run three separate background engines at different intervals. • Run a background engine to handle only deferred activities every 5 to 60 minutes. • Run a background engine to handle only timed out activities every 1 to 24 hours as needed. • Run a background engine to handle only stuck processes once a week to once a month, when the load on the system is low. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 13 Step 3 Running Background Engines y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 14 c A Step 3 Running Background Engines y m e d a e l c a r O ly & On l a e n r s e t U n I c A Running Background Engines The Background Engine API parameters are: • itemtype: Optional item type to restrict this engine to activities associated with that item type. • minthreshold: Optional minimum cost that an activity must have for this background engine to execute it, in hundredths of a second. • maxthreshold: Optional maximum cost an activity can have for this background engine to execute it, in hundredths of a second. • process_deferred: Specify TRUE or FALSE to indicate whether the engine should check for deferred activities. • process_timeout: Specify TRUE or FALSE to indicate whether the engine should check for timed out activities. • process_stuck: Specify TRUE or FALSE to indicate whether the engine should check for stuck processes. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 15 Step 4 Configuring the Business Event System y m e d a e l c a r O ly & On l a e n r s e t U n I c A Configuring the Business Event System You can also optionally perform these steps: • To enhance performance, you can change the maximum cache size used in Business Event System subscription processing and enable static function calls for custom PL/SQL functions. • If you want to invoke business process execution language (BPEL) processes through event subscriptions, you can optionally specify the BPEL server. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 16 Step 4 Event Message Communication y m e d a e l c a r O ly & On l a e n r s e t U n I c A Event Message Communication To send an event message, Oracle Workflow places the event message on a local outbound agent’s queue. You must schedule propagation to deliver the message from there to the designated inbound agent’s queue. To receive an event message in Oracle Workflow, you must run an agent listener to dequeue the message from the inbound agent’s queue for Oracle Workflow to process. A component of the Event Manager called the Event Dispatcher then searches for and executes subscriptions to the event. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 17 Step 4 Setting Up Database Links and Queues y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting Up Database Links and Queues Database Links When you set up database links for use by the Business Event System, you should fully qualify each database link name with the domain name. Queues In addition to the standard queues provide by Oracle Workflow, you can also set up your own queues for event message propagation. To set up a queue, you must create the queue table, create the queue, and start the queue. Oracle Workflow provides a sample script called wfevquc2.sql, which you can modify to set up your queues, as well as a sample script called wfevqued.sql, which you can modify to drop queues. These scripts are located on your server in the $FND_TOP/sql directory. If you define a queue with a payload type other than the standard WF_EVENT_T Workflow format or the JMS Text message format, you must create a queue handler to translate between the standard Workflow format and the format required by the queue. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 18 Step 4 Checking Database Parameters y m e d a e l c a r O ly & On l a e n r s e t U n I c A Checking Database Parameters The JOB_QUEUE_PROCESSES parameter defines the number of SNP job queue processes for your instance. You must start at least one job queue process to enable message propagation. The minimum recommended number of processes for Oracle Workflow is ten. You can either modify the parameter in the init.ora file and restart the database, or you can use the ALTER SYSTEM statement to dynamically modify the parameter for the duration of the instance. Note: If you want to review more detailed information about Oracle Advanced Queuing processing, you can optionally use another initialization parameter, EVENT, for detailed database level tracing of issues related to Oracle Advanced Queuing. Add the following line to your init.ora file: event = "24040 trace name context forever, level 10" Then restart your database to make this change effective. Be aware that using this parameter may generate large trace files. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 19 Step 4 Scheduling Agent Listeners y m e d a e l c a r O ly & On l a e n r s e t U n I c A Scheduling Agent Listeners The Generic Service Component Framework is a facility that helps to simplify and automate the management of background Java services. Agent listener service components, managed through Oracle Workflow Manager, are the most automated and robust way to run agent listeners. However, Oracle Workflow also provides an administrative script named wfagtlst.sql that you can use to run an agent listener, or you can run the WF_EVENT.Listen API directly in SQL*Plus. These methods are intended primarily for testing and debugging purposes. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 20 Step 4 Scheduling Agent Listeners y m e d a e l c a r O ly & On l a e n r s e t U n I c A Scheduling Agent Listeners Seeded PL/SQL agent listeners: • Workflow Deferred Agent Listener: Handles messages on WF_DEFERRED to support deferred subscription processing. • Workflow Deferred Notification Agent Listener: Handles notification messages on WF_DEFERRED to support outbound notification processing. • Workflow Error Agent Listener: Handles messages on WF_ERROR to support error handling for the Business Event System. • Workflow Inbound Notifications Agent Listener: Handles messages on WF_NOTIFICATION_IN to support inbound e-mail notification processing. Seeded Java agent listeners: • Workflow Java Deferred Agent Listener: Handles messages on WF_JAVA_DEFERRED to support deferred subscription processing in the middle tier. • Workflow Java Error Agent Listener: Handles messages on WF_JAVA_ERROR to support error handling for the Business Event System in the middle tier. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 21 Oracle XML Gateway also provides PL/SQL agent listeners named ECX Inbound Agent Listener and ECX Transaction Agent Listener, and a Java agent listener named Web Services IN Agent. See: Oracle XML Gateway User's Guide. You can optionally create additional agent listener service components. For example, you can configure agent listeners for other inbound agents that you want to use for event message propagation, such as the standard WF_IN and WF_JMS_IN agents, or any custom agents. You can also configure an agent listener service component that only processes messages on a particular agent that are instances of a specific event. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 22 c A Step 4 Scheduling Propagation y m e d a e l c a r O ly & On l a e n r s e t U n I c A Scheduling Propagation If you want to use the standard WF_OUT and WF_JMS_OUT agents or custom agents for event message propagation, ensure that you schedule propagation for those agents. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 23 Step 4 Scheduling Propagation y m e d a e l c a r O ly & On l a e n r s e t U n I c A Scheduling Propagation For information about using Oracle Enterprise Manager to schedule Oracle Advanced Queuing propagation, refer to Oracle Enterprise Manager Support, Oracle Streams Advanced Queuing User's Guide and Reference and the Oracle Enterprise Manager online help. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 24 Step 4 Scheduling Propagation y m e d a e l c a r O ly & On l a e n r s e t U n I c A Scheduling Propagation The Schedule_Propagation API parameters are: • queue_name: The queue associated with the local outbound agent for which you want to schedule propagation. Specify the queue name prefaced by the schema that owns the queue, in the following format: <schema>.<queue> The standard Workflow queues are usually owned by the APPLSYS schema. • destination: The database link to the remote system to which you want to propagate messages. To propagate messages to another queue on the local system, enter the destination NULL. The default value is NULL. • start_time: The initial start time for the propagation window. • duration: The duration of the propagation window, in seconds • next_time: A date function to compute the start of the next propagation window from the end of the current window. For example, to start the window at the same time every day, next_time should be specified as 'SYSDATE + 1 - duration/86400'. If this value is NULL, then propagation is stopped at the end of the current window and is not run repeatedly. The default value is NULL. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 25 • latency: A latency time in seconds to specify how long you want to wait, after all messages have been propagated, before rechecking the queue for new messages to the destination. The latency represents the maximum wait time during the propagation window for a message to be propagated after it is enqueued. To propagate messages as soon as possible after they are enqueued, enter a latency of zero. The default latency is 60 seconds. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 26 c A Guided Demonstration - Scheduling Agent Listeners and Propagation 1. Log on to a Workflow administrator responsibility with Event Manager functionality. Log in as a user with workflow administrator privileges. 2. Click the Administration link, and ensure that the Business Event Local System: Status is set to Enabled on the Workflow Configuration page. 3. Ensure that the job_queue_processes database parameter is set to 10 or higher. • • You can use the Oracle Workflow Manager component of Oracle Applications Manager to check the database parameters required for propagation. • Connect to a Workflow administrator responsibility as a user with workflow administrator privileges, and click the Workflow Manager link. • Review the information in the Related Database Parameters region of the Workflow System page. y m You can also use the following command to check the parameter value in SQL*Plus: select name, value from v$parameter where name=’job_queue_processes’; • If necessary, you can increase the job_queue_processes value dynamically, without needing to restart the database. Connect to SQL*Plus as the SYS user and execute the following commands: e l c a r O ly & On l a e n r s e t U n I alter system set job_queue_processes = 10; exit • 4. e d a c A Note that this setting is necessary because propagation schedules are handled by job queue processes. If no job queue processes are available in the database because they are all being used for other types of jobs, then the propagation will not take place. So the job_queue_processes parameter needs to be set sufficiently high to ensure that a process will be available to handle propagation. Schedule propagation to run once a minute for the local WF_JMS_OUT agent and the Local destination. Connect to SQL*Plus and execute the following command: e l c Exec DBMS_AQADM.Schedule_Propagation(‘APPLSYS.WF_JMS_OUT’, NULL, SYSDATE, 30, ‘SYSDATE + 1/1440’, NULL); a r O 5. Run an agent listener for the local WF_JMS_IN agent. Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 27 • • You can use the Oracle Workflow Manager component of Oracle Applications Manager to configure and run an agent listener service component for WF_JMS_IN. • Connect to a Workflow administrator responsibility as a user with workflow administrator privileges, and click the Workflow Manager link. • Click the Agent Listeners status icon on the Workflow System page. • Click the Create button. • Select Workflow Agent Listener and click Continue. • Enter “WF Inbound JMS Listener” in the Name field, select Automatic in the Startup Mode field, and select WF_JMS_IN in the Inbound Agent field. Then click Next. • Select the Workflow Agent Listener Service in the Container field and click Next. • Click Next. • Click Finish. • The container should automatically start the agent listener within a few minutes. Check back until the status of the agent listener appears as Running on the Service Components page. The agent listener should now run repeatedly. y m e d a You can also use the WF_EVENT.Listen API to run an agent listener manually from SQL*Plus. Connect to SQL*Plus as the APPS user for Oracle Applications, and use the following command: exec WF_EVENT.Listen(‘WF_JMS_IN’); e l c a r O ly & On l a e n r s e t U n I c A In this case, note that running the API once means running the listener only once. The listener will dequeue all messages currently enqueued on the agent's queue and then exit. To automatically resubmit the listener, configure an agent listener service component. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 28 Step 4 Synchronizing License Statuses y m e d a e l c a r O ly & On l a e n r s e t U n I c A Synchronizing License Statuses You can use the License Manager utility to review which products you currently have licensed. See: License Manager, Oracle Applications System Administrator’s Guide - Maintenance. Use the Submit Requests form to submit the Synchronize Product License and Workflow BES License concurrent program (FNDWFLIC). This program does not require any parameters. If you upgrade from an Oracle E-Business Suite release earlier than Release 11.5.9, you should run the Synchronize Product License and Workflow BES License concurrent program once after the upgrade to update the license status of the existing events and subscriptions in your Event Manager. Otherwise, subscriptions may not be correctly processed after the upgrade. Subsequently, when you license a product, Oracle Workflow automatically updates the license status for all the events and subscriptions owned by that product. Note: Any events and subscriptions that you define with a customization level of User are always treated as being licensed. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 29 Step 4 Cleaning Up the WF_CONTROL Queue y m e d a e l c a r O ly & On l a e n r s e t U n I c A Cleaning Up the WF_CONTROL Queue The WF_CONTROL agent is used for internal processing only. You should not place custom event messages on this queue.You do not need to schedule propagation for the WF_CONTROL agent, because the middle tier processes that use WF_CONTROL dequeue messages directly from its queue. However, this queue should be cleaned up periodically. When a middle tier process for Oracle E-Business Suite starts up, it creates a JMS subscriber to the WF_CONTROL queue. If a middle tier process dies, however, the corresponding subscriber remains in the database. For more efficient processing, you should ensure that WF_CONTROL is periodically cleaned up by removing the subscribers for any middle tier processes that are no longer active. The recommended frequency for performing cleanup is every 12 hours. Use Oracle Workflow Manager to manage the Workflow Control Queue Cleanup (FNDWFBES_CONTROL_QUEUE_CLEANUP) concurrent program, which uses the WF_BES_CLEANUP.Cleanup_Subscribers() API to perform the necessary cleanup. This concurrent program is scheduled to run every 12 hours by default. The program does not require any parameters. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 30 Step 4 Tuning Performance y m e d a e l c a r O ly & On l a e n r s e t U n I c A Tuning Performance Changing the Maximum Cache Size for the Business Event System The Business Event System caches event, subscription, and agent definitions to enhance performance during subscription processing. The default maximum size of the cache is 50 records. You can optionally increase the maximum cache size to reduce the database queries performed by the Business Event System, or decrease the maximum cache size to reduce the amount of memory used by the cache. The maximum cache size is determined by the value for the WFBES_MAX_CACHE_SIZE resource token. To change this value, you must first create a .msg source file specifying the new size as the value for the WFBES_MAX_CACHE_SIZE resource token. Then use the Workflow Resource Generator program to upload the new seed data from the source file to the database table WF_RESOURCES. See: To Run the Workflow Resource Generator, Oracle Workflow API Reference. Enabling Static Function Calls for Custom PL/SQL Functions If you use custom PL/SQL functions within the Business Event System, including event data generate functions, event subscription rule functions, and queue handler enqueue and dequeue e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 31 APIs, Oracle Workflow calls those functions using dynamic SQL by default. However, you can enable Oracle Workflow to call your custom functions statically to enhance performance. Oracle Workflow provides two PL/SQL packages with procedures that contain lists of static function calls. The Business Event System internally calls these procedures during subscription processing to check whether static function calls are available for the procedures being executed. • WF_BES_DYN_FUNCS package - Contains static function calls for generate functions and rule functions. • WF_AGT_DYN_FUNCS package - Contains static function calls for queue handler enqueue and dequeue APIs. The initial seeded versions of these packages include static function calls only for seeded Oracle Workflow functions, such as the rule function WF_RULE.Default_Rule and the queue handler APIs WF_EVENT_QH.Enqueue and WF_EVENT_QH.Dequeue. You can use the wfbesfngen.sql script to add functions from other Oracle Applications products or your own custom functions to these packages. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 32 c A Step 4 Specifying the BPEL Server y m e d a e l c a r O ly & On l a e n r s e t U n I c A Specifying the BPEL Server The WF: BPEL Server profile option lets you quickly change the BPEL server setup for all subscriptions that invoke BPEL processes, such as if you move these subscription definitions from a test instance to a production instance. See: Invoking a Web Service, Oracle Workflow Developer's Guide. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 33 Optional Setup Steps y m e d a e l c a r O ly & On l a e n r s e t U n I c A Optional Setup Steps 1. Partition certain Workflow tables for performance gain. 2. Set up additional languages if you want to use Oracle Workflow in languages other than English. 3. Set up one or more notification mailers if you want to allow your users to receive notifications by e-mail. 4. Customize the templates for your e-mail notifications. 5. Give users access to the Advanced Worklist, Personal Worklist, and and Notifications administrator search Web pages from any responsibility you choose. 6. Use the WF: Notification Reassign Mode profile option to control which reassign modes are available to users from the Notification Details page. 7. Control the item types for which users can define vacation rules and grant worklist access, using the WF: Vacation Rule Item Types lookup type and the WF: Vacation Rules - Allow All profile option. 8. Set up users to enable electronic signatures in notification responses. 9. Customize the company logo that appears in Oracle Workflow Web pages. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 34 10. Include additional icons in your Oracle Workflow icons subdirectory to customize the diagrammatic representation of your workflow processes. For more information, refer to the “Setting Up Oracle Workflow” chapter in the Oracle Workflow Administrator’s Guide. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 35 c A Optional Step 1 Partitioning Workflow Tables y m e d a e l c a r O ly & On l a e n r s e t U n I Partitioning Workflow Tables The wfupartb.sql script partitions the following tables: • WF_ITEM_ACTIVITY_STATUSES • WF_ITEM_ACTIVITY_STATUSES_H • WF_ITEM_ATTRIBUTE_VALUES • WF_ITEMS The script recreates the following indexes: • WF_ITEM_ACTIVITY_STATUSES_PK • WF_ITEM_ACTIVITY_STATUSES_N1 • WF_ITEM_ACTIVITY_STATUSES_N2 • WF_ITEM_ACTIVITY_STATUSES_H_N1 • WF_ITEM_ACTIVITY_STATUSES_H_N2 • WF_ITEM_ATTRIBUTE_VALUES_PK • WF_ITEMS_PK • WF_ITEMS_N1 e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 36 c A • WF_ITEMS_N2 • WF_ITEMS_N3 y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 37 c A Optional Step 2 Setting Up Additional Languages y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting Up Additional Languages Note: You can display languages that require a multibyte character set only if your database uses a character set that supports these languages, such as UTF8. Displaying Oracle Workflow Web Pages in Other Languages You select and install additional languages as part of the Oracle E-Business Suite installation. Users can set their language preference to an installed language through the Personal Homepage. Creating and Viewing Workflow Definitions in Other Languages using Oracle Workflow Builder • Set the NLS_LANG environment variable for the new language, territory, and encoded character set that you want to use for the workflow definition. Specify the value for NLS_LANG in the following format: LANGUAGE_TERRITORY.CHARSET Use the Registry Editor on your PC to set the NLS_LANG environment variable: - Select Run from the Start menu on your PC. - Enter the command to run the Registry Editor and click OK. The command depends on your version of Windows; for example, it may be regedit or regedit32. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 38 - Drill down to My Computer > HKEY_LOCAL_MACHINE > Software > Oracle, and then to the Oracle home where the Workflow Builder is installed. - Select the NLS_LANG variable and select Modify from the Edit menu. - Enter the value you want and click OK. - Exit the Registry Editor. • Start Oracle Workflow Builder. Create a translated version of your workflow definition and save it as a flat file (.wft), or open and view a workflow definition that is already translated. Loading Workflow Definitions in Other Languages to a Database • Ensure that the language you want is set up in the database. You select and install additional languages as part of the Oracle E-Business Suite installation. • Before running the Workflow Definitions Loader program to load a translated workflow definition to your database, you must set the NLS_LANG environment variable to the appropriate territory and character set for the workflow definition you want to load. The character set must match the character set encoding used to create the workflow definition file, which is determined by the NLS_LANG value that was set on the client PC before the .wft file was created in the Workflow Builder. To set NLS_LANG before running the Workflow Definitions Loader, use the following format: _TERRITORY.CHARSET Note that it is important to include the underscore (_) before the territory name and the period (.) between the territory name and the character set name in the NLS_LANG value. You do not need to include the language in this NLS_LANG value because the Workflow Definitions Loader uses the language specified within the .wft file to determine the language to load. • Before using the Workflow Builder to save a translated workflow definition to your database, you must set the NLS_LANG environment variable to the appropriate language, territory, and character set. If you are saving several workflow definitions in different languages, you must reset NLS_LANG for each language. Sending E-mail Notifications in Other Languages • Determine whether Oracle has translated the e-mail notification templates to the language you want to set by checking for the file containing the templates in the appropriate language subdirectory, $FND_TOP/import/<lang>. The standard templates are delivered in a file called wfmail.wft. • If the e-mail templates are available for the desired language, Oracle Workflow uses the language preference for the notification recipient to determine the language for an e-mail notification. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 39 c A Optional Step 3 Implementing Notification Mailers y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 40 c A Optional Step 3 Implementing Notification Mailers y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 41 c A Optional Step 3 Implementing Notification Mailers y m e d a e l c a r O ly & On l a e n r s e t U n I c A Implementing Notification Mailers Users can receive e-mail notifications using various e-mail clients, although notifications may be displayed differently in different clients, depending on the features each client supports. Oracle Workflow fully supports Multipurpose Internet Mail Extensions (MIME) encoded messages. This means that a notification mailer can exchange messages with workflow users containing languages with different character sets and multimedia encoded content. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 42 Optional Step 4 Customizing Message Templates y m e d a e l c a r O ly & On l a e n r s e t U n I c A Customizing Message Templates Message templates are defined in the System: Mailer item type, stored in a file named wfmail.wft. It is not recommended to modify the standard templates. However, you can choose to use the alternative templates provided by Oracle Workflow instead of the default templates, or you can also create your own custom templates in the System: Mailer item type. For more information, refer to the “Setting Up Oracle Workflow” chapter in the Oracle Workflow Administrator’s Guide. You can implement alternative standard or custom templates in the following ways: • Assign the templates that you want to a particular notification mailer service component in the mailer configuration parameters. The templates assigned to a mailer override the default System: Mailer templates. • Assign the templates that you want to a particular notification in a workflow process by defining special message attributes. In this case the templates assigned to the notification override both the templates assigned to a mailer and the default System: Mailer templates. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 43 Optional Step 4 Customizing Message Templates y m e d a e l c a r O ly & On l a e n r s e t U n I c A Customizing Message Templates The following standard message templates are used by default. An asterisk (*) marks the templates for which Oracle Workflow also provides an alternative version. • * Open Mail (Templated): For notifications that require a response when you are using the templated response method • * Open Mail (Direct): For notifications that require a response when you are using the direct response method • * Open Mail (Outlook Express): For notifications that require a response, if you use an email application such as Microsoft Outlook Express as your e-mail client • * Open FYI Mail: For notifications that do not require a response • View From UI: For response-required notifications whose content you do not want to send in e-mail • View FYI From UI: For notifications that do not require a response, whose content you do not want to send in e-mail • URL Attachment: Creates the Notification References attachment for HTML-formatted notification messages that include URL attributes with Attach Content checked e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 44 • • • • • • • • • • • • * Canceled Mail: Informs the recipient that a notification is canceled * Invalid Mail: Informs the recipient that the response to the notification is invalid * Closed Mail: Informs the recipient that a previously sent notification is now closed Summary Mail (HTML): For notification summaries Warning Mail: Informs the recipient of unsolicited mail that he or she sent Signature Required Mail: For notifications that require an electronic signature in the user’s response; users must respond to such notifications through the Notification Details Web page rather than by e-mail Signature Warning Mail: Informs the recipient that an e-mail notification response was not valid because the notification required an electronic signature to be entered through the Notification Details Web page Secure Mail Content: For notifications that include sensitive content that cannot be sent in e-mail for security reasons; users must view and respond to such notifications through the Notification Details Web page rather than by e-mail * Open Mail (More Information Request): For requests for more information about a notification from one user to another user More Information Request (Outlook Express): For requests for more information about a notification from one user to another user, if you use an e-mail application such as Microsoft Outlook Express as your e-mail client Invalid Open Mail (More Information Request): Informs the recipient that the response to a request for more information is invalid User Notification Preference Update Report: Informs the administrator that an e-mail notification could not be sent to one or more recipients, that the notification preference for those recipients has been set to DISABLED, and that those recipients' original notification preferences, which are listed, should be reset after the issues that caused the failures are corrected y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 45 c A Optional Step 5 Adding Worklist Functions to User Responsibilities y m e d a e l c a r O ly & On l a e n r s e t U n I c A Adding Worklist Functions to User Responsibilities Add the following functions to the responsibilities from which you want users to access the corresponding pages: • Advanced Worklist: WF_WORKLIST • Personal Worklist: WF_WORKLIST_CUSTOM • Notifications administrator search page: WF_WORKLIST_SEARCH The Advanced Worklist is seeded on the menu for the Workflow User Web Applications responsibility by default. You can also add its function to other responsibilities from which you want users to access notifications. The Personal Worklist is an optional feature that is not seeded on any Oracle E-Business Suite menu. If you want users to access this version of the Worklist, you must first add its function to the menu for a responsibility assigned to those users. If you add the Personal Worklist, you can use worklist flexfields to define specialized worklist views that display information specific to particular types of notifications. If you define a securing function for a view, add the securing function to the same menu as the Personal e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 46 Worklist function. Your specialized worklist view will appear in the list of views only when users access the Personal Worklist from that responsibility. The Notifications administrator search page is seeded on the menu for the Workflow Administrator Web Applications responsibility by default. You can also add its function to other responsibilities from which you want users to be able to search for notifications. For example, if you want users with the Workflow User Web Applications responsibility to have access to the Notifications administrator search page, you can add this function to the FND_WFUSER (Workflow User) menu with a prompt such as Notification Search. A user must have workflow administrator privileges to access other users' notifications on the Notifications administrator search page. If a user does not have administrator privileges, that user can only search for and access his or her own notifications. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 47 c A Optional Step 6 Setting the Notification Reassign Mode y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting the Notification Reassign Mode The WF: Notification Reassign Mode profile option controls the reassign modes available to users from the Advanced Worklist, the Personal Worklist, and the Response section of the Notification Details page. • Delegate: This mode lets users give another user authority to respond to a notification on their behalf, while still retaining ownership of the notification themselves. For example, a manager might delegate all vacation scheduling approvals to an assistant. • Transfer: This mode lets users give another user complete ownership of and responsibility for a notification. For example, users might select this option if they should not have received a certain notification and they want to send it to the correct recipient or to another recipient for resolution. A transfer may have the effect of changing the approval hierarchy for the notification. For example, a manager might transfer a notification about a certain project to another manager who now owns that project. • Reassign: This setting provides users access to both the Delegate and Transfer reassign modes. The Reassign setting is the default value for the WF: Notification Reassign Mode profile option. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 48 Optional Step 7 Setting Up Notification Handling Options y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting Up Notification Handling Options Adding Item Types for Vacation Rules and Worklist Access By default, the list of item types a user can select when creating a vacation rule or when granting worklist access displays those item types for which the user has previously received at least one notification. You can also choose to add item types that you want to appear in the lists for all users. In this way you can allow users to create rules or grant worklist access to handle any notifications they may receive from those item types in the future. To add an item type to the list, define the internal name of the item type as a lookup code for the WF: Vacation Rule Item Types lookup type. • Navigate to the Application Object Library Lookups window in the Application Developer responsibility. • Query the WF_RR_ITEM_TYPES lookup type with the meaning WF: Vacation Rule Item Types in the Application Object Library application. • Define the item type you want as a new lookup code for this lookup type. Ensure that you enter the item type internal name in the Code field exactly as the name is defined in your database. Allowing Vacation Rules That Apply to All Item Types e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 49 Use the WF: Vacation Rules - Allow All profile option to determine whether the list of item types for vacation rules includes the “All” option. The “All” option lets users create a generic rule that applies to notifications associated with any item type. • Enabled: The “All” option appears in the list of item types for vacation rules. This is the default value. • Disabled: Users must always specify the item type to which a vacation rule applies. After changing the value of this profile option, you must stop and restart Oracle HTTP Server for the change to take effect. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 50 c A Optional Step 8 Setting Up for Electronic Signatures y m e d a e l c a r O ly & On l a e n r s e t U n I c A Setting Up for Electronic Signatures Implementing Password-based Signatures with Single Sign-On Oracle Workflow supports password-based signatures for notifications based on Oracle Application Object Library (FND) passwords. If you maintain your directory service based on Oracle Application Object Library users and passwords, no additional setup is required. However, if you implement single sign-on for your site through Oracle Internet Directory, you must perform the following steps. • Set the Applications SSO Login Types profile option to either Local or Both at user level for all users who need to enter password-based signatures. • Ensure that these users have valid passwords defined in Oracle Application Object Library. For more information, see: Oracle Single Sign-On Integration, Oracle Applications System Administrator's Guide - Security. Loading Certificates for Digital Signatures Before users can sign responses with their X.509 certificates, you must load these certificates into your Oracle E-Business Suite database using the Workflow Certificate Loader. When you load a certificate, you must also specify the Oracle Applications user to whom that certificate is e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 51 assigned. Oracle Workflow uses this information to validate that the user attempting to sign with a certain certificate is the same user to whom that certificate is assigned. A user can have more than one certificate assigned to him or her. However, each certificate can only be assigned to one user. Additionally, after you have loaded a certificate for a user, you cannot delete it from the database or assign it to a different user. If a certificate is incorrectly assigned, the user to whom it belongs must revoke it and obtain a new certificate instead. You must load a user’s personal certificate, the root certificate of the certificate authority that issued the personal certificate, and any intermediate certificates required for this type of personal certificate. Run the loader by running Java against oracle.apps.fnd.wf.DigitalSignature.loader.CertificateLoader. You can load several certificates at once by listing the information for all the certificates in a data file for the loader. You can also load a single certificate by specifying the certificate information in the command line for the loader. Note: Oracle Workflow does not provide a framework for certificate provisioning. Oracle Workflow’s digital signature support assumes that certificate provisioning is already part of your infrastructure. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 52 c A Optional Step 9 Customizing the Workflow Web Page Logo y m e d a e l c a r O ly & On l a e n r s e t U n I c A Customizing the Workflow Web Page Logo Note: /OA_MEDIA/ is a virtual directory mapping defined in your Web server when Oracle Workflow is installed. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 53 Optional Step 10 Adding Custom Icons y m e d a e l c a r O ly & On l a e n r s e t U n I c A Adding Custom Icons If you create custom icons to include in your Oracle Workflow Builder process definition, and you want the custom icons to appear in the Status Monitor when you view the process, you must do the following: 1. Convert the custom icon files (.ico) to GIF format (.gif). 2. Copy the .gif files to the physical directory associated with your Web server’s /OA_MEDIA/ virtual directory, so that the Status Monitor can access them. Note: /OA_MEDIA/ is a virtual directory mapping defined in your Web server when Oracle Workflow is installed. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 54 Version Compatibility y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 55 c A Review Questions y m e d a e l c a r O ly & On l a e n r s e t U n I c A Review Questions and Solutions 1. What are the required setup steps for Oracle Workflow? - Set your global workflow preferences. - Ensure that your directory service is set up. - Set up background engines. - Configure the Business Event System for event communication. 2. What are the optional setup steps for Oracle Workflow? - Partition Workflow tables for performance gain. - Set up additional languages. - Set up notification mailers. - Customize the templates for your e-mail notifications. - Add Worklist web pages to users’ responsibilities. - Set the WF: Notification Reassign Mode profile option. - Control the item types for which users can define vacation rules and grant worklist access. e l c a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 56 - Set up users to enable electronic signatures in notification responses. - Customize the company logo that appears in Oracle Workflow Web pages. - Include custom icons in your Oracle Workflow icons subdirectory. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 57 c A Summary y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Setting Up Oracle Workflow Chapter 27 - Page 58 c A Managing Service Components y m Chapter 28 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 2 c A Managing Service Components y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 3 c A Objectives y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 4 c A Oracle Workflow Manager y m e d a e l c a r O ly & On l a e n r s e t U n I c A Oracle Workflow Manager To access Oracle Workflow Manager, log in to Oracle Applications Manager, select Workflow Manager from the Navigate To menu on the Applications Dashboard page, and click the Go button. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 5 Service Components y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 6 c A Service Component Containers y m e d a e l c a r O ly & On l a e n r s e t U n I c A Service Component Containers Service component containers and their service components are run through Generic Service Management (GSM), which you can control through Oracle Applications Manager. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 7 Service Component Types y m e d a e l c a r O ly & On l a e n r s e t U n I c A Service Component Types Oracle E-Business Suite also includes the service component type Workflow Web Services Outbound. These service components process outbound Oracle XML Gateway Web service messages. See: Oracle XML Gateway User’s Guide. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 8 Accessing Service Components in Oracle Workflow Manager y m e d a e l c a r O ly & On l a e n r s e t U n I c A Accessing Service Components in Oracle Workflow Manager If you click the Service Components status icon or link, the Service Components page displays all types of service components. If you click the Agent Listeners status icon, the Service Components page automatically filters the list to display only PL/SQL agent listeners and Java agent listeners. If you click the Notification Mailers status icon, the Service Components page automatically filters the list to display only notification mailers. If the status of a service component changes to Stopped with Error or System Deactivated, Oracle Workflow posts a system alert to the System Alerts and Metrics page in Oracle Applications Manager. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 9 Managing Service Components y m e d a e l c a r O ly & On l a e n r s e t U n I c A Managing Service Components You can also perform the following actions on the Service Components page. • To manually filter the service components displayed in the list, select a service component property from the Filter pull-down menu, enter a filter value in the text field, and click the Go button. You can filter by the following properties: - Service component name - Service component status - Service component type display name - Service component type internal name • You can automate the running of a service component by assigning it an Automatic or OnDemand startup type, or by scheduling control events in advance. However, if you want to manually control the running of a service component, select the service component, choose the command that you want from the command pull-down menu, and click the Go button. You can choose the following control commands: - Refresh - Resume e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 10 - Start - Stop - Suspend - Launch Summary Notifications (Workflow Mailer service components only) • To review details for the container to which a service component belongs, click the container link in the Container column. When you choose to create a new service component, a page appears to let you select the type of service component that you want to create. After you select a service component type, the configuration wizard for that type appears. Similarly, when you choose to edit an existing service component, the appropriate configuration wizard appears. On the Component Details page, you can review the configuration parameters and scheduled control events for the selected service component. You can also review the history of control events scheduled for the service component, review the service component container log, access the configuration wizard to edit the service component, or perform other actions appropriate to that type of service component. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 11 c A Service Component Container Logs y m e d a e l c a r O ly & On l a e n r s e t U n I c A Service Component Container Logs The default container log level, which is also the recommended setting, is Error. You can optionally specify a different log level. The log levels that you can select, in order from most detailed to least detailed, are as follows: • 1 - Statement • 2 - Procedure • 3 - Event • 4 - Exception • 5 - Error • 6 - Unexpected To specify a log level for a service component container, click the container link on the Service Components page, select the container, and click the View Status button to navigate to the Service Status page. Then select the log level that you want to assign to the container from the Change Log Level To pull-down menu, and click Go. You can specify a log level for an individual service component in the configuration wizard for that component. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 12 Service Component Startup Modes y m e d a e l c a r O ly & On l a e n r s e t U n I c A Service Component Startup Modes A service component can have one of three startup modes. • Automatic: When a component container is started, it will automatically start its automatic service components. It will also monitor these components and restart them automatically when necessary. • On-Demand: A component container will start its on-demand service components if those components have messages waiting to be processed. For example, an on-demand notification mailer service component will be started if there are messages waiting on the WF_NOTIFICATION_OUT queue. The container will stop an on-demand service component when that component's maximum idle time has been exceeded. • Manual: You must manually start and stop the service component through Oracle Workflow Manager. The component container does not start or stop its manual service components. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 13 Agent Listeners y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 14 c A Agent Listeners y m e d a e l c a r O ly & On l a e n r s e t U n I c A Agent Listeners Oracle Workflow provides the following seeded PL/SQL agent listeners: • Workflow Deferred Agent Listener: Handles messages on WF_DEFERRED to support deferred subscription processing. • Workflow Deferred Notification Agent Listener: Handles notification messages on WF_DEFERRED to support outbound notification processing. • Workflow Error Agent Listener: Handles messages on WF_ERROR to support error handling for the Business Event System. • Workflow Inbound Notifications Agent Listener: Handles messages on WF_NOTIFICATION_IN to support inbound e-mail notification processing. Oracle XML Gateway also provides seeded PL/SQL agent listeners named ECX Inbound Agent Listener and ECX Transaction Agent Listener. See: Oracle XML Gateway User’s Guide. Oracle Workflow provides the following seeded Java agent listeners: • Workflow Java Deferred Agent Listener: Handles messages on WF_JAVA_DEFERRED to support deferred subscription processing in the middle tier. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 15 • Workflow Java Error Agent Listener: Handles messages on WF_JAVA_ERROR to support error handling for the Business Event System in the middle tier. Oracle XML Gateway also provides a seeded Java agent listener named Web Services IN Agent. See: Oracle XML Gateway User’s Guide. You can configure additional agent listeners for other inbound agents that you want to use for event message propagation, such as the standard WF_IN and WF_JMS_IN agents, or any custom agents. You can also configure an agent listener that only processes messages on a particular agent that are instances of a specific event. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 16 c A Agent Listener Configuration Wizards y m e d a e l c a r O ly & On l a e n r s e t U n I c A Agent Listener Configuration Wizards Use the Next and Back buttons to navigate among the pages of the configuration wizards. Define Page • ID: When you edit a previously created service component, the configuration wizard displays the identifier for the service component. • Status: When you edit a previously created service component, the configuration wizard displays the status of the service component. • Name: The unique name of the service component. • Startup Mode: Select Automatic, Manual, or On-Demand. • Container Type: The container type to which this service component belongs. In Oracle EBusiness Suite, the container type is always Oracle Applications Generic Service Management (Oracle Applications GSM). • Inbound Agent: The Business Event System agent that you want to monitor for inbound event messages. • Outbound Agent: Leave this field blank. Agent listeners do not use an outbound agent. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 17 • Correlation ID: Optionally specify the Oracle Advanced Queuing (AQ) correlation ID of the event messages that you want the agent listener to process. The AQ correlation ID for an event message in the Business Event System is usually specified in the following format: <event name> Consequently, by specifying a correlation ID in this attribute, you can dedicate the agent listener to listen only for messages that are instances of the specified event. You can also specify a partial value to listen for messages that are instances of any event whose name begins with the specified value. Details Page • ID: When you edit a previously created service component, the configuration wizard displays the identifier for the service component. • Status: When you edit a previously created service component, the configuration wizard displays the status of the service component. • Name: The configuration wizard displays the name defined for the service component. • Container: The container to which the service component will belong. The container for agent listener service components is a predefined container called Workflow Agent Listener Service. • Maximum Idle Time: If you selected the On-Demand startup mode for the service component, enter the maximum time in minutes that the service component can remain idle before it is stopped. An on-demand component that is stopped in this way will be restarted by its container when it is needed again to process new messages. • Max Error Count: The number of consecutive errors the service component can encounter before its container stops it and changes its status to Stopped with Error. If an error is resolved and processing can continue, the error count is reset. • Inbound Thread Count: Set the inbound processing thread count to 1 to enable inbound message processing with this agent listener. Select 0 to disable this agent listener. • Outbound Thread Count: Leave this parameter set to the default value of 0. Agent listener service components do not perform outbound message processing. • Log Level: Select the level of detail for the information you want to record in the service component container log. • Processor Read Wait Timeout: Specify the amount of time in seconds that the service component’s processing thread continues to wait, after reading the last message from its assigned queue, before timing out. If another message is received before this time expires, that message is processed and the timeout period begins again. If the timeout period expires and no more messages have been received, the service component stops reading and its sleep time begins. • Processor Min Loop Sleep: Specify the minimum sleep time in seconds during which the service component waits, after its read timeout period expires, before it checks its queue for messages again. • Processor Max Loop Sleep: Specify the maximum sleep time in seconds if you want to increase the sleep time between read attempts when no messages are received. If you specify a maximum sleep time that is greater than the minimum sleep time, then the service component initially waits for the minimum sleep time after it finishes reading messages from its queue. If no messages are read in subsequent attempts, then the sleep y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 18 c A time between read attempts gradually increases until the maximum sleep time is reached. Increasing the sleep time can help enhance performance if messages are received infrequently. You can also specify 0 for this parameter to indicate that the sleep time should not be increased. In this case, the service component always waits for the minimum sleep time between read attempts. • Processor Error Loop Sleep: Specify the sleep time in seconds during which the service component waits, after an error occurs, before it attempts to begin processing again. • Processor Close on Read Timeout: Select this parameter to specify that the service component should close its connections after its read timeout period expires, when its sleep time begins. Deselect this parameter to specify that the connections should remain open until the processing thread stops. Scheduling Events Page You can schedule the following events to be raised to control the running of an agent listener service component. • Start • Refresh • Suspend • Resume • Stop Click the Add a Row or Add Another Row button to add a new row to the list of events and enter the information for the event. • Select the event for the command you want to schedule. • Select the date when you want the event to be raised first. • Select the hour and minute to specify the time on the specified date when you want the event to be raised first. The hour values are in a twenty-four hour format. For example, select 00 for midnight, or 23 for 11 PM. • If you want to raise the event periodically, enter the time interval in minutes at which you want to raise the event. If you do not specify a repeating interval, the event is raised only once. • If you choose the refresh event, you can optionally enter parameters to refresh the agent listener configuration parameters with those values when the event is raised. Review Page If you want to change any of these settings, return to the appropriate step in the agent listener configuration wizard to make your changes. To save these settings and finish the configuration, click the Finish button. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 19 c A Notification Mailers y m e d a e l c a r O ly & On l a e n r s e t U n I c A Notification Mailers For example, you can create a notification mailer that processes only messages that belong to a particular workflow item type, or create additional mailers that process the same types of message to increase throughput. The correlation ID for a notification mailer can be set to a specific item type to determine which messages it can process. You can also configure any notification mailer service component to process only inbound messages, or only outbound messages. You associate inbound and outbound mailers with each other by assigning them the same mailer node name. The mailer node name indicates which inbound mailer can process incoming responses to outbound messages sent by a particular outbound mailer. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 20 Outbound Notification Mailer Processing y m e d a e l c a r O ly & On l a e n r s e t U n I c A Outbound Notification Mailer Processing When the event is dequeued from WF_DEFERRED and the subscription is processed, the subscription requires the event data for the event, causing the Generate function for the event to be executed. The Generate function for this event performs the following actions: • Resolves the notification recipient role to a single e-mail address, which itself can be a mail list. • Checks the notification preference of the recipient to determine whether an e-mail notification is required, and in what type of format. • Switches its database session to the recipient role's preferred language and territory as defined in the directory service. • Generates an XML representation of the notification message and any optional attachments using the appropriate message template. Finally, the subscription places the event message on the standard WF_NOTIFICATION_OUT agent. A notification mailer service component polls the WF_NOTIFICATION_OUT agent for messages that must be sent by e-mail. When the notification mailer dequeues a message from this agent, it uses a Java-based notification formatter to convert the XML representation of the e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 21 notification into a MIME (Multipurpose Internet Mail Extensions) encoded message and sends the message by the Simple Mail Transfer Protocol (SMTP). y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 22 c A Inbound Notification Mailer Processing y m e d a e l c a r O ly & On l a e n r s e t U n I c A Inbound Notification Mailer Processing A notification mailer processes e-mail responses from users using the Internet Message Access Protocol (IMAP). The notification mailer uses a Java-based e-mail parser to interpret the text of each message and create an XML representation of it. A notification mailer uses three folders in your response mail account for response processing: one to receive incoming messages, one to store processed messages, and one to store discarded messages. A notification mailer does the following to process response messages: • Logs into its IMAP e-mail account. • Checks the inbox folder for messages. If a message exists, the notification mailer reads the message, checking for the notification ID (NID) and node identifier in the NID line. • If the message is not a notification response, meaning it does not contain an NID line, the notification mailer moves the message to the discard folder and treats it as an unsolicited message. • If the message is a notification response, but for the wrong node, the notification mailer leaves the message in the inbox and adds the e-mail's Unique Message ID (UID) to its ignore list. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 23 • If the message is a notification response for the current node, meaning it contains an NID line including the node identifier of the current node, the notification mailer processes the message. The notification mailer performs the following steps for messages that belong to its node. • Retrieves the notification ID. • Checks to see if the message bounced by referring to the tags specified in the configuration parameters. If the message bounced, the notification mailer reroutes it or updates the notification's status and stops any further processing, depending on the specifications of the tag list. • Checks the Oracle Workflow database for this notification based on the NID line. - If the notification does not exist, meaning the notification ID or the access key in the NID line is invalid, the notification mailer moves the message to the discard folder. If the NID line is incorrectly formatted, the notification mailer moves the message to the discard folder and treats it as an unsolicited message. - If the notification exists, but is closed or canceled, the notification mailer moves the message to the discard folder and sends a Workflow Closed Mail or Workflow Canceled Mail message to the recipient role, respectively. - If the notification exists and is open, the notification mailer generates an XML representation of the message and places it on the WF_NOTIFICATION_IN agent. The notification mailer then moves the message for the completed notification to the processed folder. Finally, if there are no more unprocessed messages in the inbox, the notification mailer logs out of the mail and database accounts. When an event message is dequeued from WF_NOTIFICATION_IN, Oracle Workflow executes a seeded subscription that calls the appropriate notification response function. This function verifies the response values with the definition of the notification message’s response attributes in the database. If a response value is invalid, or if no response value is included, the notification mailer sends a Workflow Invalid Mail message to the recipient role, or, for an invalid response to a request for more information, the notification mailer sends a Workflow Invalid Open Mail (More Information Request) message to the recipient role. If the responses are valid, the notification response function records the response and completes the notification. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 24 c A Notification Mailer Setup y m e d a e l c a r O ly & On l a e n r s e t U n I c A Notification Mailer Setup You should also ensure that the Business Event System status is set to Enabled on the Configuration page, and that the JOB_QUEUE_PROCESSES database initialization parameter, which is required for the Business Event System, is set to an appropriate value. The Business Event System status is set to Enabled by default, and usually you do not need to change the status. If notification processing is not being completed, however, you should check this preference value. You can optionally set the WF: Workflow Mailer Framework Web Agent profile option to the host and port of the Web server that notification mailers should use to generate the content for Oracle Applications Framework regions that are embedded in notifications. If this profile option is not set, notification mailers will use the same Web agent specified in the Application Framework Agent profile option. However, if necessary for load balancing purposes, you can optionally specify a different Web agent for notification mailers to use. The WF: Workflow Mailer Framework Web Agent profile option should be set at site level. Before a service component can run, the container which manages it must first be started. Check that the containers for agent listeners and notification mailers are running. Also check that the Workflow Deferred Notification Agent Listener, Workflow Error Agent Listener, and Workflow Inbound Notifications Agent Listener are running. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 25 By default, the seeded Workflow Notification Mailer has a Launch Summary Notifications event scheduled to send summary notifications once a day. You can optionally use the notification mailer configuration wizard to modify the start time and interval for this event's schedule, or to schedule the Launch Summary Notifications event at the interval you choose for any notification mailer service component. When this event is processed, a summary notification is sent to each role with a notification preference of SUMMARY or SUMHTML. You can optionally configure a notification mailer to connect to the SMTP server and IMAP server through Secure Sockets Layer (SSL) to encrypt the data exchanged. You can optionally set the internal mailer parameter named HTML_DELIMITER to specify which characters the notification mailer uses to delimit response values in response templates for HTML-formatted e-mail notifications. See: Setting Up a Notification Mailer, Oracle Workflow Administrator’s Guide. The seeded Workflow Notification Mailer uses the Automatic startup mode by default and will be started automatically when you complete its configuration. If you select the Manual startup mode for a notification mailer service component, use the Service Components page to start that notification mailer. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 26 c A Connecting to Mail Servers Through SSL y m e d a e l c a r O ly & On l a e n r s e t U n I c A Connecting to Mail Servers Through SSL To use SSL, you must have loaded on the SMTP and IMAP servers an X.509 certificate and private key that were issued by a certificate authority. You can use the same certificate for both the SMTP server and the IMAP server. Additionally, to connect to the SMTP server through SSL, you must have an Stunnel process running on the SMTP server, with the location of the certificate file specified in the Stunnel arguments. Stunnel is a program that lets you encrypt connections inside SSL. For more information, see: http://www.stunnel.org You can then enable SSL for the SMTP and IMAP servers in the notification mailer configuration wizard. After completing the SSL setup, stop and restart the service component container named Workflow Mailer Service for the changes to take effect. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 27 Notification Mailer Basic Configuration y m e d a e l c a r O ly & On l a e n r s e t U n I c A Notification Mailer Basic Configuration The Basic Configuration page is the first page of the notification mailer configuration wizard. • Details - Name: The unique name of the service component. • Outbound E-mail Account (SMTP) - Server Name: The name of the outbound SMTP mail server. - Outbound SSL Enabled: Select this parameter to enable the notification mailer to use SSL for connections to the SMTP server. You must also complete additional setup steps to use SSL. • Inbound E-mail Account (IMAP) - Inbound Processing: Select this parameter to enable inbound e-mail processing with this notification mailer. Deselect this parameter to disable inbound e-mail processing for this notification mailer and dedicate the notification mailer solely to outbound processing. If you disable inbound processing, you can leave the other inbound parameters blank. - Server Name: The name of the inbound IMAP mail server. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 28 - Username: The user name of the mail account that the notification mailer uses to receive e-mail messages. - Password: The password for the mail account specified in the Username parameter. - Reply-To Address: The address of the e-mail account that receives incoming messages, to which notification responses should be sent. - Inbound SSL Enabled: Select this parameter to enable the notification mailer to use SSL for connections to the IMAP server. You must also complete additional setup steps to use SSL. To send a test message, click the Test Mailer button. On the Test Notification Mailer page, select the recipient role to which the message should be sent, and click the Send Test Message button. Then check the e-mail account for the recipient role to verify that the test message was received. To set additional parameters for this notification mailer in the advanced configuration wizard, click the Advanced button. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 29 c A Notification Mailer Advanced Configuration y m e d a e l c a r O ly & On l a e n r s e t U n I c A Notification Mailer Advanced Configuration Use the Next and Back buttons to navigate among the pages of the configuration wizard. Define Page • ID: The configuration wizard displays the identifier for the service component. • Status: The configuration wizard displays the status of the service component. • Name: The unique name of the service component. • Startup Mode: Select Automatic, Manual, or On-Demand. • Container Type: The container type to which this notification mailer belongs, which is always Oracle Applications Generic Service Management (Oracle Applications GSM). • Inbound Agent: The Business Event System agent for inbound processing. The inbound agent for a notification mailer is always WF_NOTIFICATION_IN. • Outbound Agent: The Business Event System agent for outbound processing. The outbound agent for a notification mailer is always WF_NOTIFICATION_OUT. • Correlation ID: Optionally select an item type to specify that this notification mailer should only process messages that belong to that item type. If you enter a partial value, this notification mailer will process messages that belong to any item type whose internal e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 30 name begins with that value. You can enter an item type as the correlation ID if you want to increase throughput for that particular item type by dedicating a notification mailer to it. If you leave the correlation ID blank, this notification mailer will process messages from any item type. The seeded Workflow Notification Mailer does not have any correlation ID specified, so that it can operate generally to process all messages. Details Page • ID: The configuration wizard displays the identifier for the service component. • Status: The configuration wizard displays the status of the service component. • Name: The configuration wizard displays the name defined for the service component. • Container: The container to which the service component will belong. The container for notification mailer service components is a predefined container called Workflow Mailer Service. • Maximum Idle Time: If you selected the On-Demand startup mode for the service component, enter the maximum time in minutes that the service component can remain idle before it is stopped. An on-demand component that is stopped in this way will be restarted by its container when it is needed again to process new messages. • Max Error Count: The number of consecutive errors the service component can encounter before its container stops it and changes its status to Stopped with Error. If an error is resolved and processing can continue, the error count is reset. • Inbound Thread Count: Set the inbound processing thread count to 1 to enable inbound message processing with this notification mailer. Select 0 to disable inbound message processing for this notification mailer. • Outbound Thread Count: Specify the number of outbound processing threads you want to execute simultaneously with this notification mailer. You can set the outbound thread count to 1 or more depending on the volume of outbound messages you need to send. Specify 0 to disable outbound message processing for this notification mailer. • Log Level: Select the level of detail for the information you want to record in the service component container log. • Processor Read Wait Timeout: Specify the amount of time in seconds that the service component’s processing thread continues to wait, after reading the last message from its assigned queue, before timing out. If another message is received before this time expires, that message is processed and the timeout period begins again. If the timeout period expires and no more messages have been received, the service component stops reading and its sleep time begins. • Processor Min Loop Sleep: Specify the minimum sleep time in seconds during which the service component waits, after its read timeout period expires, before it checks its queue for messages again. • Processor Max Loop Sleep: Specify the maximum sleep time in seconds if you want to increase the sleep time between read attempts when no messages are received. If you specify a maximum sleep time that is greater than the minimum sleep time, then the service component initially waits for the minimum sleep time after it finishes reading messages from its queue. If no messages are read in subsequent attempts, then the sleep time between read attempts gradually increases until the maximum sleep time is reached. Increasing the sleep time can help enhance performance if messages are received y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 31 c A infrequently. You can also specify 0 for this parameter to indicate that the sleep time should not be increased. In this case, the service component always waits for the minimum sleep time between read attempts. • Processor Error Loop Sleep: Specify the sleep time in seconds during which the service component waits, after an error occurs, before it attempts to begin processing again. • Processor Close on Read Timeout: Select this parameter to specify that the service component should close its connections after its read timeout period expires, when its sleep time begins. Deselect this parameter to specify that the connections should remain open until the processing thread stops. E-mail Servers Page General • Mailer Node Name: The node identifier name used by this notification mailer. The maximum length of the node name is eight characters. The node name is included with the outgoing notification ID in outbound messages, and is used in inbound messages to identify the notification mailer that should process the messages. • Email Parser: The Java class used to parse an incoming notification response e-mail and create an XML document for the response. The standard default e-mail parser provided by Oracle Workflow is named oracle.apps.fnd.wf.mailer.TemplatedEmailParser. Usually you do not need to change this value. • Alternate Email Parser: The Java class used to parse an incoming notification response email formatted according to the direct response method and to create an XML document for the response. The notification mailer uses this parser when the Direct Response parameter is selected. The default alternate e-mail parser provided by Oracle Workflow is named oracle.apps.fnd.wf.mailer.DirectEmailParser. Usually you do not need to change this value. • Expunge Inbox on Close: Select this parameter to purge deleted messages from the inbox folder when the notification mailer closes this folder. If you do not select this parameter, copies of messages that were moved to the discard or processed folders remain in the inbox, in a deleted state, until you manually expunge them using your e-mail application. Inbound E-mail Account • Inbound Protocol: Oracle Workflow supports the IMAP protocol for inbound e-mail. • Inbound Server Name: The name of the inbound mail server. • Username: The user name of the mail account that the notification mailer uses to receive e-mail messages. • Password: The password for the mail account specified in the Username parameter. • Inbox Folder: The name of the folder from which the notification mailer receives inbound messages. This value is case-insensitive. The default value is INBOX. • Inbound Connection Timeout: The maximum amount of time in seconds that the notification mailer will wait to establish a connection to the inbound server before timing out. • Inbound Message Fetch Size: The maximum number of messages that the notification mailer can fetch from the inbox at one time. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 32 c A • Maximum Ignore List Size: The maximum number of notification IDs that the notification mailer can store in its ignore list, indicating that this notification mailer will make no further attempts to process them after encountering errors. Usually you do not need to change this value. • Inbound SSL Enabled: Select this parameter to enable the notification mailer to use SSL for connections to the IMAP server. You must also complete additional setup steps to use SSL. Outbound E-mail Account • Outbound Protocol: Oracle Workflow supports the SMTP protocol for outbound e-mail. • Outbound Server Name: The name of the outbound mail server. • Test Address: This parameter has been replaced by the override e-mail address, which is available through the Component Details page for a notification mailer. • Outbound Connection Timeout: The maximum amount of time, in seconds, that the notification mailer will wait to establish a connection to the outbound server before timing out. • Outbound SSL Enabled - Select this parameter to enable the notification mailer to use Secure Sockets Layer (SSL) for connections to the SMTP server. You must also complete additional setup steps to use SSL. E-mail Processing • Processed Folder: The name of the mail folder where the notification mailer places successfully processed notification messages. This value is case-insensitive. The default value is PROCESS. • Discard Folder: The name of the mail folder where the notification mailer places incoming messages that are not recognized as notification messages. This value is case-insensitive. The default value is DISCARD. • Allow Forwarded Response: Indicate whether to allow a user to respond by e-mail to an email notification that has been forwarded from another role. Message Generation Page Send • From: The value that appears in the From field of the message header of a notification email. • Reply-to Address: The address of the e-mail account that receives incoming messages, to which notification responses should be sent. • HTML Agent: The base URL that identifies the HTML agent that handles HTML notification responses. This URL is required to support e-mail notifications with HTML attachments. • Message Formatter: Oracle Workflow uses the oracle.apps.fnd.wf.mailer.NotificationFormatter Java class to generate notification messages. • Framework User: The numerical user ID for the user through which a notification mailer accesses Oracle Application Framework content for inclusion in e-mail notifications. The Framework user must have workflow administrator privileges in order to access the content for every user's notifications. If you change the Workflow System Administrator y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 33 c A • • • • • • • • • • preference, check the Framework User parameter to ensure that the user accessed by the notification mailer has workflow administrator privileges. Set the Framework User parameter to a user that is a member of the Workflow System Administrator role, or, if you set the Workflow System Administrator preference to a responsibility, set the Framework User parameter to a user that has that responsibility. Framework Responsibility: The numerical responsibility ID for the responsibility through which a notification mailer accesses Oracle Application Framework content for inclusion in e-mail notifications. The user specified in the Framework User parameter must have this responsibility assigned. Framework Application ID: The numerical application ID for the application through which a notification mailer accesses Oracle Application Framework content for inclusion in e-mail notifications. The responsibility specified in the Framework Responsibility parameter must be assigned to this application. Framework URL Timeout: The maximum amount of time, in seconds, that the notification mailer will wait to access a URL for Oracle Application Framework content before timing out. Attach Images to Outbound Emails: Select this parameter to attach any images referenced in HTML content included in a message, such as Oracle Application Framework content, to outbound notification e-mail messages. Deselect this parameter to display the image references as off-page URLs. Attach Stylesheet to Outbound Email: Select this parameter to attach any stylesheet referenced in HTML content included in a message, such as Oracle Application Framework content, to outbound notification e-mail messages. Deselect this parameter to display the stylesheet reference as a URL. Autoclose FYI: Indicate whether this notification mailer automatically closes notifications that do not require a response, such as FYI (For Your Information) notifications, after sending the notifications by e-mail. Direct Response: By default, notification mailers require a response format for plain text notifications called the templated response method. Select this parameter to use the direct response method instead. Reset NLS: Indicate whether the notification mailer should convert the NLS codeset for a notification message according to the notification recipient's preferences before composing the message. Inline Attachments: Select this parameter to set the Content-Disposition MIME header to inline for attachments to notification messages, including the Notification Detail Link, HTML Message Body, Notification References containing attached URLs, and attached PL/SQL documents. Deselect this parameter to set the Content-Disposition MIME header to attachment for these attachments. For example, if your e-mail application cannot display HTML content such as the Notification Detail Link inline, deselect this parameter to display this link as an attachment instead. Send Warning for Unsolicited E-mail: Select this parameter to allow the notification mailer to send back a warning message the first time it receives an unsolicited e-mail message from a particular e-mail address. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 34 c A • Send E-mails for Canceled Notifications: Select this parameter to allow the notification mailer to send cancellation messages to users when previously sent notifications are canceled. Templates This region lets you specify the message templates you want to use to generate e-mail notifications. The template for a particular type of e-mail notification determines the basic format of the notification, including what header information to include, and whether and where to include details such as the message due date and priority. Oracle Workflow provides a set of standard templates in the System: Mailer item type, which are used by default. It is not recommended to modify the standard templates. However, you can customize the message templates used to send your e-mail notifications by assigning a notification mailer alternative templates provided by Oracle Workflow or custom templates that you create in Oracle Workflow Builder. The templates assigned to a mailer override the default System: Mailer templates. Scheduling Events Page You can schedule the following events to be raised to control the running of a notification mailer. • Start • Refresh • Suspend • Resume • Stop • Launch Summary Notifications Click the Add a Row or Add Another Row button to add a new row to the list of events and enter the information for the event. • Select the event for the command you want to schedule. • Select the date when you want the event to be raised first. • Select the hour and minute to specify the time on the specified date when you want the event to be raised first. The hour values are in a twenty-four hour format. For example, select 00 for midnight, or 23 for 11 PM. • If you want to raise the event periodically, enter the time interval in minutes at which you want to raise the event. If you do not specify a repeating interval, the event is raised only once. • If you choose the refresh event, you can optionally enter parameters to refresh the notification mailer configuration parameters with those values when the event is raised. Tags Page This page lets you enter patterns of text found in unusual messages and the status you want to assign to an inbound message if it contains any of those patterns. For example, unusual messages include bounced or returned messages and auto-reply messages such as those sent by vacation daemons, mass mailing lists, and so on. Since different mail systems vary in how they identify bounced, undeliverable, or otherwise invalid messages, you can use notification mailer tags to specify how your mail system identifies those stray messages and how you want the notification mailer to handle those messages should it come across them. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 35 c A Oracle Workflow provides several predefined tags for text commonly found in undeliverable or auto-reply messages. The notification mailer handles messages according to these mail status values, as follows: • UNDELVRD: Moves the message to the discard folder and updates the notification's mail status to FAILED. Additionally, the notification preference of the recipient of the notification is updated to DISABLED. No error process is initiated for this notification activity. However, after correcting the issues that prevented the e-mail from being sent, you can reset the user's notification preference and then run the Resend Failed Workflow Notifications program to re-enqueue failed notifications on the notification mailer's outbound queue. • Unavailable: Moves the message to the discard folder and continues waiting for a reply to the notification since the notification's status is still OPEN, but its mail status is updated to UNAVAIL. This status is purely informative, as no further processing occurs with this notification. • Ignore: Moves the message to the discard folder and continues waiting for a valid reply to the open notification. The notification's status is still OPEN and its mail status is still SENT. You can define additional tags for other patterns you want the notification mailer to handle automatically. To add a new tag, click the Add Another Row button, enter the text pattern in the Pattern column, and select the status you want to assign to messages containing that pattern in the Action column. Test Page This page lets you test the notification mailer configuration by sending a sample notification message. Select the recipient role to which the message should be sent, and click the Send Test Message button. Then check the e-mail account for the recipient role to verify that the test message was received. Review Page If you want to change any of these settings, return to the appropriate step in the notification mailer configuration wizard to make your changes. To save these settings and finish the configuration, click the Finish button. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 36 c A Component Details for Notification Mailers y m e d a e l c a r O ly & On l a e n r s e t U n I c A Component Details for Notification Mailers Click the Test Mailer button to send a test message. On the Test Notification Mailer page, select the recipient role to which the message should be sent, and click the Send Test Message button. Then check the e-mail account for the recipient role to verify that the test message was received. Click the Set Override Address button to set an override address where you want to send all outgoing e-mail notifications. Use an override address when you are testing workflow definitions or mailer processing so that you can automatically receive all the test notifications at one e-mail address, instead of having to check or change each individual recipient's e-mail address. To ensure that the override address is accessible and that its use is authorized, you must verify the request before the notification mailer can use the address. • On the Set Override Address page, review the current override address, if any. Enter the email address you want to set as the new override address, and select Submit. Then check the e-mail account that you specified for the verification e-mail message. • On the Verify Override Address page, enter the verification code shown in the e-mail message, and click Apply. If necessary, you can use the link provided in the verification e- e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 37 mail message to navigate back to the Verify Override Address page. You must log in to Oracle Applications Manager before you can access this page. • To remove the override address, navigate to the Set Override Address page and click the Clear Override Address button. The notification mailer then resumes sending e-mail notifications to the individual recipients' e-mail addresses. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 38 c A Notification Mailer Throughput y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 39 c A Guided Demonstration - Service Components 1. Access Oracle Applications Manager by connecting to a Workflow administrator responsibility as a user with workflow administrator privileges and clicking the Workflow Manager link. 2. On the Workflow System page, click the Service Components status icon and review the types and statuses of service components that are configured in this instance. 3. Select a service component and click View Log to view the log of the container to which this service component belongs. Close the log window when you are finished reviewing the log. 4. Select a service component and click View Details to review the configuration of that service component. Click OK. 5. Select a service component and click View Event History to review the events that have been scheduled to control the running of that service component. 6. Click Workflow in the locator links at the top of the page to navigate back to the Workflow System page. 7. Click the Agent Listeners status icon to navigate to the Service Components page with the list filtered to show only agent listener service components. Review statuses of the standard agent listeners provided by Oracle Workflow, such as Workflow Deferred Agent Listener, Workflow Error Agent Listener, and Workflow Inbound Notifications Agent Listener. You can also click View Details for these agent listeners to review their configurations. 8. Navigate back to the Workflow System page. 9. Click the Notification Mailers status icon to navigate to the Service Components page with the list filtered to show only notification mailer service components. y m e d a e l c a r O ly & On l a e n r s e t U n I c A 10. Review the status of the standard Workflow Notification Mailer service component provided by Oracle Workflow. Select this service component and click Edit to review the basic notification mailer configuration. Review the following parameters: − Outbound E-mail Account (SMTP): Server Name - The name of the outbound SMTP mail server. − Inbound E-mail Account (IMAP): Inbound Processing - Enable or disable inbound e-mail processing with this notification mailer. − Inbound E-mail Account (IMAP): Server Name - The name of the inbound IMAP mail server. − Inbound E-mail Account (IMAP): Username - The user name of the mail account that the notification mailer uses to receive e-mail messages. − Inbound E-mail Account (IMAP): Password - The password for the mail account that the notification mailer uses. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 40 − Inbound E-mail Account (IMAP): Reply-To Address - The address of the e-mail account that receives incoming messages. 11. Select Advanced to access the advanced notification mailer configuration wizard. On the Define, Details, Email Servers, Message Generation, Scheduling Events, Tags, and Test pages, review the parameters shown and click Next. On the Review page, click Finish. 12. Navigate back to the Workflow System page. 13. In the Related Links > Throughput region, click the Notification Mailers link to review the mailer throughput graph. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 41 c A Handling Notification Mailer Errors y m e d a e l c a r O ly & On l a e n r s e t U n I c A Handling Notification Mailer Errors For additional information about error handling scripts, diagnostic tests, and concurrent programs, see: Handling Mailer Errors, Oracle Workflow Administrator’s Guide. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 42 Summary y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 43 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing Service Components Chapter 28 - Page 44 c A Managing System Status and Throughput y m Chapter 29 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 2 c A Managing System Status and Throughput y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 3 c A Objectives y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 4 c A Workflow System Status y m e d a e l c a r O ly & On l a e n r s e t U n I c A Workflow System Status The Workflow System page also includes the following: System Status You can also click the Notification Mailers, Agent Listeners, or Service Components status icons to manage those components. Additionally, you can also select an Oracle Workflow feature that runs as a concurrent program from the Submit Request For pull-down menu and click the Go button. You can submit requests for background engines, purging, and control queue cleanup. Related Database Parameters This region lets you review actual and recommended values for the database initialization parameters that are required for Oracle Workflow. Workflow Metrics • Work Items: To view the distribution of item types within a status, either select the bar for that status in the graph, or click the status name link. Note: A work item can be counted in more than one status. For example, all work items that do not have an end date are counted as Active work items, including deferred, e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 5 suspended, and errored work items as well as running work items. Also, if an activity within an item is deferred, and the work item as a whole is suspended, the work item is included in the count for both the Deferred and Suspended statuses. Consequently, the total of the counts for all the statuses is greater than the actual number of work items. • Agent Activity: To view the distribution of event messages with different statuses on different agents, either select the bar for a status in the graph, or select an event message status name link. Note: Messages are not explicitly assigned a status of Error. The Error bar in the graph represents messages of any status on the WF_ERROR agent. Related Links • Configuration - Click the Service Components link to configure service components, including notification mailers and agent listeners. - Click the Queue Propagation link to view a list of propagation schedules for Business Event System agents. • Throughput - Click the Work Items link to view the distribution of completed work items across different item types. - Click the Notification Mailer link to view the notification mailer throughput. Gathering Oracle Workflow Statistics Some Oracle Workflow Manager graphs and lists may summarize large volumes of data, depending on the level of activity in your Oracle Applications instance. To enhance performance in displaying these statistics, Oracle Workflow Manager periodically runs concurrent programs to gather the statistics and displays the graphs and lists based on the latest data from the concurrent programs. • Workflow Agent Activity Statistics program: Gathers statistics for the Agent Activity graph on the Workflow System status page and for the agent activity list on the Agent Activity page. • Workflow Mailer Statistics program: Gathers statistics for the throughput graph on the Notification Mailer Throughput page. • Workflow Work Items Statistics program: Gathers statistics for the Work Items graph on the Workflow System status page, for the Completed Work Items list on the Workflow Purge page, and for the work item lists on the Active Work Items, Deferred Work Items, Suspended Work Items, and Errored Work Items pages. These concurrent programs are scheduled to run every 24 hours by default. They do not require any parameters. You can optionally cancel the default scheduled requests and run the programs with a different schedule if you want to gather statistics at a different frequency. Each of these graphs and lists displays the date and time when its statistics were last updated, as well as a refresh icon that you can click to refresh the statistics immediately if necessary. However, note that if your Oracle Applications instance contains very large volumes of workflow data, you may encounter delays or page timeouts when refreshing the data. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 6 c A Workflow Status in Oracle Applications Manager y m e d a e l c a r O ly & On l a e n r s e t U n I c A Oracle Applications Manager Diagnostics Oracle Workflow provides the following diagnostic tests. • Duplicate User Test: Checks the Oracle Workflow directory service to verify that there are no roles in the WF_LOCAL_ROLES table with the same internal name, originating system, and originating system ID. • Notification Preference Validation Test: Checks the Oracle Workflow directory service to ensure that all roles with a notification preference for receiving e-mail notifications have an e-mail address defined. • Rule Function Validation Test: Checks the rule functions defined for subscriptions and the generate functions defined for events in the Business Event System. • GSM Setup Test: Checks the Generic Service Management (GSM) setup required for Oracle Workflow in Oracle Applications Manager. • BES Clone Test: Checks certain standard agents and subscriptions required for internal Business Event System and notification mailer processing to verify that they are enabled and that their definitions include the correct local system. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 7 • GSC Control Queue Test: Verifies that the Workflow control queue, WF_CONTROL, is properly accessible. • Workflow Advanced Queue Rule Validation Test: Checks the standard WF_ERROR and WF_DEFERRED queues to verify that only one subscriber rule is defined for each queue. • Workflow Agents/AQ Status Test: Checks the Business Event System agents for Oracle Workflow and Oracle XML Gateway, as well as the queues associated with these agents. • Workflow Objects Validity Test: Checks the Oracle Workflow and Oracle XML Gateway database objects to verify that all the objects are valid. • XML Parser Installation Test: Checks your Oracle Applications installation to verify that the Oracle XML parser is installed and valid. • Mailer Component Test: Checks your notification mailer service components to verify that at least one notification mailer has been configured with all the parameters needed to run it. • Mailer Component Parameter Test: Checks your notification mailer service components to validate their configuration parameters. • Event Diagnostic Test: Reports details about the Business Event System, including the statuses of the local system and agent listeners, details about the definitions of the specified event and any subscriptions to that event, and details about the specified instance of the event if it appears on a standard deferred or error queue. • Event Raise Test: Checks the basic operation of the Business Event System by raising a test event from Java and from PL/SQL and executing synchronous and asynchronous subscriptions to that event. • Mailer Diagnostic Test: Reports details about a notification and about the notification mailer that sent the notification. Logging Oracle Workflow uses the Oracle Applications Logging framework to standardize and centralize in the database logging activities related to the Oracle Workflow Business Event System and Oracle XML Gateway. Note: The Java middle tier components of Oracle Workflow, including notification mailers and agent listeners, also use Oracle Applications Logging; however, due to the high volume of messages that pass through these components, their information is logged to the file system by default. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 8 c A Oracle Workflow Administration y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 9 c A Work Items y m e d a e l c a r O ly & On l a e n r s e t U n I c A Work Items Review the number of work items in different statuses to monitor Workflow Engine processing and identify any possible bottlenecks. For example, an abnormal number of activities with a deferred status may indicate that there are not enough background engines available. Information about completed work items is available through the Workflow Purge page. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 10 Work Items y m e d a e l c a r O ly & On l a e n r s e t U n I c A Work Items Work Items To filter the item types displayed in the list, select an item type property and an operator from the Filter pull-down menus, enter a filter value in the text field, and click the Go button. You can filter by the following properties: • Work item type display name • Work item type internal name • Number of work items of this type Note: When you drill down to active work items, all work items that do not have an end date are counted as active work items in this page, including deferred, suspended, and errored work items as well as running work items. Work Item Details By default, the lists of active or deferred work items show only work items that started within the last 30 days, because there may be large numbers of work items in these statuses. However, the lists of suspended or errored work items show work items that started at any time, by default. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 11 To view work items that started within a specific period, enter a number of days in the Filter: Start Date Within Last _ Days option and click the Go button. Note: When you drill down to active work items, only activities with a status of Active, Waiting, or Notified are included on this page. Activities with a status of Deferred, Suspended, or Error are not included on this page, although the work items to which they belong are counted as active work items. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 12 c A Work Items y m e d a e l c a r O ly & On l a e n r s e t U n I c A Work Items Work Item Activity Details By default, the lists of active or deferred work items show only work items that started within the last 30 days, because there may be large numbers of work items in these statuses. However, the lists of suspended or errored work items show work items that started at any time, by default. To filter the work items displayed in the list, select an activity property from the Filter By pulldown menu, enter a filter value in the text field, and click the Go button. You can filter by the following properties: • Internal name of the work item activity • Start date within a specified number of days • Due date within a specified number of days • User assigned to perform the activity • Item key of the work item Note: When you drill down to active work items, only activities with a status of Active, Waiting, or Notified are included on this page. Activities with a status of Deferred, Suspended, e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 13 or Error are not included on this page, although the work items to which they belong are counted as Active work items. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 14 c A Oracle Workflow Administration y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 15 c A Purging Workflow Data y m e d a e l c a r O ly & On l a e n r s e t U n I c A Purging Workflow Data Note: The Purge APIs are provided to let developers and administrators perform manual purging when necessary. However, it is recommended that you submit purge requests from Oracle Workflow Manager because this tool centralizes workflow management functionality and lets you review the completed work items eligible for purging before you perform the purge. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 16 Purging Workflow Data y m e d a e l c a r O ly & On l a e n r s e t U n I c A Purging Workflow Data The persistence type of an item type controls when runtime status information for work items of that type becomes eligible for purging. The persistence values are: • Temporary: Item will be eligible to be deleted in n days • Permanent: Item will be deleted only when forced Note: For a work item to be considered eligible for purging, all activities must be complete. This requirement includes FYI notifications, which must be closed. The Purge Obsolete Workflow Runtime Data program purges obsolete run-time information associated with work items, including status information and any associated notifications and Oracle XML Gateway transactions. By default, it also purges obsolete design information, such as activities that are no longer in use and expired ad hoc users and roles, and obsolete run-time information not associated with work items, such as notifications or Oracle XML Gateway transactions that were not handled through a workflow process. You can optionally choose to purge only core run-time information associated with work items for performance gain during periods of high activity, and purge all obsolete information as part of your routine maintenance during periods of low activity. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 17 To preserve electronic signature evidence for future reference, this program by default does not delete any notifications that required signatures or their associated signature information. If you do not need to maintain signature evidence, you can choose to delete signature-related information as well. Note: You can also use the Purge Obsolete ECX Data concurrent program to purge Oracle XML Gateway transactions according to Oracle XML Gateway-specific parameters. See: Purge Obsolete ECX Data Concurrent Program, Oracle XML Gateway User's Guide. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 18 c A Purging Workflow Data y m e d a e l c a r O ly & On l a e n r s e t U n I c A Purging in Oracle E-Business Suite You can also access the Workflow Purge page from the Workflow System page by selecting the Purge status icon. You can also submit a request for the Purge Obsolete Workflow Runtime Data concurrent program by selecting Purge from the Submit Request For pull-down menu on the Workflow System page and clicking the Go button. Parameters • Item Type: Specify the item type to purge. Leave this field blank to purge the run-time data for all item types. • Item Key: Specify the item key to purge. The item key is a unique identifier for an item within an item type. Leave this field blank to purge the run-time data for all items of the specified item type. • Age: Specify the minimum age of data to purge, in days, if you are purging items with a Temporary persistence type. The default is 0 days. • Persistence Type: Specify the persistence type of the data you want to purge, either Permanent or Temporary. The default is Temporary. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 19 • Core Workflow Only: Enter Y to purge only obsolete run-time data associated with work items, or N to purge all obsolete run-time data as well obsolete design data. The default is N. • Commit Frequency: Enter the number of records to purge before the program commits data. To reduce rollback size and improve performance, set this parameter to commit data after a smaller number of records. The default is 500 records. • Signed Notifications: Enter N to preserve signature evidence, including notifications that required electronic signatures and their associated signature information. Enter Y to purge signature-related information. The default is N. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 20 c A Completed Work Items y m e d a e l c a r O ly & On l a e n r s e t U n I c A Completed Work Items Note: These pages show information for completed work items that have not yet been purged. Work items that have already been purged will no longer appear, because their information is no longer stored in the Oracle Workflow tables. Completed Work Items To filter the item types displayed in the list, select an item type property and an operator from the Filter pull-down menus, enter a filter value in the text field, and click the Go button. You can filter by the following properties: • Work item type display name • Work item type internal name • Persistence type • Retention period • Number of completed work items of this type • Number of items of this type available for purging You can also drill down by clicking the item type link in the Work Item Type column. Completed Work Item Details e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 21 By default, the list shows unpurged, completed work items that ended within the last 30 days, because there may be large numbers of work items in this status. To view unpurged, completed work items that ended within a different period, enter a number of days in the Filter: End Date Within Last _ Days option and click the Go button. You can also drill down by clicking the activity stage link in the Work Item Activity Stage column. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 22 c A Completed Work Items y m e d a e l c a r O ly & On l a e n r s e t U n I c A Completed Work Items Note: This page shows information for completed work items that have not yet been purged. Work items that have already been purged will no longer appear, because their information is no longer stored in the Oracle Workflow tables. Completed Work Item Activity Details By default, the list shows unpurged, completed work items that ended within the last 30 days, because there may be large numbers of work items in this status. To filter the work items displayed in the list, select an activity property from the Filter pulldown menu, enter a filter value in the text field, and click the Go button. You can filter by the following properties: • Internal name of the activity at which the work item ended • Start date within a specified number of days • End date within a specified number of days • User assigned to perform the activity • Item key of the work item e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 23 Workflow Purge APIs y m e d a e l c a r O ly & On l a e n r s e t U n I c A Workflow Purge APIs Many of the purge APIs in the WF_PURGE package accept the following parameters: • Item Type: The item type associated with the obsolete run-time data that you want to delete. Leave this parameter null to delete obsolete data for all item types. • Item Key: The string generated from the application object’s primary key that uniquely identifies the item within an item type. Leave this parameter null to purge all items in the specified item type. • End Date: A specified date to delete up to. Note: Most of the WF_PURGE APIs only purge data associated with Temporary item types whose persistence, in days, has expired. Use the WF_PURGE.TotalPERM API to delete all eligible obsolete run-time data associated with item types of with a persistence type of Permanent. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 24 Oracle Workflow Administration y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 25 c A Background Engines y m e d a e l c a r O ly & On l a e n r s e t U n I c A Background Engines You can set up as many background engines as you need, but if you set up only one, then that background engine must handle both deferred and timed out activities as well as stuck processes. Generally, you should run a separate background engine to check for stuck processes at less frequent intervals than the background engine that you run for deferred or timed out activities, normally not more often than once a day. Run the background engine to check for stuck processes when the load on the system is low. Do not run more background engines concurrently than your server has CPU processors. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 26 Background Engines y m e d a e l c a r O ly & On l a e n r s e t U n I c A Background Engines When you start a new background engine, you can restrict the engine to handle activities associated with specific item types, and within specific cost ranges. You can submit the Workflow Background Process concurrent program several times to schedule different background engines to run at different times. Parameters • Item Type: Specify an item type to restrict this engine to activities associated with that item type. If you do not specify an item type, the engine processes any activity regardless of its item type. • Minimum Threshold: Specify the minimum cost that an activity must have for this background engine to execute it, in hundredths of a second. • Maximum Threshold: Specify the maximum cost that an activity can have for this background engine to execute it, in hundredths of a second. By using Minimum Threshold and Maximum Threshold you can create multiple background engines to handle very specific types of activities. For example, if you only want to process activities with a certain cost, you can set both the Minimum Threshold and the Maximum Threshold to that e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 27 value. The default values for these arguments are 0 and 100 so that the background engine runs activities regardless of cost. • Process Deferred: Specify whether this background engine checks for deferred activities. • Process Timeout: Specify whether this background engine checks for activities that have timed out. • Process Stuck: Specify whether this background engine checks for stuck processes. y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 28 c A Oracle Workflow Administration y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 29 c A Control Queue Cleanup y m e d a e l c a r O ly & On l a e n r s e t U n I c A Control Queue Cleanup The recommended frequency for performing cleanup is every 12 hours. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 30 Control Queue Cleanup y m e d a e l c a r O ly & On l a e n r s e t U n I c A Control Queue Cleanup The Workflow Control Queue Cleanup concurrent program is automatically scheduled to run every 12 hours by default. You can optionally submit this program with a different schedule. This program does not require any parameters. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 31 Oracle Workflow Administration y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 32 c A Queue Propagation y m e d a e l c a r O ly & On l a e n r s e t U n I c A Queue Propagation You should schedule propagation for your local outbound Business Event System agents to send event messages to their destinations. A propagation schedule is defined for an outbound queue and a specified destination, which can be either a remote database link or the local system. If you want to use the standard WF_OUT and WF_JMS_OUT agents or custom agents for event message propagation, ensure that you schedule propagation for those agents. Note: You do not need to schedule propagation for the WF_CONTROL or WF_NOTIFICATION_OUT agents, however, because the middle tier processes that use WF_CONTROL dequeue messages directly from its queue, and a notification mailer sends messages placed on the WF_NOTIFICATION_OUT queue. The Queue Propagation page shows information to let you determine the status of a propagation schedule, including the job queue process executing the schedule, whether the schedule is enabled or disabled, and the error date and error message of the last unsuccessful execution. For example, if no process is allocated to execute the schedule, you may need to increase the JOB_QUEUE_PROCESSES database initialization parameter to ensure that processes are available for propagation. If the propagation schedule is disabled, you must enable it before it can be executed. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 33 Oracle Workflow Administration y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 34 c A Agent Activity y m e d a e l c a r O ly & On l a e n r s e t U n I c A Agent Activity Review the number of messages in different statuses on your local agents to monitor event message processing and identify any possible bottlenecks. For example, if an inbound agent has an abnormally large number of messages with a status of Ready, you may need to check the status of the agent listener processing message for that agent, or configure a new agent listener service component for that agent. Similarly, if an outbound agent has an abnormally large number of messages with a status of Ready, you may need to check the status of the propagation schedule for that agent’s queue, or schedule propagation if necessary. Note: The Agent Activity page displays event messages on the WF_ERROR agent according to their explicitly assigned status on the WF_ERROR queue, unlike the Agent Activity graph in the Workflow System page which summarizes all messages on the WF_ERROR agent in an Error status. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 35 Searching Messages on an Agent y m e d a e l c a r O ly & On l a e n r s e t U n I c A Searching Messages on an Agent The icon in the View XML column is disabled if the event data for a message is empty. You can also search Oracle XML Gateway queues with these payload types: • SYSTEM.ECXMSG • SYSTEM.ECX_INENGOBJ For the Oracle XML Gateway payload types, the Search Queue page provides different filter criteria and message details that are specific to Oracle XML Gateway messages. e l c a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 36 Guided Demonstration - System Status and Throughput 1. Access Oracle Applications Manager by connecting to a Workflow administrator responsibility as a user with workflow administrator privileges and clicking the Workflow Manager link. 2. On the Workflow System page, click the Show link for the Work Items graph in the Workflow Metrics region. 3. Drill down to Active work items by selecting the Active bar in the graph. 4. Select a work item type and click View Details. If necessary, enter a value in the Filter Start Date Within Last _ Days field and click Go to display details that are not displayed by default. 5. Select a work item activity stage and click View Details. 6. Select a work item activity and click Suspend. Click OK on the confirmation pages. 7. Select Suspended Work Items from the View menu and click Go. 8. Select the same work item type and click View Details. 9. Select the same work item activity stage and click View Details. y m e d a 10. Select the same work item activity and click Resume. Click OK on the confirmation pages. c A 11. Select Deferred Work Items from the View menu and click Go. Drill down to view the further details. Note that large numbers of deferred work items may indicate that you need to run more background engines. e l c a r O ly & On l a e n r s e t U n I 12. Click Workflow in the locator links at the top of the page to navigate back to the Workflow System page. 13. Select Background Engines from the Submit Request For menu and click Go to submit the concurrent request through Oracle Self-Service Web Applications. • Click Next and enter the following parameters: − Item Type: <select an item type display name> − Process Deferred: Yes − Process Timeout: No − Process Stuck: No • Click Next on each remaining page of the wizard until the Summary page, and then click Submit. e l c a r O 14. Navigate back to the Workflow System status page. Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 37 15. Select the Error bar in the Work Items graph. Drill down to view the further details. 16. Navigate back to the Workflow System status page. 17. In the Related Links > Throughput region, select Work Items. 18. In the Completed Work Items region, select a work item type and click View Details. If necessary, enter a value to in the Filter End Date Within Last _ Days field and click Go to display details that are not displayed by default. 19. Select a work item activity stage and click View Details. 20. Select Completed Work Items from the View menu and click Go to return to the Workflow Purge page. 21. Click the Purge button to submit a request for the Purge Obsolete Workflow Runtime Data concurrent program through Oracle Self-Service Web Applications. • Click Next and select the item type to purge in the Item Type parameter. Leave the other parameters blank. • Click Next on each remaining page of the wizard until the Summary page, and then click Submit. y m 22. Navigate back to the Workflow Purge page and check for the item type that you purged in the Completed Work Items region to confirm that the eligible items of that type have been purged. e d a c A 23. You can also use SQL*Plus to manually review and purge work items. In SQL*Plus, review the contents of a Workflow run-time table such as WF_ITEM_ACTIVITY STATUSES. For example: e l c a r O ly & On l a e n r s e t U n I SELECT ITEM_TYPE,ITEM_KEY, PROCESS_ACTIVITY, ACTIVITY_STATUS FROM WF_ITEM_ACTIVITY_STATUSES WHERE ITEM_TYPE LIKE ‘WF%’; 24. In SQL*Plus, run the WF_PURGE.Total API with appropriate parameters to purge another item type. For example: Exec WF_PURGE.Total('<itemtype>'); 25. In SQL*Plus, review the contents of the WF_ITEM_ACTIVITY STATUSES table again to show that the data has been purged. e l c 26. Navigate back to the Workflow System page in Oracle Workflow Manager. a r O 27. Select Control Queue Cleanup from the Submit Request For menu and click Go to submit the concurrent request through Oracle Self-Service Web Applications. Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 38 • Click Next on each page of the wizard until the Summary page, and then click Submit. This program does not require any parameters. 28. Navigate back to the Workflow System page. 29. Click the Show link for the Agent Activity graph in the Workflow Metrics region. 30. Drill down by selecting a status bar in the graph. 31. Click an agent link in the Agent column to view details about the queue associated with that agent. Then click OK. 32. Select an agent with messages on it and select Search Agent Entry Details. 33. Select a time period in the Enqueue Date field in the Search Criteria region, and click Go. 34. Click the icon in the View XML column for a message. Note that the View XML icon is disabled if the event data within the event message is empty. 35. Navigate back to the Workflow System page. 36. In the Related Links > Configuration region, click the Queue Propagation link. y m 37. Select a queue schedule and click View Details. e d a 38. Navigate back to the Workflow System page and review the overall status as shown by the status icons at the beginning of the page. e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 39 c A Summary y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Managing System Status and Throughput Chapter 29 - Page 40 c A Sample Solutions y m Chapter 30 e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 1 c A y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 2 c A Sample Solutions y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 3 c A Overview y m e d a e l c a r O ly & On l a e n r s e t U n I c A Overview • wfvacxx.html: HTML message body • wfvacxxc.sql: Script to create the WFVACXX_VACATION_SCHEDULE table and its index • wfvacxxs.sql: Script to create the WFVACXX package specification • wfvacxxb.sql: Script to create the WFVACXX package body • wfvacxxd.sql: Script to drop the WFVACXX_VACATION_SCHEDULE table, its index, and the WFVACXX package • wfslctxx.sql: Script to launch work items without specifying the process to start e l c a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 4 Vacation Proposal Process Sketch y m e d a e l c a r O ly & On l a e n r s e t U n I c A Vacation Proposal Process Sketch This sketch shows a sample plan for the Vacation Proposal process as described in the Planning a Workflow Process practice. e l c a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 5 wfvacxx.html y m e d a wfvacxx.html e l c a r O ly & On l a e n r s e t U n I c A <TABLE> <TR><TD><img SRC="/OA_MEDIA/calendar.gif"></TD></TR> <TR><TD>Vacation Proposal from <B>&REQUESTOR</B> for <B>&FROM_DATE</B> to <B>&TO_DATE</B></TD></TR> </TABLE> Please approve vacation as proposed or suggest alternate dates. e l c a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 6 wfvacxxc.sql y m e d a wfvacxxc.sql e l c a r O ly & On l a e n r s e t U n I c A /*=======================================================================+ | Copyright (c) 1995 Oracle Corporation Redwood Shores, California, USA| | All rights reserved. | +=======================================================================+ | FILENAME | wfvacxxc.sql | | DESCRIPTION | Create Workflow Vacation Schedule table and index | NOTES | This file is a SAMPLE that should be modified with your own | names before installing. Names that include | XX should be replaced with values for your implementation. | *=======================================================================*/ e l c a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 7 /* $Header$ */ whenever sqlerror continue; drop table WFVACXX_VACATION_SCHEDULE; create table WFVACXX_VACATION_SCHEDULE ( requestor_username varchar2(30) not null, approver_username varchar2(30) not null, from_date date not null, to_date date not null); -create index WFVACXX_VACATION_SCHEDULE_N1 on WFVACXX_VACATION_SCHEDULE (requestor_username,approver_username); -commit; --exit y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 8 c A wfvacxxs.sql y m e d a wfvacxxs.sql e l c a r O ly & On l a e n r s e t U n I c A /*=======================================================================+ | Copyright (c) 1995 Oracle Corporation Redwood Shores, California, USA| | All rights reserved. | +=======================================================================+ | FILENAME | wfvacxxs.sql | | DESCRIPTION | CLASS SAMPLE PL/SQL spec for package WFVACXX | | NOTES | This file is a SAMPLE that should be modified with your own | package and procedure names before installing. | The script is written so that you can simply replace XX with the | unique number assigned to your station. e l c a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 9 | | It may be convenient to use the following naming standard | - package name is equivalent to the item type internal name | - procedure names are equivalent to the workflow activity | internal name that the procedure implements. *=======================================================================*/ whenever sqlerror exit failure rollback; create or replace package WFVACXX as /* $Header$ */ -- PROCEDURE SCHEDULE_UPDATE --- <describe the activity here> --- IN -itemtype - type of the current item -itemkey - key of the current item -actid - process activity instance id -funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...) -- OUT -resultout -- COMPLETE[:<result>] -activity has completed with the indicated result -- WAITING -activity is waiting for additional transitions -- DEFERED -execution should be deferred to background -- NOTIFIED[:<notification_id>:<assigned_user>] -activity has notified an external entity that this -step must be performed. A call to wf_engine.CompleteActivity -will signal when this step is complete. Optional -return of notification ID and assigned user. -- ERROR[:<error_code>] -function encountered an error. procedure SCHEDULE_UPDATE( itemtype in varchar2, itemkey in varchar2, actid in number, funcmode in varchar2, resultout in out varchar2); y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O -- PROCEDURE NTF_VACATION_PROPOSAL --- <describe the activity here> Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 10 c A --- IN -itemtype - type of the current item -itemkey - key of the current item -actid - process activity instance id -funcmode - post-notification function execution mode -('RESPOND','FORWARD','TRANSFER','RUN', 'CANCEL', 'TIMEOUT') -- OUT -resultout -- COMPLETE[:<result>] -activity has completed with the indicated result -- WAITING -activity is waiting for additional transitions -- DEFERED -execution should be deferred to background -- NOTIFIED[:<notification_id>:<assigned_user>] -activity has notified an external entity that this -step must be performed. A call to wf_engine.CompleteActivty -will signal when this step is complete. Optional -return of notification ID and assigned user. -- ERROR[:<error_code>] -function encountered an error. procedure NTF_VACATION_PROPOSAL( itemtype in varchar2, itemkey in varchar2, actid in number, funcmode in varchar2, resultout in out varchar2); y m e d a ----------- e l c a r O ly & On l a e n r s e t U n I c A PROCEDURE VACATION_SCHEDULED Report vacation scheduled for the current Vacation Proposal requestor IN document_id display_type OUT document document_type- e l c string that uniquely identifies the document text/html or text/plain outbound text buffer outbound document type of text/html, text/plain, or '' procedure VACATION_SCHEDULED( document_id in varchar2, display_type in varchar2, document in out varchar2, document_type in out varchar2); a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 11 -- PROCEDURE CHECK_APPROVER --- Compares the value of the Vacation Proposal Requestor to the Approver. -- If the Approver = Requestor, return result Y (Yes) -- If the Approver <>Requestor, return result N (No) --- IN -itemtype - type of the current item -itemkey - key of the current item -actid - process activity instance id -funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...) -- OUT -resultout -- COMPLETE[:<result>] -activity has completed with the indicated result -- WAITING -activity is waiting for additional transitions -- DEFERED -execution should be deferred to background -- NOTIFIED[:<notification_id>:<assigned_user>] -activity has notified an external entity that this -step must be performed. A call to wf_engine.CompleteActivity -will signal when this step is complete. Optional -return of notification ID and assigned user. -- ERROR[:<error_code>] -function encountered an error. procedure CHECK_APPROVER( itemtype in varchar2, itemkey in varchar2, actid in number, funcmode in varchar2, resultout in out varchar2); y m e d a -------------- e l c a r O ly & On l a e n r s e t U n I c A PROCEDURE SELECTOR Examines the value of item attribute TIMEOUT_CHOICE to select which process to run If TIMEOUT_CHOICE = LOOP COUNTER, then run WFVACXX_PROCESS If TIMEOUT_CHOICE = SELF LOOP, then run WFVACXX_ALTERNATE_PROCESS e l c IN itemtype itemkey actid command OUT a r O - type of the current item key of the current item process activity instance id execution mode ('RUN', 'SET_CTX','TEST_CTX',...) Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 12 -resultout -- name of process to run -- ERROR[:<error_code>] -function encountered an error. procedure SELECTOR( itemtype in varchar2, itemkey in varchar2, actid in number, command in varchar2, resultout in out varchar2); end WFVACXX; / show errors package WFVACXX commit; --exit; y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 13 c A wfvacxxb.sql y m e d a wfvacxxb.sql e l c a r O ly & On l a e n r s e t U n I c A /*=======================================================================+ | Copyright (c) 1995 Oracle Corporation Redwood Shores, California, USA| | All rights reserved. | +=======================================================================+ | FILENAME | wfvacxxb.sql | | DESCRIPTION | CLASS SAMPLE PL/SQL spec for package WFVACXX | | NOTES | This file is a SAMPLE that should be modified with your own | names and procedures before installing. | The script is written so that you can simply replace XX with the | unique number assigned to your station. | | It may be convenient to use the following naming standard e l c a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 14 | - package name is equivalent to the item type internal name | - procedure names are equivalent to the workflow activity | internal name that the procedure implements. *=======================================================================*/ whenever sqlerror exit failure rollback; create or replace package body WFVACXX as /* $Header$ */ -- PROCEDURE SCHEDULE_UPDATE --- Insert a row into an employee based vacation schedule table --- IN -itemtype - type of the current item -itemkey - key of the current item -actid - process activity instance id -funcmode - function execution mode. this is set by the engine -as either 'RUN', 'CANCEL', 'TIMEOUT' -- OUT -resultout -- COMPLETE[:<result>] -activity has completed with the indicated result -- WAITING -activity is waiting for additional transitions -- DEFERED -execution should be deferred to background -- NOTIFIED[:<notification_id>:<assigned_user>] -activity has notified an external entity that this -step must be performed. A call to wf_engine.CompleteActivity -will signal when this step is complete. Optional -return of notification ID and assigned user. -- ERROR[:<error_code>] -function encountered an error. procedure SCHEDULE_UPDATE( itemtype in varchar2, itemkey in varchar2, actid in number, funcmode in varchar2, resultout in out varchar2) is lrequestor_username varchar2(30); lapprover_username varchar2(30); lfrom_date date; lto_date date; y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 15 c A begin --- RUN mode - normal process execution -if (funcmode = 'RUN') then -- retrieve requestor, approver, from, and to dates lrequestor_username := wf_engine.GetItemAttrText(itemtype => itemtype, itemkey => itemkey, aname => 'REQUESTOR'); lapprover_username := wf_engine.GetItemAttrText(itemtype => itemtype, itemkey => itemkey, aname => 'APPROVER'); lfrom_date := wf_engine.GetItemAttrDate(itemtype => itemtype, itemkey => itemkey, aname => 'FROM_DATE'); lto_date := wf_engine.GetItemAttrDate(itemtype => itemtype, itemkey => itemkey, aname => 'TO_DATE'); -- insert row into vacation schedule table insert into WFVACXX_VACATION_SCHEDULE (REQUESTOR_USERNAME, APPROVER_USERNAME, FROM_DATE, TO_DATE) values (lrequestor_username, lapprover_username, lfrom_date, lto_date); e l c a r O ly & On l a e n r s e t U n I y m e d a c A -- no result needed resultout := wf_engine.eng_completed||':'||wf_engine.eng_null; return; end if; -------- e l c CANCEL mode - activity 'compensation' a r O This is in the event that the activity must be undone, for example when a process is reset to an earlier point due to a loop back. Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 16 if (funcmode = 'CANCEL') then -- retrieve requestor, approver, from, and to dates lrequestor_username := wf_engine.GetItemAttrText(itemtype => itemtype, itemkey => itemkey, aname => 'REQUESTOR'); lapprover_username := wf_engine.GetItemAttrText(itemtype => itemtype, itemkey => itemkey, aname => 'APPROVER'); lfrom_date := wf_engine.GetItemAttrDate(itemtype => itemtype, itemkey => itemkey, aname => 'FROM_DATE'); lto_date := wf_engine.GetItemAttrDate(itemtype => itemtype, itemkey => itemkey, aname => 'TO_DATE'); -- delete row from vacation schedule table delete from WFVACXX_VACATION_SCHEDULE where REQUESTOR_USERNAME = lrequestor_username and APPROVER_USERNAME = lapprover_username and FROM_DATE = lfrom_date and TO_DATE = lto_date; e d a -- no result needed resultout := wf_engine.eng_completed||':'||wf_engine.eng_null; return; end if; e l c a r O ly & On l a e n r s e t U n I c A --- Other execution modes may be created in the future. Your -- activity will indicate that it does not implement a mode -- by returning null -resultout := wf_engine.eng_null; return; exception when others then -- The line below records this function call in the error system -- in the case of an exception. wf_core.context('WFVACXX', 'SCHEDULE_UPDATE', itemtype, itemkey, to_char(actid), funcmode); raise; end SCHEDULE_UPDATE; e l c a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 17 y m -- PROCEDURE NTF_VACATION_PROPOSAL --- <describe the activity here> --- IN -itemtype - type of the current item -itemkey - key of the current item -actid - process activity instance id -funcmode - post-notification function execution mode -('RESPOND','FORWARD','TRANSFER','RUN', 'CANCEL', 'TIMEOUT') -- OUT -resultout -- COMPLETE[:<result>] -activity has completed with the indicated result -- WAITING -activity is waiting for additional transitions -- DEFERED -execution should be deferred to background -- NOTIFIED[:<notification_id>:<assigned_user>] -activity has notified an external entity that this -step must be performed. A call to wf_engine.CompleteActivity -will signal when this step is complete. Optional -return of notification ID and assigned user. -- ERROR[:<error_code>] -function encountered an error. procedure NTF_VACATION_PROPOSAL( itemtype in varchar2, itemkey in varchar2, actid in number, funcmode in varchar2, resultout in out varchar2) is nid number; ntf_responder varchar2(30); ntf_result varchar2(30); ntf_alt_from_date date := ''; ntf_alt_to_date date := ''; y m e d a begin e l c e l c a r O ly & On l a e n r s e t U n I c A --- RESPOND mode - recipient has supplied a response to the notification -if (funcmode = 'RESPOND') then a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 18 -- get notification id and responder from wf_engine context variables nid := WF_ENGINE.CONTEXT_NID; ntf_responder := WF_ENGINE.CONTEXT_TEXT; -- if the approver rejects the vacation proposal then he/she must -- provide an alternate date window -- retrieve the notification result ntf_result := wf_notification.GetAttrText(nid,'RESULT'); if (ntf_result = 'REJECTED') then -- retrieve the alternate vacation dates ntf_alt_from_date := wf_notification.GetAttrDate(nid,'ALT_FROM_DATE'); ntf_alt_to_date := wf_notification.GetAttrDate(nid,'ALT_TO_DATE'); if (ntf_alt_from_date is null or ntf_alt_to_date is null) then -- raise an error resultout := wf_engine.eng_error||':'||wf_engine.eng_null; wf_core.Raise('Provide Alternate Dates'); return; end if; if (ntf_alt_from_date > ntf_alt_to_date) then -- raise an error resultout := wf_engine.eng_error||':'||wf_engine.eng_null; wf_core.Raise('From Date before To Date'); return; end if; end if; resultout := wf_engine.eng_completed||':'||ntf_result; return; end if; e d a y m e l c a r O ly & On l a e n r s e t U n I c A --- TRANSFER mode - recipient attempting to Transfer notification -if (funcmode = 'TRANSFER') then e l c -- don't allow transfer -- raise an error resultout := wf_engine.eng_error||':'||wf_engine.eng_null; wf_core.Raise('Transfer not allowed'); return; a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 19 end if; --- FORWARD mode - recipient attempting to Delegate notification -if (funcmode = 'FORWARD') then -- delegate allowed null; -- set resultout to null to indicate that the mode is not implemented resultout := wf_engine.eng_null; return; end if; --- RUN mode - in post-notification function, response to notification -already processed and accepted -if (funcmode = 'RUN') then -- if implemented, your run code goes here null; -- set resultout to null to indicate that the mode is not implemented resultout := wf_engine.eng_null; return; end if; y m e d a c A --- TIMEOUT mode - recipient has allowed the notification to timeout -if (funcmode = 'TIMEOUT') then -- if implemented, your timeout code goes here null; -- set resultout to null to indicate that the mode is not implemented resultout := wf_engine.eng_null; return; end if; -------if e l c a r O ly & On l a e n r s e t U n I CANCEL mode - activity 'compensation' e l c This is in the event that the activity must be undone, for example when a process is reset to an earlier point due to a loop back. a r O (funcmode = 'CANCEL') then Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 20 -- if implemented, your cancel code goes here null; -- set resultout to null to indicate that the mode is not implemented resultout := wf_engine.eng_null; return; end if; --- Other execution modes may be created in the future. Your -- activity will indicate that it does not implement a mode -- by returning null -resultout := wf_engine.eng_null; return; exception when others then -- The line below records this function call in the error system -- in the case of an exception. wf_core.context('WFVACXX', 'NTF_VACATION_PROPOSAL', itemtype, itemkey, to_char(actid), funcmode); raise; end NTF_VACATION_PROPOSAL; ----------- PROCEDURE VACATION_SCHEDULED y m e d a c A Report vacation scheduled for the current Vacation Proposal requestor e l c a r O ly & On l a e n r s e t U n I IN document_id display_type OUT document document_type- string that uniquely identifies the document text/html or text/plain outbound text buffer outbound document type of text/html, text/plain, or '' procedure VACATION_SCHEDULED( document_id in varchar2, display_type in varchar2, document in out varchar2, document_type in out varchar2) is e l c a r O cursor vacation_schedule (xrequestor in varchar2) is select approver_username, to_char(from_date,'Day DD Month YYYY') from_displayed, to_char(to_date,'Day DD Month YYYY') to_displayed Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 21 from where wfvacxx_vacation_schedule requestor_username in (select name from wf_users where display_name = xrequestor) order by from_date, to_date; begin if display_type = 'text/html' then document_type := 'text/html'; document := '<BR><BR><LEFT><TABLE BORDER CELLPADDING=5 BGCOLOR=#FFFFFF>'|| '<TR BGCOLOR=#83C1C1>'|| '<TH>From Date</TH>'|| '<TH>To Date</TH>'|| '<TH>Approver</TH>'|| '</TR>'; else document_type := 'text/plain'; document := chr(10)||rpad('From Date',28)|| rpad('To Date',28)|| rpad('Approver',30)|| chr(10); end if; e d a y m -- build table body with data for schedule_rec in vacation_schedule(document_id) loop if display_type = 'text/html' then document := document|| '<TR>'|| '<TD>'||schedule_rec.from_displayed||'</TD>'|| '<TD>'||schedule_rec.to_displayed||'</TD>'|| '<TD>'|| wf_directory.getroledisplayname(schedule_rec.approver_username) ||'</TD>'|| '</TR>'; else document := document|| rpad(schedule_rec.from_displayed,28)|| rpad(schedule_rec.to_displayed,28)|| rpad( wf_directory.getroledisplayname(schedule_rec.approver_username) ,30)|| chr(10); end if; end loop; e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 22 c A -- close the table if display_type = 'text/html' then document := document|| '</TABLE></LEFT><BR>'; end if; return; exception when others then -- The line below records this procedure call in the error system -- in the case of an exception. wf_core.context('WFVACXX', 'VACATION_SCHEDULED', document_id, display_type); raise; end VACATION_SCHEDULED; -- PROCEDURE CHECK_APPROVER --- Compares the value of the Vacation Proposal Requestor to the Approver. -- If the Approver = Requestor, return result Y (Yes) -- If the Approver <>Requestor, return result N (No) --- IN -itemtype - type of the current item -itemkey - key of the current item -actid - process activity instance id -funcmode - function execution mode ('RUN', 'CANCEL', 'TIMEOUT', ...) -- OUT -resultout -- COMPLETE[:<result>] -activity has completed with the indicated result -- WAITING -activity is waiting for additional transitions -- DEFERED -execution should be deferred to background -- NOTIFIED[:<notification_id>:<assigned_user>] -activity has notified an external entity that this -step must be performed. A call to wf_engine.CompleteActivity -will signal when this step is complete. Optional -return of notification ID and assigned user. -- ERROR[:<error_code>] -function encountered an error. procedure CHECK_APPROVER( itemtype in varchar2, y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 23 c A itemkey actid funcmode resultout in in in in varchar2, number, varchar2, out varchar2) is lrequestor_username lapprover_username wf_yes wf_no begin varchar2(30); varchar2(30); varchar2(1) := 'Y'; varchar2(1) := 'N'; --- RUN mode - normal process execution -if (funcmode = 'RUN') then -- retrieve requestor, approver lrequestor_username := wf_engine.GetItemAttrText(itemtype => itemtype, itemkey => itemkey, aname => 'REQUESTOR'); lapprover_username := wf_engine.GetItemAttrText(itemtype => itemtype, itemkey => itemkey, aname => 'APPROVER'); if lrequestor_username <> lapprover_username then resultout := wf_engine.eng_completed||':'||wf_no; else resultout := wf_engine.eng_completed||':'||wf_yes; end if; return; end if; -------if e l c a r O ly & On l a e n r s e t U n I e d a c A CANCEL mode - activity 'compensation' This is in the event that the activity must be undone, for example when a process is reset to an earlier point due to a loop back. e l c (funcmode = 'CANCEL') then a r O -- no result needed resultout := wf_engine.eng_completed||':'||wf_engine.eng_null; return; end if; Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 24 y m --- Other execution modes may be created in the future. Your -- activity will indicate that it does not implement a mode -- by returning null -resultout := wf_engine.eng_null; return; exception when others then -- The line below records this function call in the error system -- in the case of an exception. wf_core.context('WFVACXX', 'CHECK_APPROVER', itemtype, itemkey, to_char(actid), funcmode); raise; end CHECK_APPROVER; -- PROCEDURE SELECTOR --- Examines the value of item key to select -- which process to run. -- If the first four characters of itemkey: -is 'CNTR', then run WFVACXX_PROCESS -is 'SELF', then run WFVACXX_ALTERNATE_PROCESS -- Note: This logic is contrived for class practice only. -The selector function is expected to use the itemkey as -the primary key to retrieve supporting application data. -The Application data retrieved would be used to determine -which process is appropriate to start. --- IN -itemtype - type of the current item -itemkey - key of the current item -actid - process activity instance id -command - execution mode ('RUN', 'SET_CTX','TEST_CTX',...) -- OUT -resultout -- name of process to run -- ERROR[:<error_code>] -function encountered an error. procedure SELECTOR( itemtype in varchar2, itemkey in varchar2, actid in number, e d a y m e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 25 c A command in varchar2, resultout in out varchar2) is litemkey varchar2(30) := itemkey; begin --- RUN mode - determine which process to run -if (command = 'RUN') then if UPPER(substr(litemkey,1,4)) = 'CNTR' then resultout := 'WFVACXX_PROCESS'; elsif UPPER(substr(litemkey,1,4)) = 'SELF' then resultout := 'WFVACXX_ALTERNATE_PROCESS'; else resultout := wf_engine.eng_error||':'||wf_engine.eng_null; wf_core.Raise('Invalid item key'); end if; return; end if; --- SET_CTX mode -if (command = 'SET_CTX') then e l c a r O ly & On l a e n r s e t U n I -- no result needed resultout := wf_engine.eng_null; return; end if; c A if (command = 'TEXT_CTX') then -- no result needed resultout := wf_engine.eng_null; return; end if; e l c --- Other execution modes may be created in the future. Your -- selector will indicate that it does not implement a mode -- by returning null -resultout := wf_engine.eng_null; a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 26 e d a y m return; exception when others then -- The line below records this function call in the error system -- in the case of an exception. wf_core.context('WFVACXX', 'SELECTOR', itemtype, itemkey, to_char(actid), command); raise; end SELECTOR; end WFVACXX; / show errors package body WFVACXX commit; --exit; y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 27 c A wfvacxxd.sql y m e d a wfvacxxd.sql e l c a r O ly & On l a e n r s e t U n I c A /*=======================================================================+ | Copyright (c) 1995 Oracle Corporation Redwood Shores, California, USA| | All rights reserved. | +=======================================================================+ | FILENAME | wfvacxxd.sql | | DESCRIPTION | Drop Workflow Vacation Schedule index, table and package. | NOTES | This file is a SAMPLE that should be modified with your own | names before installing. Names that include | XX should be replaced with values for your implementation. | *=======================================================================*/ e l c a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 28 /* $Header$ */ whenever sqlerror continue; -drop index WFVACXX_VACATION_SCHEDULE_N1; -drop table WFVACXX_VACATION_SCHEDULE; -drop package WFVACXX; commit; --exit y m e d a e l c e l c a r O ly & On l a e n r s e t U n I a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 29 c A wfslctxx.sql y m e d a wfslctxx.sql e l c a r O ly & On l a e n r s e t U n I c A /*=======================================================================+ | Copyright (c) 2004 Oracle Corporation Redwood Shores, California, USA| | All rights reserved. | +=======================================================================+ | FILENAME | wfslctxx.sql | | DESCRIPTION | Launch three work items without specifying the process to start, | to test the selector function in the Defining a Selector Function | practice | | NOTES | This file is a SAMPLE that should be modified with your own | values before running. Names that include e l c a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 30 | XX should be replaced with values for your implementation. | Additionally, you should replace the following with appropriate | values for your tests: | | <requestor_username> - Vacation requestor | <approver_username> - Vacation approver | <from_date> - Vacation from date | <to_date> - Vacation to date | *=======================================================================*/ /* $Header$ */ whenever sqlerror continue; --- Create and start a work item with an item key that begins with CNTR -Exec WF_ENGINE.CreateProcess('WFVACXX', 'CNTR211XX'); Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'CNTR211XX', 'REQUESTOR', '<requestor_username>'); e d a y m Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'CNTR211XX', 'APPROVER', '<approver_username>'); c A Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'CNTR211XX', 'FROM_DATE', '<from_date>'); e l c a r O ly & On l a e n r s e t U n I Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'CNTR211XX', 'TO_DATE', '<to_date>'); Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'CNTR211XX', 'VACEVENTKEY', '211XXE1'); Exec WF_ENGINE.StartProcess('WFVACXX', 'CNTR211XX'); --- Create and start a work item with an item key that begins with SELF -- e l c Exec WF_ENGINE.CreateProcess('WFVACXX', 'SELF211XX'); Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'SELF211XX', 'REQUESTOR', '<requestor_username>'); a r O Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 31 Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'SELF211XX', 'APPROVER', '<approver_username>'); Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'SELF211XX', 'FROM_DATE', '<from_date>'); Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'SELF211XX', 'TO_DATE', '<to_date>'); Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'SELF211XX', 'VACEVENTKEY', '211XXE2'); Exec WF_ENGINE.StartProcess('WFVACXX', 'SELF211XX'); --------- Create and start a work item with an item key that begins with TEST If you use the selector function provided in the sample solutions, the CreateProcess procedure should return a ORA-20002: [Invalid itemkey] error, and the following procedures should also error out because the work item does not exist. Exec WF_ENGINE.CreateProcess('WFVACXX', 'TEST211XX'); e d a Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'TEST211XX', 'REQUESTOR', '<requestor_username>'); c A Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'TEST211XX', 'APPROVER', '<approver_username>'); e l c a r O ly & On l a e n r s e t U n I Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'TEST211XX', 'FROM_DATE', '<from_date>'); Exec WF_ENGINE.SetItemAttrDate('WFVACXX', 'TEST211XX', 'TO_DATE', '<to_date>'); Exec WF_ENGINE.SetItemAttrText('WFVACXX', 'TEST211XX', 'VACEVENTKEY', '211XXE3'); Exec WF_ENGINE.StartProcess('WFVACXX', 'TEST211XX'); e l c -commit; a r O --exit Copyright © Oracle, 2007. All rights reserved. Sample Solutions Chapter 30 - Page 32 y m