Question
Accenture
ES
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.
Dani González
***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.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
does Report.pxResults contain the list of instances we would want to delete?
- to get reference to OOTB activity 'pxRetrieveReportData' the page Report would be helpful.
- now to get the results list, please define a new page Results (of class Code-Pega-List) and Results.pxResults (of class Telco-XXXXX)
Otherwise...
- can you please refer the activity with fully qualified name, for now?
- Call Rule-Obj-Report-Definition.pxRetrieveReportData with a defined 'pyPageName' parameter
- Observe the clipboard. The passed 'pyPageName' parameter page list should contain all the list of instances.
- then perform Obj-Delete on the passed 'pyPageName' parameter page list.
Pegasystems Inc.
IN
Hi Dani, Good Morning!
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.
- Obj-Delete
- 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.
Hi Dani, Good Morning!
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.
- Obj-Delete
- 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
Accenture
ES
Hi Psahukaru
Do you know how to access using a client (MySQLDeveloper,DBVisualizer ) to the Database?
Any specific port, connector? User and password?
If it couldn't be possible I would use the Obj-Delete approach.
Thank you for the information provided
Pegasystems Inc.
IN
Do you know how to access using a client (MySQLDeveloper,DBVisualizer ) to the Database?
Any specific port, connector? User and password?
-- Not sure, sorry!
Accenture
ES
Pegasystems Inc.
IN
could you please double check the user page Report.pxResults containing the expected data?
Accenture
ES
Accepted Solution
Pegasystems Inc.
IN
does Report.pxResults contain the list of instances we would want to delete?
- to get reference to OOTB activity 'pxRetrieveReportData' the page Report would be helpful.
- now to get the results list, please define a new page Results (of class Code-Pega-List) and Results.pxResults (of class Telco-XXXXX)
Otherwise...
- can you please refer the activity with fully qualified name, for now?
- Call Rule-Obj-Report-Definition.pxRetrieveReportData with a defined 'pyPageName' parameter
- Observe the clipboard. The passed 'pyPageName' parameter page list should contain all the list of instances.
- then perform Obj-Delete on the passed 'pyPageName' parameter page list.
-
Niti Solanki
Pegasystems Inc.
US
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.
BNY Mellon
US
See also the function pega_procom_archivepurge.purgeItems() as discussed here: Purging just one case
Pegasystems
US
>>> Definitely you need to have the object you are trying to delete loaded into your step page
This may not be necessary if you use the obj-delete-by-handle activity method. /Eric