use of org.camunda.bpm.engine.rest.dto.history.HistoryCleanupConfigurationDto in project camunda-bpm-platform by camunda.
the class HistoryCleanupRestServiceImpl method getHistoryCleanupConfiguration.
public HistoryCleanupConfigurationDto getHistoryCleanupConfiguration() {
HistoryCleanupConfigurationDto configurationDto = new HistoryCleanupConfigurationDto();
Date startTime = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getHistoryCleanupBatchWindowStartTimeAsDate();
Date endTime = ((ProcessEngineConfigurationImpl) processEngine.getProcessEngineConfiguration()).getHistoryCleanupBatchWindowEndTimeAsDate();
if (startTime == null || endTime == null) {
return configurationDto;
}
Date now = ClockUtil.getCurrentTime();
Date startDate = HistoryCleanupHelper.getCurrentOrNextBatchWindowStartTime(now, startTime, endTime);
Date endDate = HistoryCleanupHelper.getNextBatchWindowEndTime(now, endTime);
configurationDto.setBatchWindowStartTime(startDate);
configurationDto.setBatchWindowEndTime(endDate);
return configurationDto;
}
Aggregations