4

My application runs with Camunda 7.7. Until now, all the data was saved in the Camunda tables (ACT_XXX)- they become big. So now I want to clean up the tables and configure Camunda such, that the data is clean up after 14 days.

Until now I tries to set the TTL to 1 day (easier to test!)

List<ProcessDefinition> processDefinitions = processEngine.getRepositoryService()
   .createProcessDefinitionQuery()
   .deploymentId(deployment.getId()).list();

for (ProcessDefinition processDefinition : processDefinitions) {
  processEngine.getRepositoryService()
    .updateProcessDefinitionHistoryTimeToLive(
      processDefinition.getId(), 1);
}

and the clean up window during the afternoon:

configuration.setHistoryCleanupBatchWindowStartTime("15:00");
configuration.setHistoryCleanupBatchWindowEndTime("16:00");

This, this does not work. Can someone help?

Anatoly
  • 20,799
  • 3
  • 28
  • 42
Test
  • 41
  • 1
  • 2

1 Answers1

4

In my case, when running with Spring Boot, it just works by defining the following properties:

camunda:
  bpm:
    generic-properties:
      properties:
        historyCleanupBatchWindowStartTime: "00:01"
        historyCleanupBatchWindowEndTime: "23:59"
        historyCleanupStrategy: endTimeBased

To be sure, can you check colum REMOVAL_TIME on objects you need to delete? It should be populated automatically by the engine if you set ttl on process definition.

P.s. I'm running 7.11.0

Alessandro Dionisi
  • 2,494
  • 4
  • 33
  • 37