Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Note
1. Please shutdown your application server.
2. Please do a full database backup before proceeding to the following steps.select count(*) from SHKXPDLS
select count(*) from SHKXPDLS x where concat(x.XPDLId, x.XPDLVersion) not in ( select concat(packageId,packageVersion) as id from ( select def.PackageId as packageId, def.ProcessDefinitionVersion as packageVersion from SHKActivities act join SHKProcesses pro on act.Process = pro.oid left join SHKProcessDefinitions def on pro.ProcessDefinition = def.oid group by def.PackageId, def.ProcessDefinitionVersion union select packageId, packageVersion from app_package ) as used_processes group by packageId, packageVersion );
select count(*) from SHKXPDLS x where concat(x.XPDLId, x.XPDLVersion) not in ( select concat(packageId,packageVersion) as id from ( select def.PackageId as packageId, TO_CHAR(def.ProcessDefinitionVersion) as packageVersion from SHKActivities act join SHKProcesses pro on act.Process = pro.oid left join SHKProcessDefinitions def on pro.ProcessDefinition = def.oid group by def.PackageId, def.ProcessDefinitionVersion union select packageId, TO_CHAR(packageVersion) from app_package ) group by packageId, packageVersion );
If you would like to list the process versions, you can use the following query.
select * from SHKXPDLS x where concat(x.XPDLId, x.XPDLVersion) not in ( select concat(packageId,packageVersion) as id from ( select def.PackageId as packageId, def.ProcessDefinitionVersion as packageVersion from SHKActivities act join SHKProcesses pro on act.Process = pro.oid left join SHKProcessDefinitions def on pro.ProcessDefinition = def.oid group by def.PackageId, def.ProcessDefinitionVersion union select packageId, packageVersion from app_package ) as used_processes group by packageId, packageVersion );
select * from SHKXPDLS x where concat(x.XPDLId, x.XPDLVersion) not in ( select concat(packageId,packageVersion) as id from ( select def.PackageId as packageId, TO_CHAR(def.ProcessDefinitionVersion) as packageVersion from SHKActivities act join SHKProcesses pro on act.Process = pro.oid left join SHKProcessDefinitions def on pro.ProcessDefinition = def.oid group by def.PackageId, def.ProcessDefinitionVersion union select packageId, TO_CHAR(packageVersion) from app_package ) group by packageId, packageVersion );
SET FOREIGN_KEY_CHECKS=0; delete sa from SHKAssignmentsTable as sa left join SHKProcesses as sp on sa.ActivityProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete saj from SHKAndJoinTable as saj left join SHKActivities as sac on saj.Activity = sac.oid left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete sd from SHKDeadlines as sd left join SHKActivities as sac on sd.Activity = sac.oid left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete sad from SHKActivityData as sad left join SHKActivities as sac on sad.Activity = sac.oid left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete sac from SHKActivities as sac left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete spd from SHKProcessData as spd left join SHKProcesses as sp on spd.Process = sp.oid where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete spr from SHKProcessRequesters as spr left join SHKProcesses as sp on spr.Id = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete from SHKProcesses where (State = 1000006 or State = 1000008 or State = 1000010); SET FOREIGN_KEY_CHECKS=1;
EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all" delete sa from SHKAssignmentsTable as sa left join SHKProcesses as sp on sa.ActivityProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete saj from SHKAndJoinTable as saj left join SHKActivities as sac on saj.Activity = sac.oid left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete sd from SHKDeadlines as sd left join SHKActivities as sac on sd.Activity = sac.oid left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete sad from SHKActivityData as sad left join SHKActivities as sac on sad.Activity = sac.oid left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete sac from SHKActivities as sac left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete spd from SHKProcessData as spd left join SHKProcesses as sp on spd.Process = sp.oid where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete spr from SHKProcessRequesters as spr left join SHKProcesses as sp on spr.Id = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete from SHKProcesses where (State = 1000006 or State = 1000008 or State = 1000010); EXEC sp_MSforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"
delete (select sa.* from SHKAssignmentsTable sa left join SHKProcesses sp on sa.ActivityProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010)); delete saj from SHKAndJoinTable as saj left join SHKActivities as sac on saj.Activity = sac.oid left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete sd from SHKDeadlines as sd left join SHKActivities as sac on sd.Activity = sac.oid left join SHKProcesses as sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010); delete (select sad.* from SHKActivityData sad left join SHKActivities sac on sad.Activity = sac.oid left join SHKProcesses sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010)); delete (select sac.* from SHKActivities sac left join SHKProcesses sp on sac.ProcessId = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010)); delete (select spd.* from SHKProcessData spd left join SHKProcesses sp on spd.Process = sp.oid where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010)); delete (select spr.* from SHKProcessRequesters spr left join SHKProcesses sp on spr.Id = sp.ID where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010)); delete from SHKProcesses where (State = 1000006 or State = 1000008 or State = 1000010);
To limit the process within a time period for started and completed time, change all the where clause to following and modify the date.
where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010) and (FROM_UNIXTIME((sp.Started-sp.StartedTZO)/1000) >= '2020-05-03 00:00:00.000' and FROM_UNIXTIME((sp.Started-sp.StartedTZO)/1000) <= '2020-05-06 23:59:59.999') and (FROM_UNIXTIME((sp.LastStateTime-sp.LastStateTimeTZO)/1000) >= '2020-05-03 00:00:00.000' and FROM_UNIXTIME((sp.LastStateTime-sp.LastStateTimeTZO)/1000) <= '2020-05-06 23:59:59.999')
where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010) and (DATEADD(s, ((sp.Started-sp.StartedTZO)/1000), '1970-01-01 00:00:00') >= '2020-05-03 00:00:00' and DATEADD(s, ((sp.Started-sp.StartedTZO)/1000), '1970-01-01 00:00:00') <= '2020-05-06 23:59:59') and (DATEADD(s, ((sp.LastStateTime-sp.LastStateTimeTZO)/1000), '1970-01-01 00:00:00') >= '2020-05-03 00:00:00' and DATEADD(s, ((sp.LastStateTime-sp.LastStateTimeTZO)/1000), '1970-01-01 00:00:00') <= '2020-05-06 23:59:59')
where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010) and (FROM_UNIXTIME((sp.Started-sp.StartedTZO)/1000) >= '2020-05-03 00:00:00' and FROM_UNIXTIME((sp.Started-sp.StartedTZO)/1000) <= '2020-05-06 23:59:59') and (FROM_UNIXTIME((sp.LastStateTime-sp.LastStateTimeTZO)/1000) >= '2020-05-03 00:00:00' and FROM_UNIXTIME((sp.LastStateTime-sp.LastStateTimeTZO)/1000) <= '2020-05-06 23:59:59')
If you would like to clean the all the process instances data including the running process instances, you can use the following query.
WARNING This deletes all your process records. Perform a backup before running the query below and is not recommended to be executed on a production server!
SET FOREIGN_KEY_CHECKS=0; delete from SHKAssignmentsTable; delete from SHKAndJoinTable; delete from SHKDeadlines; delete from SHKActivityData; delete from SHKActivities; delete from SHKProcessData; delete from SHKProcessRequesters; delete from SHKProcesses; SET FOREIGN_KEY_CHECKS=1;
EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all" delete from SHKAssignmentsTable; delete from SHKAndJoinTable; delete from SHKDeadlines; delete from SHKActivityData; delete from SHKActivities; delete from SHKProcessData; delete from SHKProcessRequesters; delete from SHKProcesses; EXEC sp_MSforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"
delete from SHKAssignmentsTable; delete from SHKAndJoinTable; delete from SHKDeadlines; delete from SHKActivityData; delete from SHKActivities; delete from SHKProcessData; delete from SHKProcessRequesters; delete from SHKProcesses;
SET FOREIGN_KEY_CHECKS=0; delete x, xd from SHKXPDLS x join SHKXPDLData xd on x.oid= xd.XPDL where concat(x.XPDLId, x.XPDLVersion) not in ( select concat(packageId,packageVersion) as id from ( select def.PackageId as packageId, def.ProcessDefinitionVersion as packageVersion from SHKActivities act join SHKProcesses pro on act.Process = pro.oid left join SHKProcessDefinitions def on pro.ProcessDefinition = def.oid group by def.PackageId, def.ProcessDefinitionVersion union select packageId, packageVersion from app_package ) as used_processes group by packageId, packageVersion ); SET FOREIGN_KEY_CHECKS=1;
EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all" delete xd from SHKXPDLData as xd left join SHKXPDLS as x on x.oid= xd.XPDL where concat(x.XPDLId, x.XPDLVersion) not in ( select concat(packageId,packageVersion) as id from ( select def.PackageId as packageId, def.ProcessDefinitionVersion as packageVersion from SHKActivities act join SHKProcesses pro on act.Process = pro.oid left join SHKProcessDefinitions def on pro.ProcessDefinition = def.oid group by def.PackageId, def.ProcessDefinitionVersion union select packageId, packageVersion from app_package ) as used_processes group by packageId, packageVersion ); delete x from SHKXPDLS as x where concat(x.XPDLId, x.XPDLVersion) not in ( select concat(packageId,packageVersion) as id from ( select def.PackageId as packageId, def.ProcessDefinitionVersion as packageVersion from SHKActivities act join SHKProcesses pro on act.Process = pro.oid left join SHKProcessDefinitions def on pro.ProcessDefinition = def.oid group by def.PackageId, def.ProcessDefinitionVersion union select packageId, packageVersion from app_package ) as used_processes group by packageId, packageVersion ); EXEC sp_MSforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"
delete (select xd.* from SHKXPDLData xd left join SHKXPDLS x on x.oid= xd.XPDL where concat(x.XPDLId, x.XPDLVersion) not in ( select concat(packageId,packageVersion) as id from ( select def.PackageId as packageId, TO_CHAR(def.ProcessDefinitionVersion) as packageVersion from SHKActivities act join SHKProcesses pro on act.Process = pro.oid left join SHKProcessDefinitions def on pro.ProcessDefinition = def.oid group by def.PackageId, def.ProcessDefinitionVersion union select packageId, TO_CHAR(packageVersion) from app_package ) group by packageId, packageVersion )); delete (select x.* from SHKXPDLS x where concat(x.XPDLId, x.XPDLVersion) not in ( select concat(packageId,packageVersion) as id from ( select def.PackageId as packageId, TO_CHAR(def.ProcessDefinitionVersion) as packageVersion from SHKActivities act join SHKProcesses pro on act.Process = pro.oid left join SHKProcessDefinitions def on pro.ProcessDefinition = def.oid group by def.PackageId, def.ProcessDefinitionVersion union select packageId, TO_CHAR(packageVersion) from app_package ) group by packageId, packageVersion ));