Search in sources :

Example 1 with HistoryCleanupConfigurationDto

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;
}
Also used : HistoryCleanupConfigurationDto(org.camunda.bpm.engine.rest.dto.history.HistoryCleanupConfigurationDto) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1 HistoryCleanupConfigurationDto (org.camunda.bpm.engine.rest.dto.history.HistoryCleanupConfigurationDto)1