官方配置:
Camunda Platform 7 documentation | docs.camunda.org
camunda.bpm:
history-level: audit
generic-properties:
properties:
historyCleanupStrategy: endTimeBased
historyCleanupEnabled: true
historyTimeToLive: P60D
batchOperationHistoryTimeToLive: P60D
historyCleanupBatchSize: 500
historyCleanupBatchWindowStartTime: "20:59"
historyCleanupBatchWindowEndTime: "21:20"
现象:断点有进 HistoryCleanupCmd,但是数据库里的数据未减少。
开启日志后,找到核心SQL:
SELECT pi.PROC_INST_ID_, pi.END_TIME_
FROM ACT_HI_PROCINST pi, ACT_RE_PROCDEF pd
where pi.PROC_DEF_ID_ = pd.ID_ AND not pi.END_TIME_ is NULL
AND not pd.HISTORY_TTL_ is NULL
AND DATEDIFF(?, pi.END_TIME_)>= pd.HISTORY_TTL_
LIMIT ?
设置ACT_RE_PROCDEF 表HISTORY_TTL_ 值后,生效