Question/Problem Description
How to remove the data that belongs to a Process Template from SBM tables?Environment
Product: Savvion Version: 6.x.x,7.x.x,8.x.x, 10.0.x OS: ANY Application Server: ANY Database: ANY Browser: ANYResolution
Run the below mentioned queries to delete the data for a particular ProcessTemplate :delete FROM BIZLOGIC_AVAILABLEWORKITEM where WORKITEM_ID in (select WORKITEM_ID from BIZLOGIC_WORKITEM WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_VOTE where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_WORKITEM_PERFORMER where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_EXCLUDE_PERFORMER where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_WORKSTEP_MESSAGES where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_PITEMPLATE where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_PIXML where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_PI_LOCK where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_AVAILABLE_CWORKITEM where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_CSTEP_DS where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_SUBPROCESSINSTANCE where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_DEBUG_WORKSTEP where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete FROM BIZLOGIC_DEBUG_PI where process_instance_id in (select process_instance_id from BIZLOGIC_PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>);
delete from PROCESSRESOURCEINFO where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_DOCDS_FOLDER where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_WORKSTEPINSTANCE where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_WORKITEM where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_CWORKITEM where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_WAITWORKSTEP where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_PROCESSTEMPLATE where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_CSTEP where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_PROCESS_NOTES where PROCESS_TEMPLATE_ID=<PTID>;
delete from PROCESSXML where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_TIMERACTION where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_PT_REPLACE_INFO where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_PROCESSINSTANCE where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_DS_<PTID> where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZLOGIC_GLOBALDS_<PTID> where PROCESS_TEMPLATE_ID=<PTID>;
delete from BIZEVENT WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from PROCESSTEMPLATE WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from PROCESSINSTANCE WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from WORKITEM WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from WORKSTEP WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from PROCESSDATAINFO WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from PROCESSWORKSTEPINFO WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from WORKSTEPVOTEINFO WHER.E PROCESS_TEMPLATE_ID=<PTID>;
delete from CWORKITEM WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from CSTEP WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from CSTEP_DS WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from PROCESS_NOTES WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from WI_RESOURCE_USAGE WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from PROCESS_STATUS WHERE PROCESS_TEMPLATE_ID=<PTID>;
delete from BS_<PTID> where PROCESS_TEMPLATE_ID=<PTID>;
In addition to these queries, there is a table with the same name as that of the installed application(ProcessTemplate name), that needs to be dropped as well.
In 10.x version, one view and an object gets created for the process template with name <ProcessTemplateName> _VIEW and <ProcessTemplateName> _WSV .
These two need to be dropped as well.