Вы находитесь на странице: 1из 56

<Insert Picture Here>

Oracle Workflow
Sunil Dev
Oracle GSD India
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


Components

• The Workflow Processes


• Workflow Engine
• Workflow Builder
• Business Event System
• Notification System
• The Workflow Monitor
• Workflow Definitions Loader
Complete Process Representation
Notify Approver

Requisition Approval Process

No Yes
Verify Authority Approve Re quisition Notify Re questor of End (Approve d)
Approva l
Approved
True
Re c ord Requisition
Forward Re je cte d
Sta rt Select Approve r True And Notify Approver Re je ct Requisition Notify Re questor of End (Re je c te d)
Re je ction
Notify Reque stor of
False Forward

Notify Reque stor No End (Rejec ted)


Approver Availa ble
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
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
Designing a Process
Rule-Based Workflow Engine
Server Side Architecture Ensures Optimal Performance

Oracle • Manages the execution of a business


Applications process
• Immediate and background operation

Oracle • Generates 100% audit trail


Workflow • Delivers notifications when human
activities are required
• Oracle database transactional integrity
Oracle guarantees consistency between
o7 application and workflow state
DB
Rule-Based Workflow Engine

• Looping
• Results-based
branching

• Parallel flows
• Rendezvous
Rule-Based Workflow Engine

• Voting
• Time-outs
• Escalation
• Automatic forwarding

• Sub-processes
• Unlimited hierarchy of sub-
processes
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
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
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
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
Notification System

Oracle Notification
Worklist
InterOffice
Developer 2000
Client
Various
Notifications
Mail SMTP
Applications
Notification
Worklist
• Lotus Notes
MAPI Web Client
• MS Exchange
• Oracle InterOffice
• Unix Sendmail
• Others

Oracle Workflow Oracle Workflow


Notification Mailer Oracle server Worklist
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
Oracle Workflow Monitor
Oracle Workflow Monitor
Workflow Architecture
Directory Services
Notification
Worklist Users Roles
D2K Form

Web Notification Services Engine Workflow


Notification Builder
Worklist Send Execution

Respond Definition
Web Oracle
Process Application Forward Administration Workflow
Monitor Server Loader
Cancel Monitoring
Web
Analysis Query Query
Tools Workflow
Definition
Files
Mail
Applications Notification Oracle Workflow Enabled Application
Mailer

End-User Application Workflow


Oracle server Dev Client
Client Server
Oracle Workflow

Data Model
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
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
Data Model and the Workflow Builder

200+ Item Types

WF_ITEM_TYPES
defined in Oracle
WF_ITEM_ATTRIBUTES Applications

} WF_ACTIVITIES

WF_MESSAGES

WF_LOOKUP_TYPES_TL
Item Type Properties

WF_ITEM_TYPES
NAME
PERSISTENCE_TYPE
PERSITIENCE_DAYS
WF_SELECTOR
Item Attribute Properties

WF_ITEM_ATTRIBUTES
NAME
TYPE
FORMAT
TEXT_DEFAULT…
Events

WF_ACTIVITIES
TYPE = ' EVENT'
DIRECTION
EVENT_NAME
COST
Processes – Activity Tab

WF_ACTIVITIES
TYPE = ' PROCESS'
RUNNABLE_FLAG
RESULT_TYPE
Processes – Details Tab

WF_ACTIVITIES
ERROR_ITEM_TYPE
ERROR_PROCESS
RERUN
VERSION
Functions – Activity Tab

WF_ACTIVITIES
TYPE = ‘FUNCTION’
FUNCTION_NAME
FUNCTION_TYPE
RESULT_TYPE
COST
Notifications – Activity Tab

WF_ACTIVITIES
TYPE = ‘NOTICE’
FUCNTION_NAME
RESULT_TYPE
MESSAGE
Messages – Message Tab

WF_MESSAGES
DEFAULT_PRIORITY
 1 = High
 50 = Normal
 99 = Low
Messages – Body Tab

WF_MESSAGES_TL
SUBJECT
BODY
HTML_BODY
Uses the Translation table
Messages – Result Tab

WF_MESSAGES_ATTRIBUTES
Result Lookup Type
Default Type
 Constant
 Item Attribute
Default Value
Lookup Types

WF_LOOKUP_TYPES_TL
LOOKUP_TYPE
Only a Translation table exists
Lookup Codes

WF_LOOKUPS_TL
LOOKUP_TYPE
LOOKUP_CODE
Sub-Element of Lookup Types
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
Data Model – See Handout

AAT WF_ACTIVITY_ATTRIBUTES(TL) FK ACT WF_ACTIVITIES(TL) FK


PK ACTIVITY_ITEM_TYPE ACT PK ITEM_TYPE TYP
PK ACTIVITY_NAME ACT PK NAME
PK ACTIVITY_VERSION ACT PK VERSION
PK NAME FUNCTION_TYPE
DISPLAY_NAME DISPLAY_NAME
TYPE RUNNABLE_FLAG
VALUE_TYPE RESULT_TYPE
DATE_DEFAULT RERUN
NUMBER_DEFAULT COST
TEXT_DEFAULT FUNCTION
FORMAT MESSAGE MSG
SEQUENCE EVENT_NAME
DIRECTION

(Default)
ATR WF_ITEM_ATTRIBUTES(TL) FK
PK ITEM_TYPE TYP TYP WF_ITEM_TYPES(TL) FK
PK NAME PK NAME
DISPLAY_NAME LTY WF_LOOKUP_TYPES_TL FK
DISPLAY_NAME PK LOOKUP_TYPE
TYPE WF_SELECTOR
DATE_DEFAULT PK LANGUAGE
PERSISTENCE_TYPE ITEM_TYPE TYP
NUMBER_DEFAULT PERSISTENCE_DAYS
TEXT_DEFAULT DISPLAY_NAME
DESCRIPTION
FORMAT
SEQUENCE

(Default)
MSG WF_MESSAGES(TL) FK
MAT WF_MESSAGE_ATTRIBUTES(TL) FK PK TYPE TYP LKC WF_LOOKUPS_TL FK
PK MESSAGE_TYPE MSG PK NAME PK LOOKUP_TYPE LTY
PK MESSAGE_NAME MSG DISPLAY_NAME PK LOOKUP_CODE
PK NAME PRIORITY PK LANGUAGE
DISPLAY_NAME SUBJECT MEANING
TYPE BODY
VALUE_TYPE HTML_BODY
DATE_DEFAULT
NUMBER_DEFAULT
TEXT_DEFAULT
FORMAT
SEQUENCE
Data Model and the Process Window

WF_ACTIVITY_TRANSITIONS

WF_PROCESS_ACTIVITIES
Process Activities

WF_PROCESS_ACTIVITIES
Created by dragging an Activity onto the Process Window
Copies the Information from WF_ACTIVITY_ATTRIBUTES to
WF_ACTIVITY_ATTR_VALUES
Assigns it an INSTANCE_ID
Label is needed to uniquely identify Activity
Version Information is recorded for the Process.
For Notifications, the Performer is assigned here
Activity Attribute Values
WF_ACTIVITY_ATTR_VALUES
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
Data Model
PRC WF_PROCESS_ACTIVITIES FK
AAV WF_ACTIVITY_ATTR_VALUES FK PK INSTANCE_ID
PK PROCESS_ACTIVITY_ID ACT INSTANCE_LABEL
PK NAME AAT PROCESS_ITEM_TYPE ACT
VALUE_TYPE PROCESS_NAME ACT
DATE_DEFAULT PROCESS_VERSION ACT
NUMBER_DEFAULT ACTIVITY_ITEM_TYPE ACT1
TEXT_DEFAULT ACTIVITY_NAME ACT1
START_END
DEFAULT_RESULT
PERFORM_ROLE

ACT1

PRO1
PRO
ACT
AAT WF_ACTIVITY_ATTRIBUTES(TL) FK ACT WF_ACTIVITIES(TL) FK
TRN WF_ACTIVITY_TRANSITIONS FK
PK ACTIVITY_ITEM_TYPE ACT PK ITEM_TYPE TYP
PK FROM_PROCESS_ACTIVITY PRO
PK ACTIVITY_NAME ACT PK NAME
PK VERSION PK RESULT_CODE
PK ACTIVITY_VERSION ACT
PK TO_PROCESS_ACTIVITY PRO1
PK NAME FUNCTION_TYPE
DISPLAY_NAME DISPLAY_NAME
TYPE RUNNABLE_FLAG
VALUE_TYPE RESULT_TYPE
DATE_DEFAULT RERUN
NUMBER_DEFAULT COST
TEXT_DEFAULT FUNCTION
FORMAT MESSAGE MSG
SEQUENCE EVENT_NAME
DIRECTION

(Default)
ATR WF_ITEM_ATTRIBUTES(TL) FK
PK ITEM_TYPE TYP TYP WF_ITEM_TYPES(TL) FK
PK NAME PK NAME
DISPLAY_NAME LTY WF_LOOKUP_TYPES_TL FK
DISPLAY_NAME PK LOOKUP_TYPE
TYPE WF_SELECTOR
DATE_DEFAULT PK LANGUAGE
PERSISTENCE_TYPE ITEM_TYPE TYP
NUMBER_DEFAULT PERSISTENCE_DAYS
TEXT_DEFAULT DISPLAY_NAME
DESCRIPTION
FORMAT
SEQUENCE

(Default)
MSG WF_MESSAGES(TL) FK
MAT WF_MESSAGE_ATTRIBUTES(TL) FK PK TYPE TYP LKC WF_LOOKUPS_TL FK
PK MESSAGE_TYPE MSG PK NAME PK LOOKUP_TYPE LTY
PK MESSAGE_NAME MSG DISPLAY_NAME PK LOOKUP_CODE
PK NAME PRIORITY PK LANGUAGE
DISPLAY_NAME SUBJECT MEANING
TYPE BODY
VALUE_TYPE HTML_BODY
DATE_DEFAULT
NUMBER_DEFAULT
TEXT_DEFAULT
FORMAT
SEQUENCE

Adobe Acrobat
Document
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
Workflow Item

An ITEM is a transactional instance of a workflow process


Created by the WF_ENGINE.CREATE_PROCESS
Key Columns
ITEM_TYPE
ITEM_KEY
ROOT_ACTIVITY
ROOT_ACTIVITY_VERSION
PARENT_ITEM_TYPE Master Detail Relationships
PARENT_ITEM_KEY Master Detail Relationships
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.
Item Attribute Values

Created by the WF_ENGINE.CREATE_PROCESS


Values used by the Workflow Engine whenever an
attribute value is needed for transactional processing
Key Columns
NAME
TEXT_VALUE
NUMBER_VALUE
DATE_VALUE
EVENT_VALUE (WF_EVENT_T)
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
Activity Status History

 WF_ITEM_ACTIVITY_STATUSES_H
Keeps 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 activity
ITEM_TYPE
ITEM_KEY
PROCESS_ACTIVITY
Notifications

 WF_NOTIFICATIONS
 NOTIFICATION_ID
 GROUP_ID
 MESSAGE_TYPE
 MESSAGE_NAME
 STATUS
 ACCESS_KEY
 MAIL_STATUS
 PRIORITY
 RESPONDER
 CALLBACK
 ORIGINAL_RECIPIENT
Data Model
STH WF_ITEM_ACTIVITY_STATUSES_H FK
PK ITEM_TYPE ITM
ITM WF_ITEMS FK PK ITEM_KEY ITM
PK ITEM_TYPE TYP PK PROCESS_ACTIVITY PRC
ATV WF_ITEM_ATTRIBUTE_VALUES FK PK ITEM_KEY ACTIVITY_STATUS
PK ITEM_TYPE ITM ROOT_ACTIVITY ACT ACTIVITY_RESULT_CODE
PK ITEM_KEY ITM ROOT_ACTIVITY_VERSION ACT ERROR_NAME
PK NAME ATR OWNER_ROLE ERROR_MESSAGE
TEXT_VALUE PARENT_ITEM_TYPE TYP ERROR_STACK
NUMBER_VALUE PARENT_ITEM_KEY ASSIGNED_USER
DATE_VALUE PARENT_CONTEXT NOTIFICATION_ID NOT
EVENT_VALUE BEGIN_DATE END_DATE
END_DATE BEGIN_DATE
USER_KEY OUTBOUND_QUEUE_ID
DUE_DATE
EXECUTION_TIME

STA WF_ITEM_ACTIVITY_STATUSES FK
PK ITEM_TYPE ITM
PK ITEM_KEY ITM
PK PROCESS_ACTIVITY PRC
ACTIVITY_STATUS
ACTIVITY_RESULT_CODE
ERROR_NAME
ERROR_MESSAGE
ERROR_STACK
ASSIGNED_USER
NOTIFICATION_ID NOT
END_DATE
BEGIN_DATE
OUTBOUND_QUEUE_ID
DUE_DATE
EXECUTION_TIME

NOT WF_NOTIFICATIONS FK
PK NOTIFICATION_ID
GROUP_ID
MESSAGE_TYPE TYP
MESSAGE_NAME MSG
RECIPIENT_ROLE ROL
STATUS
ACCESS_KEY
MAIL_STATUS
PRIORITY
BEGIN_DATE
END_DATE
DUE_DATE
RESPONDER
USER_COMMENT
CALLBACK
CONTEXT
ORIGINAL_RECIPIENT
FROM_USER
TO_USER
SUBJECT
Directory Services

Used for sending Notifications


Views referencing multiple tables
Views
WF_USERS
WF_ROLES
WF_USER_ROLES
Data Model

URL WF_USER_ROLES FK
USER_NAME
USER_ORIG_SYSTEM
USER_ORIG_SYSTEM_ID
ROLE_NAME
ROLE_ORIG_SYSTEM
ROLE_ORIG_SYSTEM_ID

USR WF_USERS FK ROL WF_ROLES FK


NAME NAME
DISPLAY_NAME DISPLAY_NAME
DESCRIPTION DESCRIPTION
NOTIFICATION_PREFERENCE NOTIFICATION_PREFERENCE
TERRITORY TERRITORY
EMAIL_ADDRESS EMAIL_ADDRESS
ORIG_SYSTEM ORIG_SYSTEM
ORIG_SYSTEM_ID ORIG_SYSTEM_ID
STATUS STATUS
EXPIRATION_DATE EXPIRATION_DATE
WF_USERS

Tables Referenced
PER_ALL_PEOPLE_F
FND_USER
HZ_PARTIES
PARTY_TYPE = PERSON
PARTY_TYPE = PARTY_RELATIONSHIP
WF_LOCAL_USERS
WF_ROLES

Tables Referenced
WF_USERS
PER_POSITIONS
ENG_ECN_APPROVAL_LISTS
FND_RESPONSIBILITY_TL
GHR_GROUPBOXES
AMV_C_CHANNELS_TL
HZ_PARTIES for PARTY_TYPE=GROUP
WF_LOCAL_ROLES
WF_USER_ROLES

Tables Referenced
PER_POSITIONS – PER_ALL_PEOPLE_F
ENG_ECN_APPROVAL_LISTS – PER_ALL_PEOPLE_F
FND_RESPONSIBILITY_TL - FND_USER
GHR_GROUPBOXES - FND_USER
AMV_C_CHANNELS_TL - PER_ALL_PEOPLE_F
HZ_PARTIES – HZ_PARTY_RELATIONSHIPS
WF_LOCAL_ROLES
Scripts – Note: 183643.1

BDE_Wf_DEF.sql
Workflow Definition Script
Use in addition to the workflow definition file (.wft)
BDE_WF_ITEM.sql
Use for investigating a single instance of a process
Similar to wfstat.sql and wfstatus.sql
$FND_TOP/sql
wfch…sql scripts change the name of workflow elements
wfstat.sql – Internal names
wfstatus.sql – Display names
wfrefchk.sql – Checks the integrity of Primary Keys

Вам также может понравиться