flowable / flowable/flowable-engine
Deletion of historic processes is not flexible
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 7h 8m
- Merged PRs (30d)
- 2
Description
Hi,
We have [an application](https://github.com/cloudfoundry-incubator/multiapps-controller) based on Flowable's BPMN engine, which triggers a lot of processes per day (> 1000) and each of these processes contains hundreds of service tasks and thousands of variables. As you can imagine, this leads to a ton of historic data accumulating very very fast in our database. I'm not going to go into details here, but we need to keep the historic tables' size in check, since we perform queries on their data on a regular basis and huge amounts of data naturally lead to slow response times.
We implemented a [clean-up job](https://github.com/cloudfoundry-incubator/multiapps-controller/blob/master/com.sap.cloud.lm.sl.cf.process/src/main/java/com/sap/cloud/lm/sl/cf/process/jobs/ActivitiHistoricDataCleaner.java) to solve this problem and it works, but the implementation is *very* inefficient, because we can only delete historic process instances one by one (by using HistoryService's `deleteHistoricProcessInstance` [method](https://github.com/flowable/flowable-engine/blob/1ccb67e77dbae20f2f7ebb75230bb3c87b15dc30/modules/flowable-engine/src/main/java/org/flowable/engine/HistoryService.java). We would like some way of creating complex delete queries like we currently can with selects:
```
historyService.createHistoricProcessInstanceQuery()
.finished()
.startedBefore(expirationTime)
.list();
```
For example:
```
historyService.createHistoricProcessInstanceDeleteQuery()
.finished()
.startedBefore(expirationTime)
.delete()
```
We're open to implementing this feature ourselves, if you think it makes sense and are willing to review our pull request. :)
PS: If you take a look at our code and notice the Activiti packages there - ignore them. We're in the process of migrating to Flowable.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.