use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByIntegerVariableValueLessThanOrEquals.
public void testQueryByIntegerVariableValueLessThanOrEquals() {
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("anIntegerValue", 456).create();
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.variableValueLessThanOrEqual("anIntegerValue", 457);
verifyQueryResults(query, 1);
query = caseService.createCaseInstanceQuery();
query.variableValueLessThanOrEqual("anIntegerValue", 456);
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryBySubProcessInstanceId.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/cmmn/oneProcessTaskCase.cmmn", "org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" })
public void testQueryBySubProcessInstanceId() {
String superCaseInstanceId = caseService.createCaseInstanceByKey("oneProcessTaskCase").getId();
String subProcessInstanceId = runtimeService.createProcessInstanceQuery().superCaseInstanceId(superCaseInstanceId).singleResult().getId();
CaseInstanceQuery query = caseService.createCaseInstanceQuery().subProcessInstanceId(subProcessInstanceId);
verifyQueryResults(query, 1);
CaseInstance caseInstance = query.singleResult();
assertEquals(superCaseInstanceId, caseInstance.getId());
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByByteArrayVariableValueLessThanOrEqual.
public void testQueryByByteArrayVariableValueLessThanOrEqual() {
byte[] bytes = "somebytes".getBytes();
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aByteArrayValue", bytes).create();
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
try {
query.variableValueLessThanOrEqual("aByteArrayValue", bytes).list();
fail();
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByStringVariableValueLike.
public void testQueryByStringVariableValueLike() {
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aStringValue", "abc").create();
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.variableValueLike("aStringValue", "ab%");
verifyQueryResults(query, 1);
query = caseService.createCaseInstanceQuery();
query.variableValueLike("aStringValue", "%bc");
verifyQueryResults(query, 1);
query = caseService.createCaseInstanceQuery();
query.variableValueLike("aStringValue", "%b%");
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByInvalidCaseDefinitionId.
public void testQueryByInvalidCaseDefinitionId() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.caseDefinitionId("invalid");
verifyQueryResults(query, 0);
try {
query.caseDefinitionId(null);
fail();
} catch (NotValidException e) {
}
}
Aggregations