In this quick tutorial we learn about How to Archive & Purge Old Work Items Pega 8

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.

  • You cannot use the wizard to archive only. Archiving always occurs with purging, which removes the rows from the tables.

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

Phase 1: Configure the activity
  1. Define the dataset that will be purged/archived.
  2. The dataset comprises a work pool in your application, and a set of work types (classes), folders, and covers within the work pool.
  3. The dataset is also qualified by the age of resolved work items to be purged/archived.
  4. Each configuration is an instance in class Data-Admin-ArchiveSettings.
Phase 2: Schedule the activity
  1. Start date and the frequency of each purge/archive cycle.
  2. Number of items you want to purge and/or archive. If this value is less than the number of items in the age group defined in Step 1, the oldest items are purged. The others remain in the source tables until the next cycle.
  3. A time limit for processing items within each purge/archive cycle. If the time limit is exceeded, the process stops and restarts after a defined number of hours has elapsed. These settings help spread out processing demands during a single cycle.

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.

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

<workpoolname_dataset name_ file creation date_run n >

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.

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.

Granting wizard access

By default, only operators who hold the PegaRULES:SysAdm4 role can use the 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.

Access the wizard by clicking Configure > System > Operations > Purge/Archive and selecting Configuration.

Step 1: Selecting a work pool

Select a work pool that contains the work items you want to purge/archive.

Enter a name that identifies a new configuration within the work pool. OR Use the drop-down list to select an existing configuration name so that you can modify the work types and/or the work item age.

pega work pool archiving and purging work items pega 8
Step 2: Selecting work types

Use this form to select the work types, covers, and folders that you want to include in the data set.

selcing pega work type archiving and purging pega 8
Step 3: Choosing filter criteria

Use this form to select the age of the resolved work items you want to include in the purge cycle.

Enter a numeric value to indicate the number of days since the resolution date. For example, if you enter a value of 1, the agent purges/archives work items that are resolved for 1 days or longer as of the date of the cycle.

pega 8 filter criteria purging and archiving old work items
Step 4: Confirming the work types

Review the list of work types that will be purged/archived and the age of the work items that will be included in the purge cycle.

Click Finish to finalize the agent configuration. This creates an instance in Data-Admin-ArchiveSettings.

finalize archiving and purging agent configuration in pega 8
Step 5: Scheduling archival process

Click Schedule Archival Process to open the Select Archive Settings form and create a schedule for the configuration.

Click Close to exit the wizard.

scheduing archival process in pega 8 to purge and archive old work items
Step 6: Selecting archive settings

To create or modify a schedule, select Select Archive Settings in the Take Action box.

  • Archive and Purge – Deletes the work items and related data and populates .zip archive files.
  • Purge – Deletes the work items and related data; .zip archive files are not created.
select archive setting pega 8 purging archiving old work items
Step 7: Confirming and starting the schedule

To start the schedule, select Show Summary in the Take Action list and click Submit.

show summary in pega 8 archiving and purging old work items

To remove the schedule, select Remove in the Take Action list and click Submit.

Select the Remove interval information check box to delete the process statistics for the purge/archive schedule.

remove archiving and purging in pega 8 old work items

Once we create and configure the archival process, an instance gets created for the class with pyStatusWork – Pending (which means archival configuration is scheduled)

PegaAccel-Management-Archival,  table pegadata.pc_work_accel

PegaAccel-Management-Archival,  pega 8 old work items

Based on the scheduled process time, an assignment (Assign-Archive) instance gets queued as a System-Queue-ServiceLevel entry and this gets picked by SLA Agent

Assign archive instance Pega

SLA agent is responsible for performing the actual purging of work items and creating archive files using ProcessConfig activity.

Process config agent activity

Zip file will be created under temp directory ArchivedWork folder

archived work zip file pega
archived work pega

Debug and Verify in Logs

Change the logger setting Rule_Obj_Activity.ProcessConfig.PegaAccel_Management_Archival.Action to debug

debug pega 8 archive and purge
pega log archive and purging old work items in pega 8

Hope you learned about How to Archive & Purge Old Work Items Pega 8. Happy Learning.. 🙂

Leave a Reply

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