-
1. Re: Removing history information of completed process instances
michaelholtzman Oct 27, 2010 10:57 AM (in response to h.peter)We have a Purge by Date function, where we query JBPM_PROCESSINSTANCE for instances that have ended before a given retention date, and then delete the process instances returned by that query.
We also modified jBPM's logging to restrict the type of log records that get generated (JBPM_LOG is the biggest disk hog of the bunch). For example, turning off variable update logging reduces the log table size and activity by about 50 percent.
-
2. Re: Removing history information of completed process instances
mwohlf Oct 28, 2010 6:44 AM (in response to h.peter)in jbpm4 the DbSessionImpl has a deleteProcessDefinitionHistory() method, you can use that as base for whatever history information you want to delete:
List<HistoryProcessInstanceImpl> historyProcessInstances = session
.createCriteria(HistoryProcessInstanceImpl.class)
.add(Restrictions.eq("processDefinitionId", processDefinitionId)).add(... insert random other Restriction here ...)
.list();
// you also have to delete the activity since they have a foreign key relationship
for (HistoryProcessInstanceImpl hpi : historyProcessInstances) {
List<HistoryActivityInstanceImpl> historyActivityInstances = session
.createCriteria(HistoryActivityInstanceImpl.class)
.add(Restrictions.eq("historyProcessInstance", hpi))
.list();
for (HistoryActivityInstanceImpl hai : historyActivityInstances) {
session.delete(hai);
}
session.delete(hpi);
} -
3. Re: Removing history information of completed process instances
h.peter Jan 9, 2011 4:34 PM (in response to mwohlf)Hello Michael, thanks for your help.
I think there should be a public API method to do this so I've created a JIRA: http://issues.jboss.org/browse/JBPM-2990