use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class MultiTenancyCaseInstanceQueryTest method testQueryByInstancesWithoutTenantId.
public void testQueryByInstancesWithoutTenantId() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery().withoutTenantId();
assertThat(query.count(), is(1L));
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class AutoCompleteTest method testEntryCriteriaAndManualActivationDisabled.
@Deployment
public void testEntryCriteriaAndManualActivationDisabled() {
// given
String caseInstanceId = createCaseInstanceByKey(CASE_DEFINITION_KEY).getId();
CaseExecutionQuery executionQuery = caseService.createCaseExecutionQuery();
String humanTask1Id = executionQuery.activityId("PI_HumanTask_1").singleResult().getId();
// when (1)
complete(humanTask1Id);
// then (1)
CaseInstanceQuery instanceQuery = caseService.createCaseInstanceQuery().caseInstanceId(caseInstanceId);
CaseInstance caseInstance = instanceQuery.singleResult();
assertNotNull(caseInstance);
assertTrue(caseInstance.isActive());
String humanTask2Id = executionQuery.activityId("PI_HumanTask_2").singleResult().getId();
// when (2)
complete(humanTask2Id);
// then (2)
caseInstance = instanceQuery.singleResult();
assertNotNull(caseInstance);
assertTrue(caseInstance.isCompleted());
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseServiceTest method testCreateCaseInstanceQuery.
public void testCreateCaseInstanceQuery() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
assertNotNull(query);
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByInvalidSubProcessInstanceId.
public void testQueryByInvalidSubProcessInstanceId() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery().subProcessInstanceId("invalid");
verifyQueryResults(query, 0);
try {
query.subProcessInstanceId(null);
fail();
} catch (NotValidException e) {
// expected
}
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByByteArrayVariableValueGreaterThan.
public void testQueryByByteArrayVariableValueGreaterThan() {
byte[] bytes = "somebytes".getBytes();
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aByteArrayValue", bytes).create();
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
try {
query.variableValueGreaterThan("aByteArrayValue", bytes).list();
fail();
} catch (ProcessEngineException e) {
}
}
Aggregations