コード例 #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));
        }
コード例 #2
0
        public virtual IList <ProcessInstanceDto> queryProcessInstances(ProcessInstanceQueryDto queryDto, int?firstResult, int?maxResults)
        {
            ProcessEngine engine = ProcessEngine;

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

            IList <ProcessInstance> matchingInstances;

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

            IList <ProcessInstanceDto> instanceResults = new List <ProcessInstanceDto>();

            foreach (ProcessInstance instance in matchingInstances)
            {
                ProcessInstanceDto resultInstance = ProcessInstanceDto.fromProcessInstance(instance);
                instanceResults.Add(resultInstance);
            }
            return(instanceResults);
        }
コード例 #3
0
        private ModificationBuilder createModificationBuilder(ModificationDto dto)
        {
            ModificationBuilder builder = ProcessEngine.RuntimeService.createModification(dto.ProcessDefinitionId);

            if (dto.Instructions != null && dto.Instructions.Count > 0)
            {
                dto.applyTo(builder, ProcessEngine, objectMapper);
            }

            IList <string> processInstanceIds = dto.ProcessInstanceIds;

            builder.processInstanceIds(processInstanceIds);

            ProcessInstanceQueryDto processInstanceQueryDto = dto.ProcessInstanceQuery;

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

            if (dto.SkipCustomListeners)
            {
                builder.skipCustomListeners();
            }

            if (dto.SkipIoMappings)
            {
                builder.skipIoMappings();
            }

            return(builder);
        }
コード例 #4
0
        protected internal virtual MigrationPlanExecutionBuilder createMigrationPlanExecutionBuilder(MigrationExecutionDto migrationExecution)
        {
            MigrationPlan  migrationPlan      = createMigrationPlan(migrationExecution.MigrationPlan);
            IList <string> processInstanceIds = migrationExecution.ProcessInstanceIds;

            MigrationPlanExecutionBuilder executionBuilder = processEngine.RuntimeService.newMigration(migrationPlan).processInstanceIds(processInstanceIds);

            ProcessInstanceQueryDto processInstanceQueryDto = migrationExecution.ProcessInstanceQuery;

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

            if (migrationExecution.SkipCustomListeners)
            {
                executionBuilder.skipCustomListeners();
            }

            if (migrationExecution.SkipIoMappings)
            {
                executionBuilder.skipIoMappings();
            }

            return(executionBuilder);
        }
コード例 #5
0
        public virtual CountResultDto queryProcessInstancesCount(ProcessInstanceQueryDto queryDto)
        {
            ProcessEngine engine = ProcessEngine;

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

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

            result.Count = count;

            return(result);
        }
コード例 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void executeModificationWithInvalidProcessInstanceQueryAsync()
        public virtual void executeModificationWithInvalidProcessInstanceQueryAsync()
        {
            when(runtimeServiceMock.createProcessInstanceQuery()).thenReturn(new ProcessInstanceQueryImpl());
            IDictionary <string, object> json = new Dictionary <string, object>();

            IList <IDictionary <string, object> > instructions = new List <IDictionary <string, object> >();

            instructions.Add(ModificationInstructionBuilder.startAfter().activityId("acivityId").Json);

            ProcessInstanceQueryDto processInstanceQueryDto = new ProcessInstanceQueryDto();

            processInstanceQueryDto.BusinessKey = "foo";
            json["processInstanceQuery"]        = processInstanceQueryDto;
            json["instructions"]        = instructions;
            json["processDefinitionId"] = "processDefinitionId";

            given().contentType(ContentType.JSON).body(json).then().expect().statusCode(Status.OK.StatusCode).when().post(EXECUTE_MODIFICATION_ASYNC_URL);
        }
コード例 #7
0
        public virtual CountResultDto getProcessInstancesCount(UriInfo uriInfo)
        {
            ProcessInstanceQueryDto queryDto = new ProcessInstanceQueryDto(ObjectMapper, uriInfo.QueryParameters);

            return(queryProcessInstancesCount(queryDto));
        }
コード例 #8
0
        public virtual IList <ProcessInstanceDto> getProcessInstances(UriInfo uriInfo, int?firstResult, int?maxResults)
        {
            ProcessInstanceQueryDto queryDto = new ProcessInstanceQueryDto(ObjectMapper, uriInfo.QueryParameters);

            return(queryProcessInstances(queryDto, firstResult, maxResults));
        }
コード例 #9
0
 public virtual MigrationExecutionDtoBuilder processInstanceQuery(ProcessInstanceQueryDto processInstanceQuery)
 {
     migrationExecution[PROP_PROCESS_INSTANCE_QUERY] = processInstanceQuery;
     return(this);
 }