Basic Concepts of Oracle Workflow
CONTENTS
1. DOCUMENT PURPOSE........................................................3
2. OVERVIEW OF ORACLE WORKFLOW...................................4
2.1. INTRODUCTION:....................................................................................4
2.2. IMPORTANT FEATURES OF WORKFLOW......................................................4
3. WORKFLOW BUILDER COMPONENTS..................................8
4. DETAILED EXPLANATION OF WORKFLOW PROCESS
COMPONENTS 10
5. DEFINING A WORKFLOW PROCESS...................................17
6. DEFINING PROCEDURES AND FUNCTIONS FOR ORACLE
WORKFLOW 19
7. MANAGING BUSINESS EVENTS.........................................22
8. CONCLUSION..................................................................25
9. REFERENCES...................................................................26
Page 2 of 25 Basic Concepts Infosys Technologies Ltd.
of workflow
1. Document Purpose
This document covers the detailed explanation of oracle workflow basic concepts.
Page 2 of 25 Basic Concepts of Page 2 of 25
Workflow
Page 3 of 25 Basic Concepts Infosys Technologies Ltd.
of workflow
2. Overview of Oracle Workflow
2.1.Introduction:
Oracle workflow has its own great importance in delivering business processes in
present scenario of competitive world where customer satisfaction is primary key.
Using this oracle workflow, we can define the business processes in such a way that
all the client requirements fulfilled which finally leads to their satisfaction and
improvement of business.
Using this workflow, we can automate the business processes, route the information
as per the business rules. In the current scenario of business where E-business is
taking higher portion of business, demand for integration of applications within the
enterprise and integration of a company’s application with client application is
getting increased which we can achieve well using oracle workflow. It is only the
oracle workflow which coordinates between internal and external business processes
in providing workflow solutions. We mainly uses Java, pl/sql to define any business
processes which gives us great relaxation in
defining the business processes the way in which customer needs are fulfills in an
optimized way.
2.2. Important features of Workflow
Oracle Workflow Builder:
Workflow builder is a platform where we can create the business processes by simply
dragging and dropping the workflow components such as item types, functions and
messages.
We can even modify the workflow activities as per the requirement at any time.
Please find below the workflow builder screenshot:
Page 3 of 25 Basic Concepts of Page 3 of 25
Workflow
Page 4 of 25 Basic Concepts Infosys Technologies Ltd.
of workflow
Workflow Engine:
Workflow engine is responsible for completion of an activity by executing respective
PL/SQL API or JAVA API. It is embedded in the Oracle database. It monitors workflow
states and coordinates the execution of activities for a process.
It identifies the activities which are eligible to get execute based on
workflow/business rules and some of those are branching, looping, sub flows and
parallel flows.
Some of the important packages of workflow are:
Wf_item_activity_status
Wf_engine_util
Wf_item_import
Wf_standard
Business Event System:
The Business event system can be used to communicate business events between
systems. This business event system uses Advanced Queuing infrastructure for the
communication purpose. By using Event Manager in this business event system, we
can register subscriptions to events, event activities through which we can model
business events within workflow processes. This subscribed code of the events is
executed same as that of code which called that particular event. This subscription
process allows us to include custom code on the event and to send event information
to workflow process and other external systems as well.
Workflow Definitions Loader:
It is a program which performs following:
1. To move workflow definitions between database and corresponding flat file.
2. To move workflow definitions from development environment to production
environment.
3. To apply any upgradations to existing systems.
Page 4 of 25 Basic Concepts of Page 4 of 25
Workflow
Page 5 of 25 Basic Concepts Infosys Technologies Ltd.
of workflow
Customization:
We can include our own PL/SQL procedures and external functions as activities in
defining workflow process. Workflow runs those procedures and functions whenever
procedures or functions prerequisites are satisfied. Even we can create our own
customized concurrent program to fulfill our requirements. All these things we can do
without modifying main application code.
Examples of custom packages:
Xxcca_wf_engine
Xxcca_wf_line_util_pk
Notification System:
All the activities in the workflow can not be automated. Some of the activities need
manual intervention such as approval for sales order booking or approval for leave.
Oracle workflow facilitates such functionalities to you with Notification system. It
allows you to include users in workflows to handle such activities. It sends
notifications to and processes responses from users in a workflow. These notifications
can be send to a role and this role can be an individual user or a group of users.
Action on that notification can be taken by any user associated with that role.
Notification generally would be having one message associated with it and this
message contains all the necessary information based on which user can take the
decision and based on this users’ decision next workflow activity will be decided.
Monitoring workflow process:
In order to view the progress of a work item in the workflow process, we can connect
to workflow monitor by using any web browser which supports Java. The Workflow
Monitor displays graphical view of a workflow item status and its respective workflow
process as a whole. It displays a separate status summary for the work item, the
process, and each activity in the process.
Please find below one of the monitoring screen:
Page 5 of 25 Basic Concepts of Page 5 of 25
Workflow
Page 6 of 25 Basic Concepts Infosys Technologies Ltd.
of workflow
Workflow Processes:
Business processes are being managed in workflow process according the rules that
we define. These rules include the activities that occur in the process and the
relationship between those activities. An activity in a process definition can be an
automated function which can be defined by a PL/SQL procedure or an external
function, a notification to a user or role which may request a response optionally, a
business event.
A workflow process is initiated by making calls to a group of Oracle Workflow
Engine APIs. From there Workflow Engine performs the required action, through a
specific workflow process definition. According to the workflow process definition, the
Workflow Engine performs automated steps and invokes appropriate agents when
external processing is required.
The following diagram depicts a simplified workflow process definition that takes care
of booking of a line.
Page 6 of 25 Basic Concepts of Page 6 of 25
Workflow
Page 7 of 25 Basic Concepts Infosys Technologies Ltd.
of workflow
3. Workflow Builder Components
As already mentioned, using workflow builder we can create, view, and modify the
workflow (business) process definitions. Using Navigator window in it, we can define
the activities and components of your Business process. Once all the activities are
defined, we can create process diagram by assembling them appropriately.
Structure of Workflow builder:
Navigator window is nothing but which displays the workflow process definition,
which otherwise called as data store, in the workflow builder. Data store is nothing
but database connection or flat file which contains the workflow process definition.
The data store is called as primary branch which contains set of processes and its
component objects under an item type. A data store may contain any number of item
types based on business requirement but it should have at least one item type for
the business process to be defined.
Please find below the pictorial representation for each:
The following seven tertiary branches appear beneath each item type branch as
shown above:
Attributes: It contains the attributes for the current item type which describe
features of an item type. For example, if an item type is a processing an order, then
an item type attribute can be the order number or approver.
Processes: All the workflow process definitions or process activities for the current
item type exists in it.
Page 7 of 25 Basic Concepts of Page 7 of 25
Workflow
Page 8 of 25 Basic Concepts Infosys Technologies Ltd.
of workflow
Notifications: It contains all the notification activities that are associated with the
current item type. A notification activity sends a message to a user or a role which
may prompt for a response from that user/role or may simply provide information.
Functions: All the function activities those are associated with the current item type
exists in it. A function activity, usually, represents a PL/SQL stored procedure which
gets executed automatically by the Workflow Engine. A function activity can also
have activity attributes associated with it.
Events: It contains the event activities which are associated with the current item
type. It represents a business event that the process receives, raises, or sends.
Messages: It contains the messages which can be send to a role or a user by a
notification activity which is associated with the current item type. A message can
have message attributes associated with it.
Lookup Types: All the lookup types which are associated with the current item type
exist in it. A lookup type has one or more values called lookup codes associated with
it which can be referenced by a function or by a message, or by a notification, or by a
process as its possible result type.
Creation of Process Definitions using Oracle Workflow Builder:
To create a business process using workflow builder, first we should know our
requirements from end to end such as list of activities that should takes place and
order in which they should take place, different type of results and defining branching
for each result and different type of notifications and defining approvers etc.
There two standard ways of defining business process using workflow builder and
they are
1. Top-Down-Approach
2. Bottom-Up-Approach
Top–Down Approach: In this approach, fist process diagram with all required
activities needs to be prepared and then we have to create supporting objects for
each activity
Bottom–Up Approach: In this approach, first define all the supporting objects that
are required to design process diagram. Then, proceed with creation of higher level
process diagram.
Page 8 of 25 Basic Concepts of Page 8 of 25
Workflow
Page 9 of 25 Basic Concepts Infosys Technologies Ltd.
of workflow
4. Detailed explanation of Workflow Process Components
It is not necessary to define all workflow components to create a business process.
Based on business requirement we should define all or some of the workflow
components.
Please find below the different types of workflow process components:
Item Types
Lookup Types
Messages
Activities
Attributes
Roles
Item Types:
As earlier said item type is also called secondary branch. Each workflow process
contains at least one item type which contains all the components that make up
business process. Each component such as a message or a notification or a function
should associate with particular item type to create a process.
Item Type Attributes:
The property associated with the given item type is called an item type attribute. Any
activity under that particular item type can reference these item type attributes.
Based on these item type attributes we can get the information about an item that
makes up the workflow process. For example, the” Standard” item type has an item
type attribute called” Approver”.
The process ‘Vote Test’ shown below requires the value of this item type attribute to
approve valid requestor’s requests for voting.
Page 9 of 25 Basic Concepts of Page 9 of 25
Workflow
Page 10 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
Attribute Types:
There are ten attribute types in total which decides the nature of particular attribute.
These attribute types decides the values that can be taken by a particular attribute.
Page 10 of 25 Basic Concepts of Page 10 of 25
Workflow
Page 11 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
Please find below the short explanation of each attribute:
Text: This attribute value is a string of text.
Number: This attribute value is a number and you can specify your format.
Date: Value of this attribute is a date and we can specify our format that
we want have.
Lookup: Value of this attribute value is one of the lookup code values that
are specified in a specified lookup type.
Form: Oracle Applications internal form function name is value of this
attribute
Along with its optional form function parameters.
Role: Mainly used for sending of notifications
Please find below one of such screenshot:
A detailed explanation given for type ‘Role’ further in the section of ‘Defining
Workflow Process’
URL: By using this attribute type, user can respond to their outstanding
work items.
Document: Attached document is the value of this attribute. This
document can be pl/sql document or an external document. Please find
below the screenshot where an attribute with pl/sql document is defined.
Page 11 of 25 Basic Concepts of Page 11 of 25
Workflow
Page 12 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
Event: A detailed explanation given in the section of ‘Managing
business events’
Lookup Types:
A lookup type is a static list of values which can be referenced by item type,
activity attributes, message and activities. An activity can get its possible
results by referring to lookup types. For example, a performer can get a list of
possible response in a message of notification. Message will get that list of
responses by referring to lookup types.
Ex: Lookup Type Book Results can have five options as shown below which
can be used while we are defining the process for booking of an order.
Page 12 of 25 Basic Concepts of Page 12 of 25
Workflow
Page 13 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
Messages:
It contains all the workflow messages under the current item type.
A message is nothing but which a notification activity sends to a role or a
group in a workflow process. Some messages need reply/action based on
which next activity in the process will be determined. The recipient of a
workflow message is called the performer. Each message is associated with a
particular item type which allows the message to reference the item type’s
attributes for token replacement at runtime when the message is delivered.
While defining the message itself, we can specify that the message expecting
a response from the recipient. You can create a message with context–
sensitive content by including message attribute tokens in the message
subject and body that reference item type attributes.
To create notification activity this message should be dragged to notification
branch which sends the message actually. To update message activity, we
can directly drag a message on to an existing notification activity. Please find
below the property window of a message:
Page 13 of 25 Basic Concepts of Page 13 of 25
Workflow
Page 14 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
Whenever you are expecting certain result from the notification recipient, the
message should indicate him that he needs to response. Then you have to
identify the particular recipient who has to respond (In above notification, it is
approver).Then go to Nodes tab shown in above window and there in
‘Performer’ block provide the corresponding attribute of approver in ‘Value’
field..
Page 14 of 25 Basic Concepts of Page 14 of 25
Workflow
Page 15 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
Activities
An activity is nothing but a unit of work which contributes toward the
completion of a workflow process. It can be a process, a function, a
notification or an event. Examples are calling the pl/sql procedure (this can be
done by function) for the completion of process and sending message to the
user through notification activity.
Page 15 of 25 Basic Concepts of Page 15 of 25
Workflow
Page 16 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
5. Defining a Workflow Process
In the oracle workflow builder, process window graphically represents the business
process by activities and transitions.
Each activity is a node, a logical step that contributes toward the completion of a
process.
We can directly create the activities in process window or we can drag the activities
from some other branches like notification or function in navigator tree. The
properties for an activity node may be viewed or edited by double clicking on the
node in the Process window with the select mouse button. Transitions between the
activities can be defined by drawing arrows from one node to next node by using
mouse button.
A process, a function, a notification and event activities make up the nodes of a
process. A process may contain one more process in its diagram and this process
activity is nothing but sub process. A parent process may contain any number of sub
processes in order to achieve desired functionality. In order to view sub process
diagram, we can double click on sub process activity node in the parent process
window. Please find below the property window of a process which contains sub
process:
Transitions:
Start and completion of an activity represented by these transitions itself. Transitions
are indicated by an arrow in the workflow process diagram. Current activity result
type decides the direction of these transitions. If an activity completes with a result
type of ‘None’, then transition simply appears as an arrow to the next activity.
Page 16 of 25 Basic Concepts of Page 16 of 25
Workflow
Page 17 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
When an activity has defined result type, then a transition should be associated with
each of activity’s possible results based on which next activity to be executed will be
decided.
We can also create a ‘Default’, ‘Timeout’, or ‘Any’ transition for an activity that has a
defined result type. If any of the transition does not match with completion result,
then The Workflow Engine follows a ’Default’. Regardless of what completion result
the activity returns, the Workflow Engine follows an ‘Any’ which allows you to include
a generic activity in the process that the Workflow Engine executes in parallel with
the result–specific activity. A ‘Timeout’ transition followed by the Workflow Engine if
the notification activity times out before completion.
Activities can have multiple transitions for a single result to create parallel branches.
Timeout Transitions:
If the current activity is not getting completed within the time and if we want to
execute some other activity, then we should draw a ‘Timeout’ transition from a
notification activity to some other that you want to perform.
Roles:
Roles of oracle workflow stored in database, in the workflow directory service.
New workflow roles cannot be created in Oracle Workflow Builder, but Oracle
Workflow Builder can display and reference the roles stored in a database.
Referencing Roles in a Workflow Process:
We can reference a role in a workflow process in the following way:
1. Include a notification activity in a process as a node
2. Assign that node to a performer as already said in the section ‘Detailed
explanation of Workflow Process Components’.
The performer can be designated role or an item type attribute that dynamically
returns a role. To assign a performer to a role, you must initially load the roles from
your Oracle Workflow database into your Oracle Workflow Builder session.
Page 17 of 25 Basic Concepts of Page 17 of 25
Workflow
Page 18 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
6. Defining Procedures and Functions for Oracle Workflow
Standard Activities:
To control the business process, oracle Workflow provides some generic activities.
Standard item type contains these activities which can be used with any process that
we define. The Standard item type is automatically installed on Oracle Workflow
server.
And/Or Activities:
When a multiple parallel branches transitioning to a single node, flow to next activity
can be in scenarios:
1. Move to next activity when all the branches at that node completes
2. Move to next activity when any one of those branches completes
To implement first scenario we can use And activity and to implement second
scenario we can use Or activity.
And:
Completes when the activities from all converging branches complete. Calls a PL/SQL
procedure named WF_STANDARD.ANDJOIN.
Or:
Completes when the activities from at least one converging branch complete. Calls a
PL/SQL procedure named WF_STANDARD.ORJOIN.
Please find below the respective screenshot:
Page 18 of 25 Basic Concepts of Page 18 of 25
Workflow
Page 19 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
Concurrent Manager Standard Activities:
In order to control the business process that we define, some generic activities are
provided by oracle applications if we are using the version of Oracle Workflow
embedded in Oracle Applications. These activities are associated with the Concurrent
Manager Functions item type but can be used within any process you define:
Execute Concurrent Program Activity
Submit Concurrent Program Activity
Wait for Concurrent Program Activity
Please find the same in below screenshot:
Page 19 of 25 Basic Concepts of Page 19 of 25
Workflow
Page 20 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
Page 20 of 25 Basic Concepts of Page 20 of 25
Workflow
Page 21 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
7. Managing Business Events
The Oracle Workflow Business Event System is an application service that
leverages the Oracle Advanced Queuing (AQ) infrastructure to communicate business
events between systems. The Business Event System consists of the Event Manager
and workflow process event activities.
The Event Manager contains a registry of business events, systems, named
communication agents within those systems, and subscriptions indicating that an
event is significant to a particular system. Events can be raised locally or received
from an external system or the local system through AQ. When a local event occurs,
the subscribing code is executed in the same transaction as the code that raised the
event, unless the subscriptions are deferred.
Subscriptions can include the following types of processing:
Executing custom code on the event information
Sending event information to a workflow process
Sending event information to other queues or systems
Business events are represented within workflow processes by event activities. By
including event activities in a workflow process, you can model complex processing
or routing logic for business events beyond the options of directly running a
predefined function or sending the event to a predefined recipient.
The uses of the Business Event System include following things:
System integration messaging hubs:
Oracle Workflow with the Business Event System can serve as a messaging hub for
complex system integration scenarios. The Event Manager can be used to”hard–wire”
routing between systems based on event and originator. Workflow process event
activities can be used to model more advanced routing, content–based routing,
transformations, error handling, and so on.
Distributed applications messaging:
Applications can supply Generate and Receive event message handlers for their
business entities. For example, message handlers can be used implement
Master/Copy replication for distributed applications.
Message–based system integration:
You can set up subscriptions, which cause messages to be sent from one system to
another when business events occur. In this way, you can use the Event Manager to
implement point–to–point messaging integration.
Business–event based workflow processes:
You can develop sophisticated workflow processes that include advanced routing or
processing based on the content of business events.
Non–invasive customization of packaged applications:
Page 21 of 25 Basic Concepts of Page 21 of 25
Workflow
Page 22 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
Analysts can register interesting business events for their internet or intranet
applications. Users of those applications can register subscriptions to those events to
trigger custom code or workflow processes.
Event Manager:
The Oracle Workflow Event Manager lets you register interesting business events that
may occur in your applications, the systems among which events will be
communicated, named communication agents within those systems, and
subscriptions indicating that an event is significant to a particular system.
Events:
A business event is an occurrence in an internet or intranet application or program
that might be significant to other objects in a system or to external agents. For
instance, the creation of a purchase order is an example of a business event in a
purchasing application. You can define your significant events in the Event Manager.
Event Manager for Oracle Applications:
The Oracle Workflow Event Manager lets you register interesting business events that
may occur in your applications, the systems among which events will be
communicated, named communication agents within those systems, and
subscriptions indicating that an event is significant to a particular system. The Event
Manager also performs subscription processing when events occur. Please find below
the window which we use to define the window
The ‘Cost’ value shown in above screenshot plays a vital role in executing the given
event.
Page 22 of 25 Basic Concepts of Page 22 of 25
Workflow
Page 23 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
If its value is below 50, given event will get execute immediately when its turn
comes. If the value of ‘Cost’ is more than 50, then that particular event will get
execute later as a DEFERRED activity. This is applicable not only for an event but also
for the functions which gets execute during workflow process.
Page 23 of 25 Basic Concepts of Page 23 of 25
Workflow
Page 24 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
8. Conclusion
This document helps anyone to understand basic concepts of workflow.
Page 24 of 25 Basic Concepts of Page 24 of 25
Workflow
Page 25 of 25 Basic Infosys Technologies Ltd.
Concepts of workflow
9. References
Oracle Order Management Implementation Manual
Page 25 of 25 Basic Concepts of Page 25 of 25
Workflow