Michael Wohlfart [
http://community.jboss.org/people/mwohlf] created the discussion
"Re: Removing history information of completed process instances"
To view the discussion, visit:
http://community.jboss.org/message/568808#568808
--------------------------------------------------------------
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);
}
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/568808#568808]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]