In Oracle Warehouse Builder (OWB), not being able to deploy a process flow because it is running in the background is common. The following error message is usually thrown in control center when trying to deploy a Process Flow :

RPE-02062: ItemType xxx cannot be dropped as it has running Processes. You must first abort all the running processes using the Oracle Workflow Monitor.

RPE-02071: Deployment has been aborted due to a previously reported critical error.

where xxx is the name of the Process Flow package. For Example, I got following error message recently while working for a client on OWB 10g:

RPE-02062: ItemType MST_PKG cannot be dropped as it has running Processes. You must first abort all the running processes using the Oracle Workflow Monitor.

RPE-02062: ItemType MST_PKG cannot be dropped as it has running Processes. You must first abort all the running processes using the Oracle Workflow Monitor.

Cause For Error Message RPE-02062

The cause for this error is that the Process Flow that need to be deployed is having some running processes in the background (may be a hanging process) which is most probably not identifiable from Control Center.

The real problem is, you can’t kill something which is not visible and many times, silently running, orphan process flows (or hanging process flows) are not visible through OWB Control center. That is why OWB error message asks you to kill the processes using the Oracle Workflow Monitor.

Bottom line is that OWB cannot deploy a Process Flow when one of its process is in status “running”.

Solution 1: Kill Running Process Flows Using Using Oracle Workflow Monitor

If you have Oracle Workflow Monitor accessible, kill the process flows using the following steps:

  • On the OWF Monitor home page, use “Find Process” to find the process
  • In the “Process List” page, click on the Process Name
  • Click on the “View Diagram” button
  • Click on the “Abort Process” button

Now, purge the Item Type using SQLPlus/SQL Developer/Toad:

Connect as the Workflow schema owner and execute the following commands in order to purge the item type from the runtime repository:

WF_PURGE.TOTAL package

This script deletes obsolete runtime data which includes: Items, Item activity status, Notifications, Expired activity versions.

SQL> execute wf_purge.total

WFRMITT.sql script

This script deletes all definitions for an Item.

For OWB versions up to 10.2:

Windows:
SQL> @\wf\admin\sql\wfrmitt.sql

Linux/Unix:
SQL> @/wf/admin/sql/wfrmitt.sql

For OWB version 11g:

Windows:
SQL> @\owb\wf\admin\sql\wfrmitt.sql

Linux/Unix:
SQL> @/owb/wf/admin/sql/wfrmitt.sql

Now, deploy the Workflow Process again from the OWB Deployment Manager/Control Center and it should work just fine.

Solution 2: Kill Running Process Flows Without Using Using Oracle Workflow Monitor

Sometimes, getting access to Oracle Workflow Monitor is not the easiest thing in the world. Many times, it’s not even configured in the environment for the reasons not worth discussing. So, how do you kill those invisible hanging processes in this situation?

As Workflow Owner (generally OWF_MGR) run the following query to find out all the running process for the ItemType in question. You should find in the list the one failing to deploy:

SELECT item_type, item_key FROM wf_item_activity_statuses_v
WHERE activity_type_code= 'PROCESS' AND ITEM_TYPE = 'MST_PKG' AND activity_status_code != 'COMPLETE';

Now, as Workflow Owner (from the same schema,) execute the following command after having replaced the ‘MST_PKG’ with the item_type returned from the query in step 1 for your environment:

BEGIN
FOR i IN (SELECT item_key FROM owf_mgr.wf_items WHERE end_date IS NULL AND item_type = 'PKG_FLOW') LOOP
owf_mgr.wf_engine.abortprocess('PKG_FLOW', i.item_key);
owf_mgr.wf_purge.items('PKG_FLOW', i.item_key);
END LOOP;
END;
/

After the above two steps are completed, retry the Process Flow deployment and you should be able to succeed in deploying it again.

Your Turn, Share Your Experience

This is a common problem for those who have worked on OWB. If you are reading this, most probably you are searching for a solution to your current deployment problem. So, let us know if this helped you. Thank you kindly!