Posted: 2 Jun 2015 3:46 EDT Last activity: 17 Jul 2017 16:36 EDT
Cleaning case instances
Hi to PegaMesh community,
I want to delete ALL instance cases using an activity.
My idea is using the method Obj-Delete to delete all of this activities.But I'm not sure how It works. And If exists other way to clean this instances
Thank you very much.
***Updated by moderator: Marissa to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Please find below tables that are usually referred to delete the application work object instances.
delete from pc_data_uniqueid update pc_data_uniqueid set pylastreservedid=0 //To reset the work object ID numbering sequence delete from <Application Work pool associated database table name> delete from pc_work delete from pc_assign_worklist delete from pc_assign_workbasket delete from pc_history_work delete from pc_data_workattach delete from pc_index_workparty delete from pc_link_attachment delete from pc_link_folder Commit
We could either use the following methods to perform work object clean up task
RDB-Save and RDB-Delete
disadvantage - database specific connect-SQL rules have to be created individually.
advantage - faster in deleting the work objects. If not delete command truncate can also be used.
Have to retrieve all the instances using OOTB activity 'pxRetrieveReportData' on all the appropriate classes mapped to the above mentioned tables ...
loop the method 'Obj-Delete' with Remove & Immediate options checked on the pxResults.
disadvantage - could be slow when compared to RBD- approach.
advantage - database platform independent
note: we should reset pylastreservedid value to ensure the work object sequence.
Please share your thoughts/observations, Thank you! psahukaru
Without knowing what your report returns, it's hard to say. Definitely you need to have the object you are trying to delete loaded into your step page. If your report is pulling back a list of pzInsKeys or something, you may need to do an Obj-Open-By-Handle inside your loop to open the object you want to delete. If you want to code defensively, you may also want to put a stepstatusfail or similar transition after the delete. That will allow you to break out of the loop if there are any errors and to capture/address them.