Configure history cleanup for Spring Boot

Hi there,

I try to configure automatic history clean up in a Spring Boot environment. Somewhere in the forum I found the advice to use these settings:

camunda.bpm:
  database:
    schema-update: false
    type: postgres
  generic-properties:
    properties:
      historyCleanupBatchWindowStartTime: "00:01"
      historyCleanupBatchWindowEndTime: "23:59"

However, the cleanup job is never scheduled. When I issue this query:

select count(*) from act_hi_procinst
where removal_time_ < now();

the result increases. What did I miss?

Thanks in advance,
Christian

You may have figured this out already but since the docs are a bit lite on configuring Camunda generic-properties I thought I would post this info. Below is an example of configuring history.

There are a few options for configuring History Cleanup. All the options rely on the process engine configuration of some sort.

See Option 3 to use generic-properties which is what I think will work for your case. Included the other options just in case.

1. You can utilize process.xml or camunda.cfg.xml as described here.

https://docs.camunda.org/manual/latest/user-guide/process-engine/process-engine-bootstrapping/#configure-process-engine-using-camunda-cfg-xml

See the following for the config properties that can be set for history cleanup and other engine configuration properties.

https://docs.camunda.org/manual/latest/reference/deployment-descriptors/tags/process-engine/#history-cleanup-configuration-parameters

2. or you can use code config as described here

https://docs.camunda.org/manual/latest/user-guide/spring-boot-integration/configuration/#adding-additional-configurations

In the case of spring-boot you can utilize Component Scanning and @Value annotations to quickly create your own properties and hook this into a yaml config via a process-engine-plugin.

3. use generic-properties

See https://docs.camunda.org/manual/latest/user-guide/spring-boot-integration/configuration/#generic-properties

Here are the available configs for the process-engine-configuration

https://docs.camunda.org/manual/latest/reference/deployment-descriptors/tags/process-engine/#configuration-properties

To use generic-properties just find the property in the configuration-properties doc above than add a hyphen “-” between words and remove camel case like historyCleanupStrategy becomes history-cleanup-strategy.

  camunda:
    bpm:
      generic-properties:
        properties:
          history-cleanup-strategy: removalTimeBased

Also here are the additional spring-boot properties that you can use in YAML.

https://docs.camunda.org/manual/7.8/user-guide/spring-boot-integration/configuration/#camunda-engine-properties

3 Likes