如何清理卡蒙达历史

Tes*_*est 5 history camunda

我的应用程序运行于Camunda 7.7. 到目前为止,所有数据都保存在 Camunda 表 (ACT_XXX) 中 - 它们变得很大。所以现在我想清理表并配置 Camunda,以便数据在 14 天后清理。

到目前为止,我尝试将 TTL 设置为 1 天(更容易测试!)

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

for (ProcessDefinition processDefinition : processDefinitions) {
  processEngine.getRepositoryService()
    .updateProcessDefinitionHistoryTimeToLive(
      processDefinition.getId(), 1);
}
Run Code Online (Sandbox Code Playgroud)

以及下午的清理窗口:

configuration.setHistoryCleanupBatchWindowStartTime("15:00");
configuration.setHistoryCleanupBatchWindowEndTime("16:00");
Run Code Online (Sandbox Code Playgroud)

这,这不行。有人可以帮忙吗?

Ale*_*isi 5

就我而言,当使用 Spring Boot 运行时,它只需定义以下属性即可工作:

camunda:
  bpm:
    generic-properties:
      properties:
        historyCleanupBatchWindowStartTime: "00:01"
        historyCleanupBatchWindowEndTime: "23:59"
        historyCleanupStrategy: endTimeBased
Run Code Online (Sandbox Code Playgroud)

可以肯定的是,您可以检查需要删除的对象的 REMOVAL_TIME 列吗?如果您在流程定义上设置 ttl,它应该由引擎自动填充。

PS我正在运行7.11.0