Delete a Class fails with "pyWorkClass is not a database column"
Hello, I'm using Pega 7.1.9 and have run into a problem while trying to delete a class from a specific Application using DesignerStudio > System > Refactor > Classes > Delete a Class. I've used this wizard to delete several classes from two other apps, but when I try it with a third app it skips straight to the "Done" page when I enter the class and click next two times. By looking at DesignerStudio > Application > Tools > All Wizards, I see that the wizard is stuck in an open state. When opening the wizard it states that there's a flow problem and gives the following error:
Work Object pxW-XX has encountered flow problems in DeleteClass.
The flow DeleteClass of type DeleteClass has encountered a problem on step UITILITY53.
com.pega.pegarules.pub.PRRuntimeError: Property 'pyWorkClass' is not a Database Column.
I used the tracer when i clicked "Next" in Delete a Class and noticed that the FAIL's first show up when getting to step 17 of the pzAddWorkDataHandles. This step looks for a History- class of the app you want to delete. In the database I can see that History- tables exists for the two other apps that let me Delete Classes successfully, but no History- table exists for this third app that won't let me delete. In addition, pyWorkClass is a column name in those two classes where Delete a Class worked.
I'm not sure where to go from here to fix this, or what caused it. Is there a reason why no History- table exists for the app that's not working? Do I need to create one somehow? Any advice would be appreciated.
***Updated by Moderator: Marissa. Removed user added #helpme group tag. Apologies for confusion, shouldn't have been an end-user option; updated categories***
It would be helpful to know more about the class. Along with abstract/concrete, is it a Work class, a Data class, or some other? Taking a quick look at pzAddWorkDataHandles, it certainly seems to assume that you have a history class for the class you are deleting. If you don't, the question becomes should you? And if you do, you might want to take a look at its Data-Admin-DB-Table to see if it's being stored in someplace unexpected.
>>> In the database I can see that History- tables exists for the two other apps that let me Delete Classes successfully, but no History- table exists for this third app that won't let me delete
It may be that this particular wizard as currently coded requires the History- table. You could test that theory by making two test classes, identical except that one has a history table, and see if you get the exact same error when trying to delete the test class that has no history table.
If you do determine that in fact there is a dependency on the History table, try making one for the test class. If it makes the issue go away, you can make one for your original class to solve the issue.
However, you should definitely back up your db first, so in case something goes badly wrong, you can restore. /Eric
Oh, one detail I thought of after I wrote the above. When you look at the code that your trace identified that references the history class, and you do the above experiment, see whether it merely requires the existence of the history class, or whether it is parsing or otherwise using specific records from that history class. If it's using specific records from the history class, the challenge will be a bit greater. /Eric
Follow up: When running the Delete-A-Class wizard, everything within the class was deleted except for the class itself. I ended up just deleting the class rule myself (after manually deleting some dependent classes first). I did try to resume the failed Wizard, but had no success. It actually got stuck in an open state and remains there to this day. For reference, this was a Concrete Work Class.
Thanks to all who provided answers, they helped me decide how to proceed. Apologies for the late response, I had to switch tasks and was only able to return to the deletion problem recently.