Purge Workflows batch process

Code

PurgeWorkflows

Categories

UIRunnable, Schedulable

Implementation

Batch process

Stoppable

No (single phase process)

Schedule

On the first day of the month, at 1:30 a.m., on the 10th of the month, at 1:00 a.m.

Class

PurgeWorkflows.gs

The Purge Workflows batch process deletes any completed workflow older than the specified number of days. The purge process deletes the following items:
  • All completed workflows older than the specified date
  • Any log messages associated with the deleted workflows
  • The workflow that performs the purging itself
Note: Deletion of the workflow is permanent.

This process uses Gosu class PurgeWorkflow to read the value of configuration parameter WorkflowPurgeDaysOld in config.xml. The process then uses this value to determine the number of days to retain workflow data before purging it.

Rationale for running this batch process

Each time PolicyCenter creates an activity, it adds the activity to the following database tables:
  • pc_Workflow
  • pc_WorkflowLog
  • pc_WorkflowWorkItem

After a user completes the activity, PolicyCenter sets the workflow status to completed. Thereafter, PolicyCenter never uses the table entries for the activity ever again. These tables grow in size over time and can adversely affect performance as well as waste disk space. Excessive records in these tables also negatively impact the performance of the database upgrade.

Use the Purge Workflows batch process to purge older, completed, workflows and their logs. Purging workflows, workflow log entries, and workflow items for completed activities does the following:
  • It recovers disk space.
  • It improves database upgrade.
  • It improves operational performance.
  • It reduces the number of unused workflow log records.

Guidewire recommends that you purge the completed workflows and their logs periodically.

Alternatively, you can purge only the logs associated with completed workflows by running the Purge Workflow Logs batch process. The Purge Workflow Logs batch process ignores the workflow records and removes only the workflow log records.

See also