示例#1
0
        public virtual IList <ExecutionDto> queryExecutions(ExecutionQueryDto queryDto, int?firstResult, int?maxResults)
        {
            ProcessEngine engine = ProcessEngine;

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

            IList <Execution> matchingExecutions;

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

            IList <ExecutionDto> executionResults = new List <ExecutionDto>();

            foreach (Execution execution in matchingExecutions)
            {
                ExecutionDto resultExecution = ExecutionDto.fromExecution(execution);
                executionResults.Add(resultExecution);
            }
            return(executionResults);
        }
示例#2
0
        public static MessageCorrelationResultWithVariableDto fromMessageCorrelationResultWithVariables(MessageCorrelationResultWithVariables result)
        {
            MessageCorrelationResultWithVariableDto dto = new MessageCorrelationResultWithVariableDto();

            if (result != null)
            {
                dto.ResultType = result.ResultType;
                if (result.ProcessInstance != null)
                {
                    dto.ProcessInstance = ProcessInstanceDto.fromProcessInstance(result.ProcessInstance);
                }
                else if (result.Execution != null)
                {
                    dto.Execution = ExecutionDto.fromExecution(result.Execution);
                }

                dto.variables = VariableValueDto.fromMap(result.Variables, true);
            }
            return(dto);
        }