History cleanup job never runs

Hi!

We want to test the history cleanup job, but it never runs.

Here is a snippet from our bpmn file:
<bpmn:process id=“Process_1” isExecutable=“true” camunda:historyTimeToLive=“1”>
bpmn:extensionElements
camunda:properties
<camunda:property name=“historyCleanupStrategy” value=“endTimeBased” />
<camunda:property name=“historyCleanupBatchWindowStartTime” value=“00:01” />
<camunda:property name=“historyCleanupBatchWindowEndTime” value=“23:59” />
</camunda:properties>

I checked the database (ACT_HI_PROCINST_) :

proc_def_key_, start_time_, end_time_, removal_time_, state_

‘Process_1’, ‘2019-03-05 13:08:37’, ‘2019-03-05 13:09:26’, ‘2019-03-06 13:09:26’, ‘COMPLETED’

(current date: 2019.03.06 13:23)

Our project is spring boot based with embedded process engine, and the application.properties configuration file is the following(relevant part):

historyCleanup.enabled=true
historyCleanup.cronTrigger=* * * * *
historyCleanup.ttl=P1D
historyCleanup.processDataCleanupMode=all

ACT_RU_JOB and ACT_HI_JOB_LOG tables are empty.

Have I done something wrong? By the way, is there any way to enable camunda trace logging?

Thanks!

best regards,
Akos

Hi Akos,

You didn’t configure the History cleanup correctly, that’s why it didn’t run.

Wrong:
The following configuration should not be in the bpmn xml file:

and this also doesn’t look correct:

Where did you find that the configuration should look like that?

Correct:
In case of spring boot application, you can configure the History cleanup in application properties like this:

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

In the bpmn xml file you need to specify only the history time to live:
<bpmn:process id=“Process_1” isExecutable=“true” camunda:historyTimeToLive=“1”>

2 Likes

Hi Yana,

Thanks for your reply. It works now (the job is running), but, as you wrote, the following configuration is not correct:
historyCleanup.enabled=true
historyCleanup.cronTrigger=* * * * *
historyCleanup.ttl=P1D
historyCleanup.processDataCleanupMode=all

can you send me the correct way to configure the crontrigger and the ttl, cleanup mode, etc?
I could just set the properties.

I tried this way (with the correct indentation of course):
camunda:
bpm:
historyCleanup:
enabled:
cronTrigger: * * * * *
ttl:P1D
processDataCleanupMode:all

thank you,
Akos

Hi Akos,

History cleanup doesn’t offer cron trigger.
Once you setup the history cleanup batch window, the history cleanup will be scheduled for the next open batch window.
All history cleanup configuration properties are documented here: https://docs.camunda.org/manual/7.10/reference/deployment-descriptors/tags/process-engine/#history-cleanup-configuration-parameters

Complete history cleanup documentation: https://docs.camunda.org/manual/7.10/user-guide/process-engine/history/#history-cleanup

Best regards,
Yana