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
- 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
- Start date and the frequency of each purge/archive cycle.
- 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.
- 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 >
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.
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.
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.
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.
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.
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.
Step 7: Confirming and starting the schedule
To start the schedule, select Show Summary in the Take Action list and click Submit.
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.
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
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
SLA agent is responsible for performing the actual purging of work items and creating archive files using ProcessConfig activity.
Zip file will be created under temp directory ArchivedWork folder
Debug and Verify in Logs
Change the logger setting Rule_Obj_Activity.ProcessConfig.PegaAccel_Management_Archival.Action to debug
Hope you learned about How to Archive & Purge Old Work Items Pega 8. Happy Learning.. 🙂