Exemple #1
0
        public virtual BatchDto setRemovalTimeAsync(SetRemovalTimeToHistoricBatchesDto dto)
        {
            HistoryService historyService = processEngine.HistoryService;

            HistoricBatchQuery historicBatchQuery = null;

            if (dto.HistoricBatchQuery != null)
            {
                historicBatchQuery = dto.HistoricBatchQuery.toQuery(processEngine);
            }

            SetRemovalTimeSelectModeForHistoricBatchesBuilder builder = historyService.setRemovalTimeToHistoricBatches();

            if (dto.CalculatedRemovalTime)
            {
                builder.calculatedRemovalTime();
            }

            DateTime removalTime = dto.AbsoluteRemovalTime;

            if (dto.AbsoluteRemovalTime != null)
            {
                builder.absoluteRemovalTime(removalTime);
            }

            if (dto.ClearedRemovalTime)
            {
                builder.clearedRemovalTime();
            }

            builder.byIds(dto.HistoricBatchIds);
            builder.byQuery(historicBatchQuery);

            Batch batch = builder.executeAsync();

            return(BatchDto.fromBatch(batch));
        }