gpt4 book ai didi

history - 如何清理 Camunda 历史

转载 作者:行者123 更新时间:2023-12-05 02:59:47 34 4
gpt4 key购买 nike

我的应用程序使用 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);
}

以及下午的清理窗口:

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

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

最佳答案

在我的例子中,当使用 Spring Boot 运行时,它只是通过定义以下属性来工作:

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

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

附言我正在运行 7.11.0

关于history - 如何清理 Camunda 历史,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57511195/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com