You are here: Reference > Tools, accelerators, and wizards > Purge/Archive wizards

Purge/Archive wizards

In a production application, work item data volume can grow to a size where hundreds of megabytes of database storage is required. The Purge/Archive wizards enable you to use an agent to automatically delete old work item data from the respective tables or store them in archive files. Purging and archiving old work items and their related history and attachment records helps maintain system performance by reducing database processing demands.

Scope

Archiving work item data enables you to retrieve them if needed for audits or for backups. Note the following:

Overview

You use the Purge/Archive wizard to set up the agent activity in two phases:

Phase 1: Configure the activity — Define the dataset that will be purged/archived. The dataset comprises a work pool in your application, and a set of work types (classes), folders, and covers within the work pool. The dataset is also qualified by the age of resolved work items to be purged/archived. Each configuration is an instance in class Data-Admin-ArchiveSettings.

Phase 2: Schedule the activity — For each cycle you specify:

At the defined cycle start time, the purge/archive agent first populates an archive .zip file with the work items and their data as defined in Step 1. The agent then deletes the table data. Although the work items are purge/archived, the work item ID is left unchanged, to allow restoration or archived wok items without affecting current work items.

About the .zip file

The .zip files created by the wizard uses the following naming convention:

<workpool name_dataset name_ file creation date_runn >

for example:

MyCo-Classgroup_AlphaPurge_20070409T22440_0.zip

Note: A run value of 0 (zero) designates the first run.

The .zip files are stored in the Pega Platform system temporary directory configured for your installation.

Prerequisites

Before you use the Purge/Archive Wizard, do the following:

Indexes created for work items are deleted but not archived. The indexes are recreated when the work items are recovered from the archive. For example, work party indexes (table pc_index_workparty) are purged but not archived. When the work item is recovered, the work party index is recreated.

Using the wizards

Two wizards comprise the Purge/Archive wizard:

Configuration - select this tab when you are:

Schedule process - select this tab when you are:

Restoring archived work items

To retrieve archived work items in your archive system, select Designer Studio> Application > Distribution > Import and select or upload the zip file containing the archived work objects. See About the .zip file for more details.

Testing the Purge/Archive wizard

Before using the wizard in a full-scale production system, it is strongly recommended that you test the wizard as follows:

  1. Schedule a near-term purge/archive cycle using a test set of resolved work items. Confirm that they and their related data are deleted from your application pc_work table and from the tables listed above in the preceding Prerequisites section. You can use Find by ID to verify that the items are not available.
  2. Use the Scheduling wizard and enter the agent information (work pool and name) you used for the test. This opens the user form. In the Interval Statistics section, open the entry for the date of the run. Verify that the number of work items and work-related records purged/archived are correct. Verify that the .zip file has been created.
  3. Purge a cover work item that contains resolved work items. Verify that all the work items inside the cover were successfully deleted.
  4. Purge a folder work item that contains a cover. Verify that the cover was deleted.
  5. Purge a folder that contains a cover that, in turn, contains resolved and unresolved work items. Confirm that none of them are purged.
  6. Create a folder with a work item inside the folder. Check for an entry in the table pc_link_folder. Purge the folder and then verify that the entry in the link table is deleted.
  7. Upload and import the .zip file into your archive system. Verify that all the data is recovered.

Granting wizard access

By default, only operators who hold the PegaRULES:SysAdm4 role can use these wizard.

To make this available to others.

  1. Identify an access role associated with the operators who are to hold the privilege.
  2. Open the Rule-Access-Role-Obj rule for the role you want to grant access, using @baseclass as the second key part.
  3. On the Privileges tab, add the PurgeArchiveConfigure privilege to the list with the appropriate access level. Save the form.