use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByStringVariableValueNotEquals.
public void testQueryByStringVariableValueNotEquals() {
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aStringValue", "abc").create();
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.variableValueNotEquals("aStringValue", "abd");
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByCompleted.
public void testQueryByCompleted() {
for (org.camunda.bpm.engine.repository.Deployment deployment : repositoryService.createDeploymentQuery().list()) {
repositoryService.deleteDeployment(deployment.getId(), true);
}
repositoryService.createDeployment().addClasspathResource("org/camunda/bpm/engine/test/api/cmmn/oneTaskCaseWithManualActivation.cmmn").deploy();
for (int i = 0; i < 4; i++) {
String id = caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).businessKey(String.valueOf(i)).create().getId();
caseInstanceIds.add(id);
}
List<CaseExecution> executions = caseService.createCaseExecutionQuery().activityId("PI_HumanTask_1").list();
for (CaseExecution caseExecution : executions) {
caseService.withCaseExecution(caseExecution.getId()).disable();
}
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.completed();
verifyQueryResults(query, 4);
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByDateVariableValueNotEquals.
public void testQueryByDateVariableValueNotEquals() {
Date now = new Date();
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aDateValue", now).create();
Date before = new Date(now.getTime() - 100000);
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.variableValueNotEquals("aDateValue", before);
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByInvalidCaseInstanceId.
public void testQueryByInvalidCaseInstanceId() {
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
query.caseInstanceId("invalid");
verifyQueryResults(query, 0);
try {
query.caseInstanceId(null);
fail();
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.
the class CaseInstanceQueryTest method testQueryByByteArrayVariableValueLessThan.
public void testQueryByByteArrayVariableValueLessThan() {
byte[] bytes = "somebytes".getBytes();
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aByteArrayValue", bytes).create();
CaseInstanceQuery query = caseService.createCaseInstanceQuery();
try {
query.variableValueLessThan("aByteArrayValue", bytes).list();
fail();
} catch (ProcessEngineException e) {
}
}
Aggregations