This post provides a step-by-step example of deleting a class in Pega 7 with the Delete Class Wizard. This wizard can be used to remove a class and all the rules it contains from a Pega 7 instance.
- Description of Sample Class to be Deleted
- Deleting a Class with the Delete a Class Wizard
- How to Delete a RuleSet in Pega 7
- How to Delete Case Type Instances in Pega 7 with an Activity
- Example of Connecting to Pega 7.1.6 PRPC PostgreSQL DB with pgAdmin
1 Description of Sample Class to be Deleted
- In this example, a Case Type Rule named
PGX-MyStore-Work-Claimexists in the application.
- The screen shot below shows that case type rule and its containing rules in the Application Explorer.
- Note that the
Claimclass contains several rules such as Data Transforms, Properties, Flows and Sections.
- The Class of the
Claimcase type can be opened by right-clicking on its name in the Application Explorer and selecting Definition.
Claimis configured using belongs to a class group, with the class group set to
PGX-MyStore-Work. Therefore, instances of
Claimare stored in the Pega DB table for
- Clicking on the Test Connection button opens a dialog that shows the mapping of the
PGX-MyStore-Work-Claimclass to a Pega DB table named
- A tool such as pgAdmin can be used to browse the
- See this post for how to use pgAdmin to access Pega DB tables.
- Here, the following SQL statement was used:
SELECT pxcreatedatetime, pzinskey, pxinsname, pxobjclass FROM pegadata.pc_pgx_mystore_work;
- The screen shot below shows that the table contains
- The first row represents the default work pool class, ending in
- The other
3rows are instances of the
Claimclass that were created when running the application.
2 Deleting a Class with the Delete a Class Wizard
- 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.
- 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.
- On the Class Refactor Utilities form, click on 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-Claimand click on Next.
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.
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.
- 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.
- Click on Finish to complete the process and the on Done to close the wizard.
- 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.
- The Pega DB table
pegadata.pc_PGX_MyStore_Worknow contains only
1row, which represents the default work pool class. The
3instances of the
Claimclass have been removed.