Workflow Best Practices

WORKFLOW OVERVIEW

Oracle applications comes with Oracle Workflow (WF) already installed as part of the Application object library (AOL).
Oracle Workflow automates and streamlines business processes both within and beyond your enterprise; supporting traditional applications based workflow as well as e-business integration workflow.
Oracle workflow is unique in providing a workflow solution for both internal process (across different modules) and business process co-ordination between applications.
Oracle Workflow lets you set up subscriptions to business events which can launch workflows or enable messages to be propagated from one system to another when business events occur. You can communicate events among systems within your own enterprise and with external systems as well. In this way, you can implement point-to-point messaging integration or use Oracle Workflow as a messaging hub for more complex system integration scenarios. You can model business processes that include complex routing and processing rules to handle events powerfully and flexibly.
Ex. If a SAP system is the front end for your order booking and inventory, shipping is done by Oracle E-Business suite ERP, Integration between SAP application and E-Business application happens using the XML Gateway and Oracle Workflow.

E-BUSINESS SUITE WORKFLOW

Oracle Workflow consists of two tiers: Workflow Client and Workflow Server.
WORKFLOW CLIENT:
The Workflow Builder is used by Workflow Developers to create or modify custom workflows. This is installed on Windows 95/NT/2000 clients only.

WORKFLOW SERVER:

THE WORKFLOW ENGINE: Monitors workflow states and coordinates the routing of activities for a process.
WORKFLOW NOTIFICATION MAILER (WFMAIL): Electronic mail (E–mail) users can receive notifications of outstanding work items and can respond to those notifications using their E–mail application of choice.
WORKFLOW DEFINITIONS LOADER (WFLOAD): Workflow Definitions Loader is a utility program that moves workflow definitions between databases. You can use it to move workflow definitions from a development to a production database, or to apply upgrades to existing definitions.
WORKFLOW MONITOR: Workflow administrators and users can view the progress of a work item in a workflow process by connecting to the Workflow Monitor using a standard Web browser that supports Java.
WORKFLOW BACKGROUND ENGINE: A supplemental Workflow Engine that processes deferred or timed out activities.
PURGE OBSOLETE WORKFLOW RUNTIME DATA CONCURRENT PROGRAM (WF_PURGE): Purges obsolete item type runtime status information.

TYPICAL WORKFLOW ENGINE AND ITS COMPONENTS WITHIN EBS DATABASE

WORKFLOW RUNTIME INFORMATION

In oracle e-business suite the number of functional modules that make use of Workflow are large, as is the corresponding amount of information retained in certain workflow tables.
The amounts of data in these tables grow substantially if proper clean up or purge process is not defined.
While designing workflow other than standard processes it is very important to properly design to close the workflow events at all stages.
Ex. An open notification will not close the corresponding workflow item, there by the purge process cannot purge this workflow run time information. It is important to close the notification to complete the workflow lifecycle.

WORKFLOW BEST PRACTICES

E-business suite applications provide different methods to improve performance of workflow process. Workflow Practices for Performance are:
a) Workflow background process
b) Workflow purge process
c) Workflow agent listeners
d) Workflow synchronous vs. asynchronous

WORKFLOW BACKGROUND PROCESS

Background engine is necessary to process the workflow deferred, timeout, stuck activities.
Submit Workflow Background process concurrent program with appropriate flag. Process stuck activities are time consuming so when you schedule the background process for stuck processes run during off business hours or daily one time.
Process deferred and Process timeout background program can be run in regular intervals in every 5 – 15 mins.

WORKFLOW PURGE PROCESS

One of the essential administrative tasks concerning Oracle Workflow is to purge of runtime data that is no longer required without affecting active Workflow processes. This task is performed via Purge APIs and the Purge Concurrent Request.
Purge APIs are PL/SQL Packages offer flexibility to purge obsolete run time data for completed items and processes. Using APIs requires some knowledge about what tables and Workflow data is involved.
The recommended method is to submit the Purge Obsolete Workflow Runtime Data concurrent request. The benefit of using this concurrent request is that it does not require as much knowledge about the Workflow tables involved; however, the disadvantage is that the purge request may not purge all expected data.
In WF_NOTIFICATIONS if the notifications are in ‘Open’ status, for whatever the underlying reason, the workflow process is not termed as completed and the Purge program cannot purge the corresponding workflow data.
Purge program checks and purges data from all or some of the below listed tables.
WF_ITEM_ACTIVITY_STATUSES
WF_ITEM_ACTIVITY_STATUSES_H
WF_COMMENTS
WF_NOTIFICATIONS
WF_ITEMS
WF_ITEM_ATTRIBUTE_VALUES
WF_ACTIVITY_ATTR_VALUES
WF_ACTIVITY_TRANSITIONS
WF_PROCESS_ACTIVITIES
WF_ACTIVITY_ATTRIBUTES_TL
WF_ACTIVITY_ATTRIBUTES
WF_ACTIVITIES
WF_ACTIVITIES_TL
WF_NOTIFICATION_ATTRIBUTES
WF_LOCAL_USER_ROLES
WF_LOCAL_ROLES
WF_USER_ROLE_ASSIGNMENTS
If the obsolete data is not purged the size of the above mentioned tables may grow substantially accounting for overall bad workflow runtime performance.
Schedule the workflow purge program to run every day or week. You can purge data by age.

 

WORKFLOW AGENT LISTENERS

Workflow business events raise events at each stage of workflow process. These events are picked and processed by the workflow agent listeners. Whenever a workflow event is triggered the workflow queue is populated with the corrid – business event. Workflow agent listener defined on that queue is invoked and takes the necessary action. The process is called en queue and de queue.
The performance expectation of workflow agent listeners is how fast the en queue and de queue happens.
Some of the tuning steps to take here are:
1. Decrease the sleep time of the agent listener
2. Define custom agent listeners for the busy queue or
3. Dedicated listener for a particular event on a queue

WORKFLOW SUBSCRIPTIONS
SYNCHRONOUS VS. ASYNCHRONOUS

Workflow populates the event in WF queue if it is a deferred process, meaning asynchronous. You may design workflow process synchronously to improve the performance.
A synchronous process contains only activities that can be executed immediately, so that the Workflow Engine executes the process without interruption from start to finish. The Workflow Engine does not return control to the calling application until it completes the process.
An asynchronous process is a process that the Workflow Engine cannot complete immediately because it contains activities that interrupt the flow. Examples of activities that force an asynchronous process include deferred activities, notifications with responses, blocking activities, and wait activities. Rather than waiting indefinitely when it encounters one of these activities, the Workflow Engine sets the audit tables appropriately and returns control to the calling application. The workflow process is left in an unfinished state until it is started again, usually by the Notification System, Business Event System, or the background engine. With an asynchronous process, the user does not have to wait for the process to complete to continue using the application. However, the results of the process are not available until the process is completed at a later time.

Monitor datapump jobs

Want to check what the datapump export or import is doing, execute the below queries to get the information from database.

select * from dba_datapump_jobs;

select * from dba_datapump_sessions;

select username,opname,target_desc,sofar,totalwork,message from V$SESSION_LONGOPS;

Tip: Improve the process time by increasing the parallel process. Define option with expdp command ‘PARALLEL=x’