HistoryCleaningTimeCycleConfig parameters

Although I see several examples of using the HistoryCleaningTimeCycleConfig, I’ve not found the description of each parameter. For example, processEngineConfiguration.setHistoryCleaningTimeCycleConfig(“0 0 1 * * ?”). I think the “1” indicates to run the job at 1 am. But where do I find the description of the rest of the values?

Hi @wendy

There are three properties you can set for the history clean up:

// enabling / disabling the history clean up
flowable.enable-history-cleaning=true

// when should a history instance be deleted (e.g.ended 365 days prior)
flowable.history-cleaning-after-days=365

// When should the history clean up job run (cron expression) (e.g. every night at 1am)
flowable.history-cleaning-cycle=0 0 1 * * ?

see also History · Flowable Open Source Documentation

Regards,
Simon

Ah, thanks Simon. I hadn’t recognized that format as Cron. Makes sense!

Based on Cron examples I’m seeing, I’m a little confused. Would “0 0 1 * * ?” be the first day of the month rather than every night at 1 am?

The third parameter stays for the hours.

0 0 0 1 * ? would be the first day of every month.

see also Cron Expressions

thanks again Simon. I appreciate your help!