oracle workflow

56
<Insert Picture Here> Oracle Workflow Sunil Dev Oracle GSD India

Upload: ladabala

Post on 20-Nov-2014

639 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Oracle Workflow

<Insert Picture Here>

Oracle Workflow

Sunil DevOracle GSD India

Page 2: Oracle Workflow

Oracle Workflow

• Oracle Workflow automates and streamlines business processes contained within and outside of Oracle Applications• For example:

• Add personalized trading partner rules• Validate self-service transactions• Closed loop business intelligence• Approve standard business documents• Step through daily transaction flows• Software implementation process

• Workflow is everywhere is Release 11 & Release 11i

Page 3: Oracle Workflow

Components

• The Workflow Processes • Workflow Engine • Workflow Builder • Business Event System • Notification System • The Workflow Monitor • Workflow Definitions Loader

Page 4: Oracle Workflow

Complete Process Representation

Approved

Rejected

False

True

True

No Yes

And

Approve Requisition End (Approved)

End (Rejected)

End (Rejected)

Notify Approver

Notify Requestor NoApprover Available

Notify Requestor ofApproval

Notify Requestor ofForward

Notify Requestor ofRejection

Record RequisitionForward

Reject RequisitionSelect ApproverStart

Verify Authority

Requisition Approval Process

Notify Approver

Page 5: Oracle Workflow

Designing Business Processes for Change

• Business processes will change• No artificial constraints on the business process• Enabling dynamic processes sympathetic to change• Change business processes without changing code

(Reduced cost of ownership)

• Requires visual overview of business processes• You can only fix what you can see• Visual documentation of the business process

Page 6: Oracle Workflow

Oracle Workflow Builder

• Graphically represents a business process using drag and drop process designer• Evolve the process• Improve decision making message content• Create alternative paths• Redeploy people to “Value Added Only” roles

• Modify an existing business process without changing applications code • Reduced cost of change and ownership

Page 7: Oracle Workflow

Designing a Process

Page 8: Oracle Workflow

Rule-Based Workflow Engine

• Manages the execution of a business process

• Immediate and background operation• Generates 100% audit trail• Delivers notifications when human

activities are required• Oracle database transactional integrity

guarantees consistency between application and workflow state

Server Side Architecture Ensures Optimal Performance

o7

Oracle Applications

Oracle Workflow

Oracle DB

Page 9: Oracle Workflow

Rule-Based Workflow Engine

• Looping• Results-based

branching

• Parallel flows• Rendezvous

Page 10: Oracle Workflow

Rule-Based Workflow Engine

• Voting• Time-outs

• Escalation• Automatic forwarding

• Sub-processes• Unlimited hierarchy of sub-

processes

Page 11: Oracle Workflow

Rule-Based Workflow Engine

• Error processing• Centralize process for error handling• Administrator can fix and restart a process

• Effective version• Multiple versions of a process can be active at the

same time• Implement new practices without affecting active work

items

Page 12: Oracle Workflow

Rule-Based Workflow Engine

• Complete programmatic extensibility• Express any complex business rule as a PL/SQL activity, and

allow Oracle Workflow to branch on the result • Write custom code as a PL/SQL activity and have the workflow

engine execute your code

• PL/SQL API available for all engine operations• Communicate with the workflow engine via any application

capable of making a remote procedure call to an Oracle server

Page 13: Oracle Workflow

Electronic Notifications

• Automatically Notify Users• Alert users of exception conditions• Respond to events that require human judgement

• Send Notifications to individuals or roles• Change the participants in a role without changing the process

• Automatic Notification Forwarding• When user is unavailable (vacation, sick Leave)• When user wants to temporarily delegate a task

Page 14: Oracle Workflow

Electronic Notifications

Internet-Enabled• Use standard Web browser to review and respond

• 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

• Template and direct response

• Plain text or HTML email

Page 15: Oracle Workflow

Notifications

Oracle server

NotificationWorklist

Developer 2000Client

NotificationWorklist

Web Client

Oracle Workflow Worklist

OracleInterOffice

SMTP

MAPI

Oracle Workflow Notification Mailer

VariousMail

Applications

• Lotus Notes• MS Exchange• Oracle InterOffice• Unix Sendmail• Others

Notification System

Page 16: Oracle Workflow

Oracle Workflow Monitor

• Graphically monitor and administer workflow transactions• Java Applet running in standard Web Browser• View and analyze transaction history• Retry or skip any activity• Rewind and rerun any process• Available to end users and administrators

• Summary of key activities• Decision makers in the process• Current owners

Page 17: Oracle Workflow

Oracle Workflow Monitor

Page 18: Oracle Workflow

Oracle Workflow Monitor

Page 19: Oracle Workflow

Workflow Architecture

RolesUsers

Directory Services

Notification Services

Send

Respond

Forward

Cancel

Query

Oracle Workflow Enabled Application

Oracle server

Engine

Execution

Definition

Administration

Monitoring

Query

WorkflowBuilder

WorkflowLoader

WorkflowDefinition

Files

WorkflowDev Client

OracleApplication

Server

NotificationMailer

ApplicationServer

NotificationWorklist

D2K Form

WebNotification

Worklist

WebProcessMonitor

WebAnalysis

Tools

End-UserClient

MailApplications

Page 20: Oracle Workflow

Data Model

Oracle Workflow

Page 21: Oracle Workflow

Workflow Datamodel

Workflow tables begin with WF and are owned by APPLSYS Tables

Definition tables – seen in Workflow Builder to define a process Item Type

Transactional tables – used primarily by workflow engine to exercise the process definition for a single Instance of the process.

Item Type Item Key

Scripts BDE_Wf_DEF.sql BDE_WF_ITEM.sql $FND_TOP/sql

Page 22: Oracle Workflow

Workflow Definition Tables

Elements in the Workflow Builder Navigator map to database tables

Translation Tables Item Types are at the top of the Hierarchy Activities

Events Processes Functions Notifications

Other Elements Attributes Messages Lookup Types

These Elements may have sub-elements such as Attributes and Lookup Codes

Page 23: Oracle Workflow

Data Model and the Workflow Builder

WF_ITEM_TYPES

WF_ITEM_ATTRIBUTES

WF_ACTIVITIES}WF_MESSAGES

WF_LOOKUP_TYPES_TL

200+ Item Types defined in Oracle Applications

Page 24: Oracle Workflow

Item Type Properties

WF_ITEM_TYPESNAMEPERSISTENCE_TYPEPERSITIENCE_DAYSWF_SELECTOR

Page 25: Oracle Workflow

Item Attribute Properties

WF_ITEM_ATTRIBUTESNAMETYPEFORMATTEXT_DEFAULT…

Page 26: Oracle Workflow

Events

WF_ACTIVITIESTYPE = ' EVENT'DIRECTION EVENT_NAMECOST

Page 27: Oracle Workflow

Processes – Activity Tab

WF_ACTIVITIESTYPE = ' PROCESS'RUNNABLE_FLAGRESULT_TYPE

Page 28: Oracle Workflow

Processes – Details Tab

WF_ACTIVITIESERROR_ITEM_TYPEERROR_PROCESSRERUNVERSION

Page 29: Oracle Workflow

Functions – Activity Tab

WF_ACTIVITIESTYPE = ‘FUNCTION’FUNCTION_NAMEFUNCTION_TYPERESULT_TYPECOST

Page 30: Oracle Workflow

Notifications – Activity Tab

WF_ACTIVITIESTYPE = ‘NOTICE’FUCNTION_NAMERESULT_TYPEMESSAGE

Page 31: Oracle Workflow

Messages – Message Tab

WF_MESSAGESDEFAULT_PRIORITY

1 = High50 = Normal99 = Low

Page 32: Oracle Workflow

Messages – Body Tab

WF_MESSAGES_TLSUBJECTBODYHTML_BODYUses the Translation table

Page 33: Oracle Workflow

Messages – Result Tab

WF_MESSAGES_ATTRIBUTESResult Lookup TypeDefault Type

Constant Item Attribute

Default Value

Page 34: Oracle Workflow

Lookup Types

WF_LOOKUP_TYPES_TLLOOKUP_TYPE

Only a Translation table exists

Page 35: Oracle Workflow

Lookup Codes

WF_LOOKUPS_TLLOOKUP_TYPELOOKUP_CODE

Sub-Element of Lookup Types

Page 36: Oracle Workflow

Sub-Element - Attributes

WF_ACTIVITY_ATTRIBUTES Defines Attributes specifically used

for Event, Function and Notification Activities

Copied to another table when used within a Process (WF_ACTIVITY_ATTR_VALUES)

WF_MESSAGE_ATTRIBUTES Defines Attributes specifically used

for Messages Copied to

WF_ACTIVITY_ATTRIBUTES when Message is copied to a Notification

Page 37: Oracle Workflow

Data Model – See Handout

TYP WF_ITEM_TYPES(TL) FKPK NAME

DISPLAY_NAMEWF_SELECTORPERSISTENCE_TYPEPERSISTENCE_DAYSDESCRIPTION

ATR WF_ITEM_ATTRIBUTES(TL) FKPK ITEM_TYPE TYPPK NAME

DISPLAY_NAMETYPEDATE_DEFAULTNUMBER_DEFAULTTEXT_DEFAULTFORMATSEQUENCE

MSG WF_MESSAGES(TL) FKPK TYPE TYPPK NAME

DISPLAY_NAMEPRIORITYSUBJECTBODYHTML_BODY

AAT WF_ACTIVITY_ATTRIBUTES(TL) FKPK ACTIVITY_ITEM_TYPE ACTPK ACTIVITY_NAME ACTPK ACTIVITY_VERSION ACTPK NAME

DISPLAY_NAMETYPEVALUE_TYPEDATE_DEFAULTNUMBER_DEFAULTTEXT_DEFAULTFORMATSEQUENCE

(Default)

MAT WF_MESSAGE_ATTRIBUTES(TL) FKPK MESSAGE_TYPE MSGPK MESSAGE_NAME MSGPK NAME

DISPLAY_NAMETYPEVALUE_TYPEDATE_DEFAULTNUMBER_DEFAULTTEXT_DEFAULTFORMATSEQUENCE

(Default)

LTY WF_LOOKUP_TYPES_TL FKPK LOOKUP_TYPE PK LANGUAGE

ITEM_TYPE TYPDISPLAY_NAME

LKC WF_LOOKUPS_TL FKPK LOOKUP_TYPE LTYPK LOOKUP_CODEPK LANGUAGE

MEANING

ACT WF_ACTIVITIES(TL) FKPK ITEM_TYPE TYPPK NAMEPK VERSION

FUNCTION_TYPEDISPLAY_NAMERUNNABLE_FLAG RESULT_TYPE RERUN COSTFUNCTIONMESSAGE MSGEVENT_NAMEDIRECTION

Page 38: Oracle Workflow

Data Model and the Process Window

WF_PROCESS_ACTIVITIES

WF_ACTIVITY_TRANSITIONS

Page 39: Oracle Workflow

Process Activities

WF_PROCESS_ACTIVITIESCreated by dragging an Activity onto the Process WindowCopies the Information from WF_ACTIVITY_ATTRIBUTES to

WF_ACTIVITY_ATTR_VALUES

Assigns it an INSTANCE_IDLabel is needed to uniquely identify ActivityVersion Information is recorded for the Process.For Notifications, the Performer is assigned here

Page 40: Oracle Workflow

Activity Attribute Values

WF_ACTIVITY_ATTR_VALUES

Page 41: Oracle Workflow

Activity Transitions

WF_ACTIVITY_TRANSITIONS Represented by the Flow Arrow from one Activity to

Another The Arrow may have a Result Code

Allows Multiple Arrows from a single Activity A Default May be tied to the Flow Arrow (*)

Three Key pieces of information needed for a transition FROM_PROCESS_ACTIVITY – Instance Id RESULT_CODE TO_PROCESS_ACTIVITY – Instance Id

Page 42: Oracle Workflow

Data Model

TYP WF_ITEM_TYPES(TL) FKPK NAME

DISPLAY_NAMEWF_SELECTORPERSISTENCE_TYPEPERSISTENCE_DAYSDESCRIPTION

ATR WF_ITEM_ATTRIBUTES(TL) FKPK ITEM_TYPE TYPPK NAME

DISPLAY_NAMETYPEDATE_DEFAULTNUMBER_DEFAULTTEXT_DEFAULTFORMATSEQUENCE

MSG WF_MESSAGES(TL) FKPK TYPE TYPPK NAME

DISPLAY_NAMEPRIORITYSUBJECTBODYHTML_BODY

ACT

ACT1

PRC WF_PROCESS_ACTIVITIES FKPK INSTANCE_ID

INSTANCE_LABEL PROCESS_ITEM_TYPE ACT

PROCESS_NAME ACTPROCESS_VERSION ACTACTIVITY_ITEM_TYPE ACT1ACTIVITY_NAME ACT1START_ENDDEFAULT_RESULT PERFORM_ROLE

TRN WF_ACTIVITY_TRANSITIONS FKPK FROM_PROCESS_ACTIVITY PROPK RESULT_CODEPK TO_PROCESS_ACTIVITY PRO1

PRO1P

RO

AAT WF_ACTIVITY_ATTRIBUTES(TL) FKPK ACTIVITY_ITEM_TYPE ACTPK ACTIVITY_NAME ACTPK ACTIVITY_VERSION ACTPK NAME

DISPLAY_NAMETYPEVALUE_TYPEDATE_DEFAULTNUMBER_DEFAULTTEXT_DEFAULTFORMATSEQUENCE

(Default)

MAT WF_MESSAGE_ATTRIBUTES(TL) FKPK MESSAGE_TYPE MSGPK MESSAGE_NAME MSGPK NAME

DISPLAY_NAMETYPEVALUE_TYPEDATE_DEFAULTNUMBER_DEFAULTTEXT_DEFAULTFORMATSEQUENCE

(Default)

AAV WF_ACTIVITY_ATTR_VALUES FKPK PROCESS_ACTIVITY_ID ACTPK NAME AAT

VALUE_TYPEDATE_DEFAULTNUMBER_DEFAULTTEXT_DEFAULT

LTY WF_LOOKUP_TYPES_TL FKPK LOOKUP_TYPE PK LANGUAGE

ITEM_TYPE TYPDISPLAY_NAME

LKC WF_LOOKUPS_TL FKPK LOOKUP_TYPE LTYPK LOOKUP_CODEPK LANGUAGE

MEANING

ACT WF_ACTIVITIES(TL) FKPK ITEM_TYPE TYPPK NAMEPK VERSION

FUNCTION_TYPEDISPLAY_NAMERUNNABLE_FLAG RESULT_TYPE RERUN COSTFUNCTIONMESSAGE MSGEVENT_NAMEDIRECTION

Adobe Acrobat Document

Page 43: Oracle Workflow

Workflow Transaction Tables

Used to record life cycle information for a workflow process of a specific Transaction (ITEM)

Sales Order Header or Lines Purchasing Approval Process Generate an Accrual Account using Account Generator

Tables identified by ITEM_TYPE ITEM_KEY

Tables WF_ITEMS WF_ITEM_ATTRIBUTE_VALUES WF_ITEM_ACTIVITY_STATUSES WF_ITEM_ACTIVITY_STATUSES_H WF_NOTIFICATIONS

Page 44: Oracle Workflow

Workflow Item

An ITEM is a transactional instance of a workflow processCreated by the WF_ENGINE.CREATE_PROCESS Key Columns

ITEM_TYPEITEM_KEYROOT_ACTIVITYROOT_ACTIVITY_VERSIONPARENT_ITEM_TYPE Master Detail RelationshipsPARENT_ITEM_KEY Master Detail Relationships

Page 45: Oracle Workflow

Master – Detail Relationship

Master Detail Relationship OM Order Line – 51990 is the Detail OM Order Header – 47332 is the Master (Parent)

SQL> select item_type, item_key, parent_item_type, parent_item_key 2 from wf_items 3 where item_type = 'OEOL' 4 and item_key = '51990';Item Type Item Key PARENT_ITEM_TYPE PARENT_ITEM_KEY========= ======== ================ ===============OEOL 51990 OEOH 47332

1 row selected.

Page 46: Oracle Workflow

Item Attribute Values

Created by the WF_ENGINE.CREATE_PROCESS Values used by the Workflow Engine whenever an

attribute value is needed for transactional processingKey Columns

NAMETEXT_VALUENUMBER_VALUEDATE_VALUEEVENT_VALUE (WF_EVENT_T)

Page 47: Oracle Workflow

Item Activity Statuses First Used by the WF_ENGINE.STARTPROCESS See the Workflow Monitor for related data WF_ITEM_ACTIVITY_STATUSES

Process_Activity Activity_Status Activity_Result_Code Notification_id Assigned_user Begin/End_Date Due_Date Error_Name Error_Message Error_Stack

Page 48: Oracle Workflow

Activity Status History

WF_ITEM_ACTIVITY_STATUSES_HKeeps a history of Activities that are re-visited when

processing an Item Primary Key Index WF_ITEM_ACTIVITY_STATUSES_PK is violated

when revisiting an activityITEM_TYPEITEM_KEYPROCESS_ACTIVITY

Page 49: Oracle Workflow

Notifications

WF_NOTIFICATIONS NOTIFICATION_ID GROUP_ID MESSAGE_TYPE MESSAGE_NAME STATUS ACCESS_KEY MAIL_STATUS PRIORITY RESPONDER CALLBACK ORIGINAL_RECIPIENT

Page 50: Oracle Workflow

Data Model

STA WF_ITEM_ACTIVITY_STATUSES FKPK ITEM_TYPE ITMPK ITEM_KEY ITMPK PROCESS_ACTIVITY PRC

ACTIVITY_STATUSACTIVITY_RESULT_CODEERROR_NAMEERROR_MESSAGE ERROR_STACK ASSIGNED_USERNOTIFICATION_ID NOTEND_DATEBEGIN_DATEOUTBOUND_QUEUE_IDDUE_DATEEXECUTION_TIME

ITM WF_ITEMS FKPK ITEM_TYPE TYPPK ITEM_KEY

ROOT_ACTIVITY ACTROOT_ACTIVITY_VERSION ACTOWNER_ROLE PARENT_ITEM_TYPE TYPPARENT_ITEM_KEY PARENT_CONTEXT BEGIN_DATE END_DATE USER_KEY

STH WF_ITEM_ACTIVITY_STATUSES_H FKPK ITEM_TYPE ITMPK ITEM_KEY ITMPK PROCESS_ACTIVITY PRC

ACTIVITY_STATUSACTIVITY_RESULT_CODEERROR_NAMEERROR_MESSAGE ERROR_STACK ASSIGNED_USERNOTIFICATION_ID NOTEND_DATEBEGIN_DATEOUTBOUND_QUEUE_IDDUE_DATEEXECUTION_TIME

ATV WF_ITEM_ATTRIBUTE_VALUES FKPK ITEM_TYPE ITMPK ITEM_KEY ITMPK NAME ATR

TEXT_VALUE NUMBER_VALUE DATE_VALUE EVENT_VALUE

NOT WF_NOTIFICATIONS FKPK NOTIFICATION_ID

GROUP_ID MESSAGE_TYPE TYPMESSAGE_NAME MSGRECIPIENT_ROLE ROLSTATUS ACCESS_KEY MAIL_STATUS PRIORITY BEGIN_DATE END_DATE DUE_DATE RESPONDER USER_COMMENT CALLBACK CONTEXT ORIGINAL_RECIPIENT FROM_USER TO_USER SUBJECT

Page 51: Oracle Workflow

Directory Services

Used for sending NotificationsViews referencing multiple tables Views

WF_USERSWF_ROLESWF_USER_ROLES

Page 52: Oracle Workflow

Data Model

USR WF_USERS FK NAME

DISPLAY_NAMEDESCRIPTION NOTIFICATION_PREFERENCE TERRITORY EMAIL_ADDRESS ORIG_SYSTEM ORIG_SYSTEM_ID STATUS EXPIRATION_DATE

ROL WF_ROLES FK NAME

DISPLAY_NAMEDESCRIPTION NOTIFICATION_PREFERENCE TERRITORY EMAIL_ADDRESS ORIG_SYSTEM ORIG_SYSTEM_ID STATUS EXPIRATION_DATE

URL WF_USER_ROLES FK USER_NAME

USER_ORIG_SYSTEM USER_ORIG_SYSTEM_ID ROLE_NAME ROLE_ORIG_SYSTEM ROLE_ORIG_SYSTEM_ID

Page 53: Oracle Workflow

WF_USERS

Tables ReferencedPER_ALL_PEOPLE_FFND_USERHZ_PARTIES

PARTY_TYPE = PERSON PARTY_TYPE = PARTY_RELATIONSHIP

WF_LOCAL_USERS

Page 54: Oracle Workflow

WF_ROLES

Tables ReferencedWF_USERSPER_POSITIONSENG_ECN_APPROVAL_LISTSFND_RESPONSIBILITY_TLGHR_GROUPBOXESAMV_C_CHANNELS_TLHZ_PARTIES for PARTY_TYPE=GROUPWF_LOCAL_ROLES

Page 55: Oracle Workflow

WF_USER_ROLES

Tables ReferencedPER_POSITIONS – PER_ALL_PEOPLE_FENG_ECN_APPROVAL_LISTS – PER_ALL_PEOPLE_FFND_RESPONSIBILITY_TL - FND_USERGHR_GROUPBOXES - FND_USERAMV_C_CHANNELS_TL - PER_ALL_PEOPLE_FHZ_PARTIES – HZ_PARTY_RELATIONSHIPSWF_LOCAL_ROLES

Page 56: Oracle Workflow

Scripts – Note: 183643.1

BDE_Wf_DEF.sqlWorkflow Definition ScriptUse in addition to the workflow definition file (.wft)

BDE_WF_ITEM.sqlUse for investigating a single instance of a processSimilar to wfstat.sql and wfstatus.sql

$FND_TOP/sqlwfch…sql scripts change the name of workflow elementswfstat.sql – Internal nameswfstatus.sql – Display nameswfrefchk.sql – Checks the integrity of Primary Keys