I tried two ways to do that:
- adding
flowable.enable-history-cleaning=true
flowable.history-cleaning-after-days= 1
flowable.history-cleaning-cycle=0 0 11 ? * MON,TUE,WED,THU,FRI *
to my .properties
file and restarted my flowable application. I have about a dozen of process instances that ended more than 24 hours ago. My expectation was that by 11:05 all these finished process instances will be deleted, but I can still see them in my flowable-admin app.
- next I tried modifying my
@SpringBootApplication
class. Here’s how it looks now:
@SpringBootApplication
public class FlowableEventRegistryApplication {
private final RepositoryService repositoryService;
private final EventRepositoryService eventRepositoryService;public FlowableEventRegistryApplication(RepositoryService repositoryService, EventRepositoryService eventRepositoryService) { this.repositoryService = repositoryService; this.eventRepositoryService = eventRepositoryService; } @Autowired ProcessEngineConfigurationImpl processEngineConfiguration; public static void main(String[] args) { SpringApplication.run(FlowableEventRegistryApplication.class, args); } @PostConstruct public void init() { processEngineConfiguration.setEnableHistoryCleaning(true); processEngineConfiguration.setHistoryCleaningTimeCycleConfig("0 30 11 ? * MON,TUE,WED,THU,FRI *"); processEngineConfiguration.setCleanInstancesEndedAfterNumberOfDays(1); } @EventListener(ApplicationStartedEvent.class) public void started() {}
}
Restarting the application and checking process instances after 11:30 showed that >24hours old instances are still there.
Am I missing something here ? Why don’t they get deleted ?