Clearing Old Business Process Instances from LiveCycle Process Management

Instances of your business processes implemented as LiveCycle Process Management long-lived orchestrations can take up significant amounts of storage on your database. This is especially true if those orchestrations use a large number of document type process variables. Unless you proactively manage this, your database will keep growing until you get frantic calls from your DBA about the amount of storage being taken up. Many system administrators intuitively expect LiveCycle to have built-in mechanisms to delete old process instances but it does not.

In LiveCycle ES and ES2, Adobe provides a “Process Purge Tool” that lets you delete process instances older than a certain number of calendar days defined by your organization’s data retention policies. This is a stand alone utility that can be run remotely from a server other than the server hosting LiveCycle as long as it has the LiveCycle ES SDK available locally. This is usually the \LiveCycle_ES_SDK\ folder in %LC_INSTALL_ROOT%. Adobe Technical Guide here.

To clear all completed or terminated instances of a business process called “Samples – Simple Mortgage Loan-Flex/Processes/Simple Mortgage Loan – Flex” that are older than 30 days, you can perform the following steps (Windows example):

1) Determine the actual name of the process by querying the LiveCycle database directly (MySQL example – replace “lc_schema” with the name you chose for the LiveCycle schema):
SELECT
id as PROCESS_ID,
service_name as ORCHESTRATION_NAME,
complete_time as COMPLETE_TIME
FROM `lc_schema`.`tb_process_instance`
ORDER BY complete_time

The actual name of the process will be under the column ORCHESTRATION_NAME in the query result set. Please note that in some cases, this name will be different from what is displayed in LiveCycle Workbench (the use of special characters possible) – it is the Workbench name that you need to use with the Process Purge Tool.

2) Start a command prompt

3) Set a valid value for the environment variable LIVECYCLE_SDK_HOME with a command such as this:
set LIVECYCLE_SDK_HOME=C:\Programs\Adobe\LiveCycle_ES2\LiveCycle_ES_SDK

export LIVECYCLE_SDK_HOME=/opt/livecycle_es2/LiveCycle_ES_SDK in Unix.

4) Verify that the value for the environment variable has been set with this command:
echo %LIVECYCLE_SDK_HOME%

5) Change directory to %LC_INSTALL_ROOT%\LiveCycle_ES2\LiveCycle_ES_SDK\misc\Foundation\ProcessPurgeTool

6) Run the command to purge the processes you no longer need to retain:
ProcessPurge process “http://localhost:8080″ administrator password “Samples – Simple Mortgage Loan-Flex/Processes/Simple Mortgage Loan – Flex” “*” 30d “*” completed_or_terminated include_children

On Unix, edit ProcessPurge.sh so that the last two lines of the script looks as follows:
set -f
java -cp $CLASSPATH com.adobe.idp.workflow.ProcessPurgeTool $@

On Unix, the following command will work:
./ProcessPurge.sh process “http://localhost:8080″ administrator password “Samples – Simple Mortgage Loan-Flex/Processes/Simple Mortgage Loan – Flex” “*” 30d “*” completed_or_terminated include_children

If this worked, you will get a response from the server such as this:
Successfully started the process purge operation.
To see the progress, run the ProcessPurgeTool’s status
command with the Job Id: 9dafcc2ec096170874648f3ff4a6d0e5
For more details, see the server logs.

7) To determine the status, run a command such as this (you need to enter the right Job ID):
ProcessPurge status “http://localhost:8080″ administrator password 9dafcc2ec096170874648f3ff4a6d0e5

./ProcessPurge.sh status “http://localhost:8080″ administrator password 9dafcc2ec096170874648f3ff4a6d0e5 in Unix.

If the purge completed, you should get a response such as this:
Status: JOB_STATUS_COMPLETED. Also your server log would have entries such as follows:

INFO [com.adobe.idp.workflow.dsc.service.ProcessManagerService] PMAN501: Process purge started by user “Super Administrator” with the following parameters: processName=Base_Long_Lived/Basic_Long_Lived, majorVersion=null, minorVersion=null, status=3, age=6134400, filter=null, includeChildren=true

INFO [com.adobe.idp.workflow.dsc.service.ProcessManagerService] PMAN502: Process purge has completed. Number of processes successfully purged: 25. Number of processes failed to be purged: 0

8) Verify by querying the LiveCycle database directly (MySQL example – replace “lc_schema” with the name you chose for the LiveCycle schema):
SELECT
id as PROCESS_ID,
service_name as ORCHESTRATION_NAME,
complete_time as COMPLETE_TIME
FROM `lc_schema`.`tb_process_instance`
ORDER BY complete_time

9) To reclaim the storage previously utilized by the deleted database records, the DBA of the database will have to perform additional steps, including updating the database statistics.

See here for additional information from the LiveCycle Online Help. The following query (from here) will report disk usage by MySQL:

SELECT
table_schema AS ‘Db Name’,
Round( Sum( data_length + index_length ) / 1024 / 1024, 3 ) AS ‘Db Size (MB)’,
Round( Sum( data_free ) / 1024 / 1024, 3 ) AS ‘Free Space (MB)’
FROM information_schema.tables
GROUP BY table_schema ;

Steps 2, 3 and 4 can be put in a batch file or shell script and can be scheduled to run daily. To use Windows’ Scheduler for this, please see this.

Please note that this functionality is different from the Job Manager Purge you can configure in the LiveCycle Admin UI (new feature in ES2 SP1).

This entry was posted in Adobe LiveCycle ES and tagged . Bookmark the permalink.

6 Responses to Clearing Old Business Process Instances from LiveCycle Process Management

  1. Hi JayanThanks for this useful information.I’d just like to add that Avoka have developed a tool that reduces the size of the LiveCycle database without actually removing process instances. It’s not quite as effective at reducing size, but it still achieves dramatic reduction without actually deleting process instance history, which some customers may need to retain.We usually find that a combination of both Avoka and Adobe purge tools is the most effective.You can find more information here:http://www.avoka.com/blog/?p=345and here:

  2. Manpal Singh says:

    Jayan,I am DBA supporting LC database. What are the additional steps that we need to take in order to reclaim the space that you mention in step 9? Do you have any scripts/ commands for that?

  3. Leo Berliant says:

    ProcessPurge.sh does not work when the parameters have spaces in them or the * character. You need to edit the ProcessPurge.sh and replace the $* with “$@”. ProcessPurge.sh is written in ksh, so it will invoke ksh no matter what your shell is.

  4. HDao says:

    Hello,

    I get the error: “Exception in thread “main” java.lang.NoClassDefFoundError: com/adobe/idp/jobmanager/common/JobManagerException” when I try to run the command at Step 6.

    Can any one please advise?

    Thanks, Han

  5. I can’t tell you how many hours I spent banging my head against the wall (not literally) trying to sort through this very issue. Finally I gave up and went out to find help. Thank you so much for posting this. Next time I’ll just come back here BEFORE I start working and save myself a few hours, haha. I tried the Avoka tool as well, not too bad, but definitely not the same as just clearing out.
    Carly S.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>