4 Replies Latest reply: Apr 2, 2013 1:08 AM by 827454 RSS

    How to purge OLD active & errored workflow??

      We have large number of errored workflow which are there from 2005. We want to purge those. Is there an standard procedure or script which can be used to purge the old unused errored, active workflow??

      Please suggest

        • 2. Re: How to purge OLD active & errored workflow??
          If the process is in error, then you need to abort the process - WF_ENGINE.AbortProcess is the API to call.

          If the process has any child flows, then these must be complete before purging can take place - if they are running, then you need to abort them using the same API.

          Once the process and all the child processes are complete, if they have been completed by the value of the persistence value for the Item Type, then you can purge them using the WF_PURGE APIs.


          WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development

          Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
          Have you read the blog at http://www.workflowfaq.com/blog ?
          WorkflowFAQ support forum: http://forum.workflowfaq.com
          • 3. Re: How to purge OLD active & errored workflow??
            Alejandro Sosa-Oracle
            You can follow WorkflowFAQ.com advice but check if, as per your Apps release, the procedure has the parameters 'verify_lock' and 'cascade' (these were added as a sort of enhancement request). If you have them then pass FALSE and TRUE respectively. This will take care of canceling the underlying children processes. So basically you will:

            create a cursor to identify those unwanted workflows
            loop through the cursor and call WF_ENGINE.AbortProcess(iitemtype => <cursor.item type>, temkey => <cursor.item key>, verify_lock=> FALSE, cascade=>TRUE);

            Those items will be removed by the purge when their persistence time has expired.

            Remember to do this first on a TEST environment.


            • 4. Re: How to purge OLD active & errored workflow??
              Is there any permanent fix for this problem , what is the actual reason for this?