Delete history data after specified time

Hello Team,

My use case is to delete the historic data after persisting it for a week. And, I found below configuration for the same,
ProcessEngine processEngine = ProcessEngineConfiguration
.createProcessEngineConfigurationFromResourceDefault()
.setEnableHistoryCleaning(true)
.setHistoryCleaningTimeCycleConfig(“0 0 1 * * ?”)
.setCleanInstancesEndedAfterNumberOfDays(365)
.buildProcessEngine();

But I’m using SpringProcessEngineConfiguration instead of ProcessEngineConfiguration and hence I’m unable to use setEnableHistoryCleaning and setHistoryCleaningTimeCycleConfig mthods.

Kindly suggest something.

Regards,
Ashmita Sinha

The SpringProcessEngineConfiguration extends the ProcessEngineConfigurationImpl class. So it has the method, but you can’t chain the methods like above. If you call the setters separately, it’s possible, e.g.:

springProcessEngineConfiguration.setEnableHistoryCleaning(true)
springProcessEngineConfiguration.setHistoryCleaningTimeCycleConfig(“0 0 1 * * ?”)