public virtual void testCompleteProcessWithParallelGatewayAndSingleUserTask() { //given an already started process instance ProcessInstance oldInstance = rule.processInstance(); Assert.assertNotNull(oldInstance); //with one completed user task HistoricTaskInstanceQuery historicTaskQuery = rule.HistoryService.createHistoricTaskInstanceQuery().processInstanceId(oldInstance.Id).finished(); Assert.assertEquals(1, historicTaskQuery.count()); //and one waiting Task task = rule.taskQuery().singleResult(); Assert.assertNotNull(task); //when completing the user task rule.TaskService.complete(task.Id); //then there exists no more tasks Assert.assertEquals(0, rule.taskQuery().count()); //and two historic tasks Assert.assertEquals(2, historicTaskQuery.count()); //and the process instance is also completed rule.assertScenarioEnded(); }
public virtual void testQueryByTenantId() { HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery().tenantIdIn(TENANT_ONE); assertThat(query.count(), @is(1L)); query = historyService.createHistoricTaskInstanceQuery().tenantIdIn(TENANT_TWO); assertThat(query.count(), @is(1L)); }
public virtual void testQueryNoAuthenticatedTenants() { identityService.setAuthentication("user", null, null); HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery(); assertThat(query.count(), @is(0L)); }
public virtual void testQueryDisabledTenantCheck() { processEngineConfiguration.TenantCheckEnabled = false; identityService.setAuthentication("user", null, null); HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery(); assertThat(query.count(), @is(2L)); }
public virtual void testQueryAuthenticatedTenants() { identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO)); HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery(); assertThat(query.count(), @is(2L)); assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(1L)); assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(1L)); }
public virtual void testQueryHistoricProcessWithParallelGateway() { //given an already finished process instance with parallel gateway and two user tasks HistoricProcessInstance historicProcessInstance = rule.historicProcessInstance(); //when query history HistoricTaskInstanceQuery historicTaskQuery = rule.HistoryService.createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstance.Id); //then two historic user tasks are returned Assert.assertEquals(2, historicTaskQuery.count()); }
public virtual CountResultDto queryHistoricTaskInstancesCount(HistoricTaskInstanceQueryDto queryDto) { queryDto.ObjectMapper = objectMapper; HistoricTaskInstanceQuery query = queryDto.toQuery(processEngine); long count = query.count(); CountResultDto result = new CountResultDto(); result.Count = count; return(result); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void deleteHistoricTaskInstanceWithAuthenticatedTenant() public virtual void deleteHistoricTaskInstanceWithAuthenticatedTenant() { string taskId = createTaskForTenant(TENANT_ONE); identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE)); historyService.deleteHistoricTaskInstance(taskId); identityService.clearAuthentication(); HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery(); assertThat(query.count(), @is(0L)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void deleteHistoricTaskInstanceWithDisabledTenantCheck() public virtual void deleteHistoricTaskInstanceWithDisabledTenantCheck() { string taskIdOne = createTaskForTenant(TENANT_ONE); string taskIdTwo = createTaskForTenant(TENANT_TWO); identityService.setAuthentication("user", null, null); processEngineConfiguration.TenantCheckEnabled = false; historyService.deleteHistoricTaskInstance(taskIdOne); historyService.deleteHistoricTaskInstance(taskIdTwo); HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery(); assertThat(query.count(), @is(0L)); }
public virtual void testQueryHistoricProcessWithParallelGateway() { //given an already started process instance ProcessInstance oldInstance = rule.processInstance(); Assert.assertNotNull(oldInstance); //with one completed user task HistoricTaskInstanceQuery historicTaskQuery = rule.HistoryService.createHistoricTaskInstanceQuery().processInstanceId(oldInstance.Id).finished(); Assert.assertEquals(1, historicTaskQuery.count()); //and one async service task Job job = rule.jobQuery().singleResult(); Assert.assertNotNull(job); //when job is executed rule.ManagementService.executeJob(job.Id); //then there exists no more tasks //and the process instance is also completed Assert.assertEquals(0, rule.taskQuery().count()); rule.assertScenarioEnded(); }
public virtual void testQueryByNonExistingTenantId() { HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery().tenantIdIn("nonExisting"); assertThat(query.count(), @is(0L)); }
public virtual void testQueryWithoutTenantId() { HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery(); assertThat(query.count(), @is(2L)); }