Interstage BPM Version: All Versions
Problem Description:
When number of triggers are huge in Interstage BPM database, performance of the trigger processing goes down.
Solution:
Please take the backup of the table before executing the below SQL.
We can use the below query directly to be executed on Interstage BPM database, which will change the state of the triggers to inactive whose PIs are either closed or aborted. The trigger state will remain as active for those PDs which have PIs in running, suspended and error state.
UPDATE TRIGGERDEFINITION SET STATE = 2 WHERE PROCESSDEFINITIONID IN
(SELECT DISTINCT PI.PROCESSDEFINITIONID
FROM PROCESSDEFINITION PD, PROCESSINSTANCE PI
WHERE PD.PROCESSDEFINITIONID = PI.PROCESSDEFINITIONID AND
PI.STATE IN (8, 11) AND PI.PROCESSDEFINITIONID
NOT IN
(SELECT PI.PROCESSDEFINITIONID FROM PROCESSINSTANCE PI WHERE PI.STATE IN (7,10,12)));
Author: Pranay Kumar
Attachment: