Joget DX Available for Download

Check out Joget DX, the next generation successor to Joget Workflow for faster, simpler digital transformation.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

In development server, due to the fact that process design will always get updated and deloped, there will be more and more XPDLs are cached in the memory. In long run, this will be causing "java.lang.OutOfMemoryError" exception during runtime or server startup. To solve this issue, we will need to clean up the unused XPDLs with following steps. The following example queries are written in MySQL syntax.

 

Note

1. Please shutdown your application server.

2. Please do a full database backup before proceeding to the following steps.

 

1. Check existing count of XPDLs

On a common production server, normally there are only few app versions and each version only tied to 1 process version. This is because we won't do any development in production server, so the process version is only increased during the app imported. But in the development server, it will be a different case. The process version will be going up few hundred process version which also means there are few hundred of XPDL data are cached in memory. To check how many XPDLs are cached, please run the following query in your database server.

MySQL
 select count(*) from SHKXPDLS

2. Check the count of unused XPDLs

In all the cached process version XPDLs, there is case that some process version is not used by any process instances. These unused XPDLs can be safely deleted. The check the number of unused XPDLs, we can use the following query. Then, we can know how many are unused out of the total number of XPDLs.

MySQL
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
);

If you would like to list the process versions, you can use the following query.

MySQL
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
);

3. Delete completed process instances data to clean up more XPDLs from cache

If the process instances data are not important to you or you have your process instance data captured a copy by the Process Data Collector plugin, you can delete your process instances data to increase the number of unsed XPDLs. In this case, only the process version for running process instances and the latest process version for each app version will be kept.

MySQL
SET foreign_key_checks = 0;
delete sp, spr, spd, sac, sad, sa
from SHKProcesses sp
join SHKProcessRequesters spr on spr.Id = sp.ID
left join SHKProcessData spd on spd.Process = sp.oid
left join SHKActivities sac on sac.ProcessId = sp.ID
left join SHKActivityData sad on sad.Activity = sac.oid
left join SHKAssignmentsTable sa on sa.ActivityProcessId = sp.ID
where (sp.State = 1000006 or sp.State = 1000008 or sp.State = 1000010);
SET foreign_key_checks = 1;

4. Delete the unused XDPLs

Now, you can delete the unused XPDLs and it will be free from your memory cache when next server startup.

MySQL
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;

 

 

 

 

 

  • No labels