Beispiel #1
0
        protected internal virtual UpdateExternalTaskRetriesBuilder updateRetries(SetRetriesForExternalTasksDto retriesDto)
        {
            ExternalTaskService externalTaskService = ProcessEngine.ExternalTaskService;

            IList <string> externalTaskIds    = retriesDto.ExternalTaskIds;
            IList <string> processInstanceIds = retriesDto.ProcessInstanceIds;

            ExternalTaskQuery            externalTaskQuery            = null;
            ProcessInstanceQuery         processInstanceQuery         = null;
            HistoricProcessInstanceQuery historicProcessInstanceQuery = null;

            ExternalTaskQueryDto externalTaskQueryDto = retriesDto.ExternalTaskQuery;

            if (externalTaskQueryDto != null)
            {
                externalTaskQuery = externalTaskQueryDto.toQuery(ProcessEngine);
            }

            ProcessInstanceQueryDto processInstanceQueryDto = retriesDto.ProcessInstanceQuery;

            if (processInstanceQueryDto != null)
            {
                processInstanceQuery = processInstanceQueryDto.toQuery(ProcessEngine);
            }

            HistoricProcessInstanceQueryDto historicProcessInstanceQueryDto = retriesDto.HistoricProcessInstanceQuery;

            if (historicProcessInstanceQueryDto != null)
            {
                historicProcessInstanceQuery = historicProcessInstanceQueryDto.toQuery(ProcessEngine);
            }

            return(externalTaskService.updateRetries().externalTaskIds(externalTaskIds).processInstanceIds(processInstanceIds).externalTaskQuery(externalTaskQuery).processInstanceQuery(processInstanceQuery).historicProcessInstanceQuery(historicProcessInstanceQuery));
        }
Beispiel #2
0
        public virtual IList <ExternalTaskDto> queryExternalTasks(ExternalTaskQueryDto queryDto, int?firstResult, int?maxResults)
        {
            ProcessEngine engine = ProcessEngine;

            queryDto.ObjectMapper = ObjectMapper;
            ExternalTaskQuery query = queryDto.toQuery(engine);

            IList <ExternalTask> matchingTasks;

            if (firstResult != null || maxResults != null)
            {
                matchingTasks = executePaginatedQuery(query, firstResult, maxResults);
            }
            else
            {
                matchingTasks = query.list();
            }

            IList <ExternalTaskDto> taskResults = new List <ExternalTaskDto>();

            foreach (ExternalTask task in matchingTasks)
            {
                ExternalTaskDto resultInstance = ExternalTaskDto.fromExternalTask(task);
                taskResults.Add(resultInstance);
            }
            return(taskResults);
        }
Beispiel #3
0
        public virtual CountResultDto queryExternalTasksCount(ExternalTaskQueryDto queryDto)
        {
            ProcessEngine engine = ProcessEngine;

            queryDto.ObjectMapper = ObjectMapper;
            ExternalTaskQuery query = queryDto.toQuery(engine);

            long           count  = query.count();
            CountResultDto result = new CountResultDto();

            result.Count = count;

            return(result);
        }