How to Delete a Class and All of its Rules in Pega 7

Classes in Pega 7 can be deleted using the Delete Class Wizard. This wizard can be used to remove a class and all the rules it contains from a Pega 7 instance.

Summary

  1. Description of Sample Class to be Deleted
  2. Deleting a Class with the Delete a Class Wizard

Related Posts

Screen shot - Pega 7 Designer Studio - Application Explorer, View Claim Class

  • The Class of the Claim case type can be opened by right-clicking on its name in the Application Explorer and selecting Definition.

Screen shot - Pega 7 Designer Studio - Application Explorer, View Claim Class Definition

  • Claim is configured using belongs to a class group, with the class group set to PGX-MyStore-Work. Therefore, instances of Claim are stored in the Pega DB table for PGX-MyStore-Work.
  • Clicking on the Test Connection button opens a dialog that shows the mapping of the PGX-MyStore-Work-Claim class to a Pega DB table named pegadata.pc_PGX_MyStore_Work.

Screen shot - Pega 7 Designer Studio - Edit Class, Test Connection and View Table Mapping

SELECT 
    pxcreatedatetime, pzinskey, pxinsname, pxobjclass
FROM 
    pegadata.pc_pgx_mystore_work;
  • The screen shot below shows that the table contains 4 rows.

Screen shot - pgAdmin - Browse pegadata.pc_pgx_mystore_work table

  • The first row represents the default work pool class, ending in -Work.
  • The other 3 rows are instances of the Claim class that were created when running the application.

  • A class can be deleted manually in the Designer Studio using the Delete button on the Edit Class form. This operation will result in an error if: a) the class contains instances or b) if the class contains any other rules.

Screen shot - Pega 7 Designer Studio - Edit Class, Delete with ERROR containing Instances

  • A class can only be deleted this way if all instances and containing rules have been removed first.
  • This can be a tedious manual process. Therefore, Pega 7 provides the Delete Class Wizard. It will automatically delete all instances and containing rules when deleting a class.
  • To open the wizard, use the Designer Studio main menu and navigate to System > Refactor > Classes.

Screen shot - Pega 7 Designer Studio Menu - System, Refactor, Classes

  • On the Class Refactor Utilities form, click on Delete a Class.

Screen shot - Pega 7 Designer Studio - Refactor Class Utilities, Selection Option, Delete a Class

Step 1: Select Class to Delete

  • Enter the name of the class that will be deleted, here the name is PGX-MyStore-Work-Claim and click on Next.

Screen shot - Pega 7 Designer Studio - Refactor Class Utilities, Delete a Class, Step 1: Select a Class to Delete

Step 2: Display Classes to Delete

  • A warning message will be shown and all classes to be deleted are listed. Review and click on Next to trigger the deletion of the class.

Screen shot - Pega 7 Designer Studio - Refactor Class Utilities, Delete a Class, Step 2: Show Warning Message

Step 3: Reference Search

  • If needed, this step of the wizard allows to search for and list all references to the class that was deleted.
  • Select the option, here Search for references in all RuleSets, and click on Next.

Screen shot - Pega 7 Designer Studio - Refactor Class Utilities, Delete a Class, Step 3: Reference Search

  • If the wizard found any references in the specified RuleSets, they will be listed on the next screen. In this example, no references to the deleted class exist.
  • If references were found, the list of references could be exported to Excel or PDF using the buttons.

Screen shot - Pega 7 Designer Studio - Refactor Class Utilities, Delete a Class, Step 3: Reference Search View Results

  • Click on Finish to complete the process and the on Done to close the wizard.

Screen shot - Pega 7 Designer Studio - Refactor Class Utilities, Delete a Class, Rule Management Process is now Complete

  • The class has now been deleted from the Pega instance and the Application Explorer and Designer Studio search controls can be used to confirm this.

Screen shot - Pega 7 Designer Studio - Application Explorer, Search for class, Class does not exist

  • The Pega DB table pegadata.pc_PGX_MyStore_Work now contains only 1 row, which represents the default work pool class. The 3 instances of the Claim class have been removed.

Screen shot - pgAdmin, browse table for Claim class after class deletion

Leave a Reply