Set Default HistoryTimeToLive For Decisions via Config

Hello everybody,
like many of you realized (maybe much earlier :slight_smile: ) historyTimeToLive is defaulted with null and ignored. So we already configured our processes with config param camunda.historyTimeToLive and of course configured the historyService itself and all is fine. Well. For process instances.
Only now did I realize: we heaped up millions of decision instances, that should better be cleaned up. And this seems to be a problem. What did I try?

  • camunda.decisions.historyTimeToLive (or a param like this) does not exist
    using placeholder ${camunda.historyTimeToLive} in the param field of a decision doesn’t work, because placeholders are not numeric.
  • putting that into a variable HashMap named envparam and using placeholder #envparam.get(“camunda.historyTimeToLive” … ist still not numeric, so doesn’t work
  • Trying to update a just-deployed decision with a historyTimeToLive … for the moment I cancelled that, because it seems way to complicated for me. From what I read, EventListener to PostDeployEvent would be a possible solution
    Anyways, my questions out to you
  • did I just miss something about the property placeholder solution?
  • anybody had the same problem and a suggestion to solve it? :slight_smile:
  • Question to Camunda Gurus: The config is already quite impressive what it offers for params but could it be a solution, to just add a config param like you did for cleanUp batchOperations and even CleanUp itself?
    Some technical detail: we are running several Camunda processes on Camunda 7.16 using a shared database (we spread a very complex process on 3 engines), all processes are deployment-aware, the 3 engines are SpringBootApplications running on OpenShift. HistoryTimeToLive should better be env

Hi @mkoerner,

one short term solution is to set the removal date of the (all) historic decisions with a batch operation: Batch operation | docs.camunda.org

And there is a Rest API to update the history time to live of a decision definition: Update history time to live | docs.camunda.org

Open Cockpit and nagivate to the decision. In the parameters on the left side you can select the History Time To Live and change the value here.

Hope this helps, Ingo

Hi @Ingo_Richtsmeier the rest-commands don’t work at the moment, might have something to do with our setup on a defined servlet.context-path. We are checking our config and workaround solutions for that part.
But since historyTimeToLive on dmns cannot be configured via spring placeholder (at least I could not make it working) this would not be a one-time-tipdy-up-the-old-stuff but a regular action on every environment after deployments. This is a bit unsactisfactory.