Sunteți pe pagina 1din 86

ORACLE WORKFLOW

Oracle Workflow Workshop

ORACLE WORKFLOW

Silence is Golden

2 of 37

ORACLE WORKFLOW

Objectives
The program is organized to learn and understand
What is Oracle Workflow What benefits Workflow provides in enterprise systems What is Workflow Builder What are components of a workflow How we can use Workflow builder to create new workflows or customize existing workflows Creating a workflow to map a business process Technical aspects of Workflow

3 of 37

ORACLE WORKFLOW

Workflow Introduction
WHY WHAT

HOW

4 of 37

ORACLE WORKFLOW

Why Workflow
Business Process Modeling
e- Business suite

Delivering Notifications
Integrating Systems

5 of 37

ORACLE WORKFLOW

Why workflow?
1. Workflow provides routing of documents 2. Lets you continuously model complex business scenarios with drag & drop interface 3. Allows sophisticated processes using loops, parallel flows, split & merge flows, sub flows, asynchronous flows 4. Provides flexible notification facility to send and respond to notifications within Oracle applications work list, web browser supported access or external email 5. Tightly integrated with Oracle Database and provides published PL/SQL & Java APIs to drive workflows 6. Provides graphical monitoring facility 7. Business Event systems provided by WF facilitate interface between applications
6 of 37

ORACLE WORKFLOW

What is Workflow
Each workflow is a series of activities strung together with each activity's outcome determining the next activity to perform A Workflow allows graphical representation of business processes and allows modeling, automation and continuous improvement of business processes

7 of 37

ORACLE WORKFLOW

E-Business Suite and Workflow

SHIPPING

Data Warehouse

DATA WAREHOUSE

Shipping

Extends message broker model


Flexible Provides process view Simple Requires a model of the business process

Order Entry Human Resources


Workflow
HUMAN RESOURCES

ORDER ENTRY


ACCOUNTING

WAREHOUSE

Accounting
WEB STORE

Web Store Credit Management


8 of 37
CREDIT MANAGEMENT

ORACLE WORKFLOW

E-business Suite and Workflow


Oracle Workflow is back bone of many modules in Oracle EBusiness Suite There are more than 800 Item Types in E-Business Suite Following are some important Workflows
GL Account Generator WF Cost of Goods WF Sales Order (Header & Lines) WF Requisition Approval WF PO Approval WF HRSS WF Payroll Process WF Tasks WF
9 of 37

ORACLE WORKFLOW

Types of Workflow
Synchronous flow
Completes all activities in one session without interruption Does not return control to calling program till completion

Asynchronous flow
Cannot complete all activities in one session Includes activities like notification responses, block/wait functions and deferred activities Can be restarted by Background Engine, Notification System

Forced synchronous flow


Completes all activities in one SQL session Contains no inserts or updates to tables Account Generator WF
10 of 37

ORACLE WORKFLOW

Availability
Workflow
Standalone
Some more capabilities Embedded with applications
Workflow is part of Architecture Technology Group, the patches are available in product FND. Note that there is no product such as WF in Applications The Oracle Workflow Builder Release 2.6.3 is compatible with all versions of the Oracle Workflow Server embedded in Oracle Applications Release 11i

11 of 37

ORACLE WORKFLOW
AQ AQ AQ AQ AQ

Directory Services Users Roles

AQ

Web Notification Worklist


Business Event System Notification Services Workflow Engine

Workflow Builder

Web Monitor WebDB

Send Receive Raise

Send Respond Forward Cancel

Execution Definition Administration Monitoring Query Workflow Definition Files Workflow Loader

Web Analysis Tools

Listen Query

Query

Mail Applications

Notification Mailer

Oracle Workflow Enabled Application

Browser Client

Application Server

Oracle server

Workflow Development 12 of 37 Client

ORACLE WORKFLOW

Workflow Engine
Workflow engine implements the workflow process definitions at runtime monitoring the states and coordinating the routing of process activities
The workflow engine is a database package containing procedures run on a schedule. The workflow engine recognizes activities meeting specific criteria and only operates on those activities. Through the use of standard APIs, background engines can be scheduled to target activities meeting other specified criteria, such as deferred and stuck status activities.

13 of 37

ORACLE WORKFLOW

Background Engine
Background Engine is a PL/SQL package that checks the workflow tables for any activities that require processing such as timed-out or deferred activities Examples Deferred Activities Timed Out Activities Wait Activities Blocked Activities Response Notifications

14 of 37

ORACLE WORKFLOW

Workflow Directory Services


WF_ROLES WF_USERS

WF_USER_ROLES
WF Local Roles

Synchronization

15 of 37

ORACLE WORKFLOW

Notification System
Oracle Internet Messaging Various Mail Applications
Netscape
HTML Plain text

SMTP MAPI

Notifications

Notification Worklist Web Client

Lotus Notes MS Exchange Unix Sendmail Others

Oracle Workflow Notification Mailer

Oracle server

Oracle Workflow Worklist 16 of 37

ORACLE WORKFLOW

Types of Notifications
FYI notification This type of notification just displays information in text/HTML format. You cannot respond to a FYI notification.

Response Notification

It not only sends the e-mail notification but also allows user to respond to the notifications. The response of user would automatically trigger next activity in the workflow process.
17 of 37

ORACLE WORKFLOW

Viewing Notification
Worklist
Once you login to Oracle Applications you can see the notifications waiting for you Provides complete facility to view notification and drill down to URL Also provides facility to open other Oracle forms to query or update data based on responsibility

Internet-Enabled
Use standard Web browser to display notifications Access from Self-Service / Business Intelligence home page Allows drill-down to any URL or Applications screen to research or complete transaction

E-mail
Standard Mail Protocols: (Oracle Internet Messaging, MAPI, UNIX Sendmail) Detail and summary formats Plain text or HTML email
18 of 37

ORACLE WORKFLOW

Responding to Notification
Work List
Allows you to respond to notifications Also provides facility to open other Oracle forms to query or update data based on responsibility

Internet-Enabled
Use standard Web browser to respond to notifications similar to Worklist User needs to login to Oracle Applications through either Self Service or Business Intelligence Home Page

E-mail
User does not need to login to Oracle Applications Provide response processing through email parser using Template Processing User has to manually enter responses in quoted strings which must match the result codes
19 of 37

ORACLE WORKFLOW

Self Service Notification

20 of 37

ORACLE WORKFLOW

Extended HTML message formats

Research and make a decision via online inquiry

21 of 37

ORACLE WORKFLOW

Workflow Builder
Oracle Workflow Builder displays a navigator window with a hierarchy tree containing the following tree nodes:
Item Type classification of the components that comprise the workflow process definition

Item Key An identifier for a unique instance of the Item Key. Item Type/item Key combination MUST be unique in any Workflow System at a given time.
Process - Is logical grouping of activities in a workflow Item Type

Attributes property associated with a given item type that acts as a global variable that can be referenced or updated by any activity within a process or externally through the use of standard APIs

22 of 37

ORACLE WORKFLOW

Workflow Builder cont.


Functions defined by the PL/SQL or external program it calls, usually performing fully automated process steps Events a business event from the Business Event System

Messages defines the information conveyed in a notification


Lookup Types a static list of values that can be used by messages and activity attributes Lookup Codes Values that appear it the list of Lookup Types

23 of 37

ORACLE WORKFLOW

Methods of creating Workflows


Top Down or Bottom Up approach
Top Down--Processes first then go to granular level of activities Bottom Up--First define Attributes/Messages/ Functions/Processes and then use them to build processes

24 of 37

ORACLE WORKFLOW

Workflow Concepts
Processes & Sub processes
Any process can be a sub process to another process

Runnable
A process that can be initiated as a top level process

Standard Functions
Seeded Functions provided by Oracle They have seeded transitions PL/SQL code is defined and cannot be modified Examples: AND OR NOOP START END NOTIFY

WAIT

User Functions
Custom Functions based on user requirement need to add PL/SQL code to make them work Need to define transitions
25 of 37

ORACLE WORKFLOW

Workflow Concepts Cont.


Start & End
All processes MUST have a Start and at least one End activity

Transitions
Represent completion of one activity and the activation of next They appear as arrows Must correspond to the result of the previous activity Standard Transitions
<Default> WF follows default if no other transition is applicable

26 of 37

ORACLE WORKFLOW

Workflow Concepts Cont.


<Any> If used WF follows this transition irrespective of outcome <Timeout> For notifications, timeout transition is used to force the process to perform some other activity if the notification activity does not complete by specified time period

Timeouts
Workflow marks activity as timed-out Cancels notification Sends email to performer about change of status (if set up) Progresses workflow to the activity identified by timeout transition

27 of 37

ORACLE WORKFLOW

More on Notifications
Workflow provides notification messages in both text & HTML format

28 of 37

ORACLE WORKFLOW

More on Notifications cont.


Example below shows message entered as HTML

29 of 37

ORACLE WORKFLOW

More on Notifications Cont.


Displaying complex reports in messages
WF allows complex HTML reports that involve HTML tags, style sheets and generating URLs. This is done by writing PL/SQL procedures that are called by attributes of type Document

Voting Activity
Oracle supports notifications to be used as a Voting Activity In order to implement voting the particular notification function must have a post-notification procedure to process voting results

30 of 37

ORACLE WORKFLOW

WFSTD
Oracle Workflow Builder comes equipped with several built-in workflows and demos, one of which is WFSTD
This can be used as a template for building custom WFs It has many seeded functions provided by Oracle like
And function facilitating the rendezvous of parallel threads, flow will not continue until all transitions to the function are completed Or function facilitating the rendezvous of parallel threads, flow will continue with completion of the first transition to the function Loop Counter function used to count the number of times a looping flow has transitioned through, allows continuation or exit of the looping flow based on counter Comparison operations functions used to compare date, text, and number values to corresponding item attribute types, allows branching based on the result of the comparison

It also has a Voting activity notification, a message, some attributes and lookup codes and lookup types
31 of 37

ORACLE WORKFLOW

Building a Workflow

ORACLE WORKFLOW

Starting up
A simple workflow process definition can be created in a few easy steps Define an item type and an initial process using the Quick Start Wizard from the File menu

33 of 37

ORACLE WORKFLOW

Building Workflow
Define necessary attributes
Item type attributes can be defined as types such as text, number, date, role, lookup . The value item can be used to set a default value for the attribute

34 of 37

ORACLE WORKFLOW

Building Workflow
Define necessary lookup types and codes
Right click on the Lookup Types node and select New from the menu After the lookup type has been created, select the lookup type, right click, and select New Lookup Code from the menu

35 of 37

ORACLE WORKFLOW

Building Workflow
Define messages to convey information
Right click on the message node and select New After creating the message, go to the Body tab and enter the text (or HTML) desired Attributes are referenced within the body by using & Attributes referenced in the body must also be dragged from the attribute node and dropped in the message

36 of 37

ORACLE WORKFLOW

Building Workflow
Define notifications to deliver the messages
Drag and drop the message onto the Notification node to initiate creation of a notification based on a specific message

37 of 37

ORACLE WORKFLOW

Building Workflow
Drag-and-Drop notifications onto the workflow diagram
Organize the activities Draw transitions as required by the necessary organization of the activities by pressing down the right mouse button on the beginning point of the transition and dragging the mouse to the next step then releasing the mouse button

38 of 37

ORACLE WORKFLOW

Building Workflow
Double click on the notification activities to add the performer (recipient) on the Node tab Hovering over an activity will display important information about the activity

39 of 37

ORACLE WORKFLOW

Building Workflow
Error Handling- Use Standard Item type WFERROR with process DEFAULT_ERROR

Custom Error Handling- Use Custom Process to handle error conditions and assign Custom Item Type & Process Name
40 of 37

ORACLE WORKFLOW

Building Workflow
WFERROR

41 of 37

ORACLE WORKFLOW

Building Workflow
Verify the workflow process definition by pressing the blue check mark icon on the toolbar Save the workflow process definition to the database by pressing the yellow disk icon on the toolbar and entering the Workflow Administrator account information

42 of 37

ORACLE WORKFLOW

Building Workflow
Click on the Launch Processes Link
The Launch Process window will appear, showing a listing of all executable item types Click the item type link for the item type to be launched

43 of 37

ORACLE WORKFLOW

Building Workflow
The Initiate Workflow page appears, listing item type attributes that can be initialized when the workflow is executed Press OK to execute the worklow

44 of 37

ORACLE WORKFLOW

Building Workflow
Once the workflow is executed, the Activities List page is automatically displayed
Clicking on the activity link WH Demo will display the Item Type Definition page which shows process details Clicking on the View Diagram button will display our workflow

45 of 37

ORACLE WORKFLOW

Building Workflow
Press the Home icon to go back to the Workflow Monitoring home page Press the Find Notifications link to bring up the notification search page Enter search criteria and press OK Worklist page appears displaying matching notifications Select subject link to display a notification

46 of 37

ORACLE WORKFLOW

Building Workflow

47 of 37

ORACLE WORKFLOW

Building Workflow
The Reviewer notification that was sent as part of the workflow initiation requires a response The bottom frame of the notification contains response buttons based on the lookup type selected for the notification result The selected response will dictate the transition path taken from the Review notification activity

48 of 37

ORACLE WORKFLOW

Building Workflow
The workflow image at the top right is pre-approval The workflow image at the bottom right is post-approval
The Approve button was pressed on the Reviewer notification causing the approve transition path to be taken

49 of 37

ORACLE WORKFLOW

Workflow Monitor
Summary of key activities
Decision makers in the process Current owners

Graphically monitor and administer workflow transactions


View and analyze transaction history Retry or skip any activity Rewind and rerun any process Available to end users and administrators

50 of 37

ORACLE WORKFLOW

Oracle Workflow Monitor

51 of 37

ORACLE WORKFLOW

Oracle Workflow Monitor

52 of 37

ORACLE WORKFLOW

Oracle Workflow Monitor

53 of 37

ORACLE WORKFLOW

XML Gateway functions


XML Get Tag Value function facilitating the retrieval of data from an event attribute and storage in another item attribute XML Comparison operations similar to regular comparison operations, except the comparisons utilize data retrieved from events for path determination Assign function allowing a value for an item attribute to be set within the worklfow process at run-time Wait function that will hold a transition from completion until a specified period or date has passed Defer Thread function used to force all following activities on the same thread to be deferred for the background engine to run

54 of 37

ORACLE WORKFLOW

Workflow APIs
There is an entire library of standard APIs, but here are a few examples
wf_engine.CreateProcess creates an instantiation of the specified workflow process wf_engine.StartProcess initiates the created workflow process (used in tandem with CreateProcess) wf_engine.background runs a one-time background engine wf_engine.SetItemAttrText used to set the value of a text item attribute within a workflow process externally from PL/SQL wf_engine.GetItemAttrText used to retrieve the value of a text item attribute from within a workflow process and return it to PL/SQL

55 of 37

ORACLE WORKFLOW

APIs cntd
Another type of standard API is the user-defined function/procedure having pre-defined parameters and return types (where applicable)
A procedure with the following parameter list can be called from within a workflow process and given a user specified name
(itemtype itemkey actid funcmode resultout IN VARCHAR2, IN VARCHAR2, IN NUMBER, IN VARCHAR2, IN OUT VARCHAR2)

56 of 37

ORACLE WORKFLOW

WF Standard Tables
Following are some of the tables where WF stores its data
Master Tables
WF_ACTIVITIES WF_ITEM_TYPES WF_ITEM_ATTRIBUTES WF_MESSAGES WF_LOCAL_ROLES

Transaction Tables
WF_ITEMS WF_NOTIFICATIONS WF_NOTIFICATIONS_ATTRIBUTES WF_ITEM_ATTRIBUTE_VALUES
57 of 37

ORACLE WORKFLOW

Customization
Review the Allow modifications of customized objects checkbox in Help menu
Checked value means workflow builder is operating in upload mode Unchecked value means workflow builder is operating in upgrade mode

58 of 37

ORACLE WORKFLOW

Access levels
Selected Check box Resulting Levels Who can modify object

NONE

Customization=0 Access=100 Protection=1000

Updatable by any access level

Preserve Customizations

Customization=100 Access=100 Protection=1000

Only updatable by access level 100-1000, also by 0-99 if Allow modifications.. checked

Lock at this Access Level

Customization=0 Access=100 Protection=100

Updatable by access level 0100 only

BOTH

Customization=100 Access=100 Protection=100

Updatable by access level 100 only, also by 0-99 if Allow modifications.. checked

59 of 37

ORACLE WORKFLOW

Background Process
Deferred and timeout processes can be restarted by running the following concurrent program

60 of 37

ORACLE WORKFLOW

Workflow Loaders
WFLOAD Utility Similar to FNDLOAD Wft files Storing in database File Systems

61 of 37

ORACLE WORKFLOW

Debugging Workflow
Autonomous Commit The Oracle 8.1 database offers Autonomous Commits. By embedding the pragma AUTONOMOUS_TRANSACTION in your procedure you can perform Commits and Rollbacks independent of the main transaction. Concurrent Programs Using FND_FILE Utilities

62 of 37

ORACLE WORKFLOW

Error Handling
Using Wf_Core.Context WF_CORE.CONTEXT('wf_pkg','set_emp_list',i_itemtype,i_item key,TO_CHAR(i_actid),i_funmode); RAISE; Standard ERROR handling workflow

63 of 37

ORACLE WORKFLOW

Purging Workflow
Purging in Workflow
WF_PURGE API

Temporary Permanent Concurrent Program

64 of 37

ORACLE WORKFLOW

Oracle Workflow Workshop


End of slide show

ORACLE WORKFLOW

Quiz

ORACLE WORKFLOW

Question
Q> A> What is difference between Item Type and Item Key? Item type is a classification of components that make a WF whereas Item Key is an instance of Item Type
Example: Sales Order Header Workflow has Item Type as OM Order Header OEOM and Item Key for a particular Order Header would be 3231 (Order Number). Together they are represented as OEOM-3231 which must be unique.

67 of 37

ORACLE WORKFLOW

Question
Q> Which component of Workflow System handles notifications? Notification Mailer

A>

68 of 37

ORACLE WORKFLOW

Question
Q> In order to be able to initiate a process as a top level process it must be defined as ______________ ?

Hint> Its a check box on Process Properties page A> Runnable

69 of 37

ORACLE WORKFLOW

Question
Q> A> What are Workflow Roles? Workflow Roles are one or more users grouped by common responsibility or function. A Workflow role has an email address to where notifications can be sent.

70 of 37

ORACLE WORKFLOW

Question
Q> Name any 4 standard functions provided by Oracle in WFSTD AND OR NOTIFY WAIT

A>

71 of 37

ORACLE WORKFLOW

Question
Q> A> Q> A> Is it possible to set priority to a Message? Yes. Priority can be Normal, High or Low Where is it defined? On properties pages of a message

72 of 37

ORACLE WORKFLOW

Question
Q> What is default error process for Workflow provided by Oracle? DEFAULT_ERROR

A>

73 of 37

ORACLE WORKFLOW

Question
Q> A> Name any 3 WF tables where WF data is stored WF_ACTIVITIES, WF_ITEM_ATTRIBUTES, WF_ITEMS

74 of 37

ORACLE WORKFLOW

Question
Q> What are the arrows connecting one node to another called? Transitions Name standard transitions for an activity. <Default>, <Any>, <Timeout> (for notifications)

A> Q> A>

75 of 37

ORACLE WORKFLOW

Question
Q> A notification has a timeout period of 60 minutes. However it is more than 3 hours that it has not timed out. The probable cause could be ________________________. Background process did not run

A>

76 of 37

ORACLE WORKFLOW

Question
Q> What parameters does a function activity in workflow pass to a PL/SQL procedure? itemtype, itemKey, actid, funcmode What is the parameter that is returned by the procedure to the Workflow Engine?

A> Q>

A>

resultout

77 of 37

ORACLE WORKFLOW

Question
Q> A> What does standard function NOOP do in WF? Nothing

78 of 37

ORACLE WORKFLOW

Question
Q> Under what modes is the PL/SQL procedure for a WF function called (funcmode)? RUN & CANCEL

A>

79 of 37

ORACLE WORKFLOW

Question
Q> What are possible funcmodes for a notification function (assuming post notification function exists)? RUN, TRANSFER, TRANSFER, FORWARD, TIMEOUT

A>

80 of 37

ORACLE WORKFLOW

Question
Q> An activity of type function is written to compare invoice date against current date. Following transitions are defined for the function.
Greater than (if Invoice date is in future) Less than (if invoice date is in past) Equal (If invoice date is current date) <Any>

A>

If invoice date is 12-JUNE-2006 what transition will WF engine select? <Any>

81 of 37

ORACLE WORKFLOW

Question
Q> ___________ function is called to process result of a voting activity. A> Post-Notification

82 of 37

ORACLE WORKFLOW

Question
Q> A> Name three Workflows in Oracle E-Business Suite Requisition Approval WF COGS Workflow OM Header & Lines WF

83 of 37

ORACLE WORKFLOW

Question
Q> A> This is where you check the status of a workflow instance. Workflow Monitor

Q>

What does workflow monitor allow users to do for an activity and a process?
Activity: Retry & Skip Process: Rewind & Rerun

A>

84 of 37

ORACLE WORKFLOW

Question
Q> Parallel flows in Workflow can be merged using these functions. Which are those? AND OR

A>

85 of 37

ORACLE WORKFLOW

Question
Q> What are different levels for security for an activity in Workflow builder? Customizations, Access & Protection

A>

86 of 37