public virtual void testQueryByTenantId() { CaseExecutionQuery query = caseService.createCaseExecutionQuery().tenantIdIn(TENANT_ONE); assertThat(query.count(), @is(2L)); query = caseService.createCaseExecutionQuery().tenantIdIn(TENANT_TWO); assertThat(query.count(), @is(2L)); }
public virtual void testQueryNoAuthenticatedTenants() { identityService.setAuthentication("user", null, null); CaseExecutionQuery query = caseService.createCaseExecutionQuery(); assertThat(query.count(), @is(2L)); }
public virtual void testQueryDisabledTenantCheck() { processEngineConfiguration.TenantCheckEnabled = false; identityService.setAuthentication("user", null, null); CaseExecutionQuery query = caseService.createCaseExecutionQuery(); assertThat(query.count(), @is(6L)); }
private CaseExecutionQuery setUpMockCaseExecutionQuery(IList <CaseExecution> mockedCaseExecutions) { CaseExecutionQuery query = mock(typeof(CaseExecutionQuery)); when(processEngine.CaseService.createCaseExecutionQuery()).thenReturn(query); when(query.list()).thenReturn(mockedCaseExecutions); when(query.count()).thenReturn((long)mockedCaseExecutions.Count); return(query); }
public virtual void testQueryAuthenticatedTenants() { identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE, TENANT_TWO)); CaseExecutionQuery query = caseService.createCaseExecutionQuery(); assertThat(query.count(), @is(6L)); assertThat(query.tenantIdIn(TENANT_ONE).count(), @is(2L)); assertThat(query.tenantIdIn(TENANT_TWO).count(), @is(2L)); assertThat(query.withoutTenantId().count(), @is(2L)); }
public virtual CountResultDto queryCaseExecutionsCount(CaseExecutionQueryDto queryDto) { ProcessEngine engine = ProcessEngine; queryDto.ObjectMapper = ObjectMapper; CaseExecutionQuery query = queryDto.toQuery(engine); long count = query.count(); CountResultDto result = new CountResultDto(); result.Count = count; return(result); }
public virtual void testSequenceAutoStartStage() { // given string caseInstanceId = createCaseInstance().Id; CaseExecution firstHumanTask = queryCaseExecutionByActivityId("PI_HumanTask_1"); string firstHumanTaskId = firstHumanTask.Id; assertTrue(firstHumanTask.Active); CaseExecution stage = queryCaseExecutionByActivityId("PI_Stage_1"); string stageId = stage.Id; assertTrue(stage.Available); // (1) then stage = queryCaseExecutionById(stageId); assertTrue(stage.Available); assertNull(caseService.getVariable(caseInstanceId, "enable")); assertNull(caseService.getVariable(caseInstanceId, "start")); // (2) when complete(firstHumanTaskId); // (2) then stage = queryCaseExecutionById(stageId); assertTrue(stage.Active); assertNull(caseService.getVariable(caseInstanceId, "enable")); object startVariable = caseService.getVariable(caseInstanceId, "start"); assertNotNull(startVariable); assertTrue((bool?)startVariable); CaseExecutionQuery query = caseService.createCaseExecutionQuery().enabled(); assertEquals(2, query.count()); foreach (CaseExecution child in query.list()) { assertEquals(stageId, child.ParentId); } }
public virtual void testQueryByNonExistingTenantId() { CaseExecutionQuery query = caseService.createCaseExecutionQuery().tenantIdIn("nonExisting"); assertThat(query.count(), @is(0L)); }
public virtual void testQueryByExecutionsWithoutTenantId() { CaseExecutionQuery query = caseService.createCaseExecutionQuery().withoutTenantId(); assertThat(query.count(), @is(2L)); }
public virtual void testQueryNoTenantIdSet() { CaseExecutionQuery query = caseService.createCaseExecutionQuery(); assertThat(query.count(), @is(6L)); }