use of org.camunda.bpm.engine.runtime.CaseExecutionQuery in project camunda-bpm-platform by camunda.
the class CaseExecutionQueryTest method testQueryByShortVariableValueNotEquals.
public void testQueryByShortVariableValueNotEquals() {
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aShortValue", (short) 123).create();
CaseExecutionQuery query = caseService.createCaseExecutionQuery();
query.variableValueNotEquals("aShortValue", (short) 124);
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.CaseExecutionQuery in project camunda-bpm-platform by camunda.
the class CaseExecutionQueryTest method testQueryBySerializableCaseInstanceVariableValueEquals.
public void testQueryBySerializableCaseInstanceVariableValueEquals() {
List<String> serializable = new ArrayList<String>();
serializable.add("one");
serializable.add("two");
serializable.add("three");
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aSerializableValue", serializable).create();
CaseExecutionQuery query = caseService.createCaseExecutionQuery();
try {
query.caseInstanceVariableValueEquals("aSerializableValue", serializable).list();
fail();
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.runtime.CaseExecutionQuery in project camunda-bpm-platform by camunda.
the class CaseExecutionQueryTest method testQueryByStringVariableValueNotEquals.
public void testQueryByStringVariableValueNotEquals() {
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aStringValue", "abc").create();
CaseExecutionQuery query = caseService.createCaseExecutionQuery();
query.variableValueNotEquals("aStringValue", "abd");
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.CaseExecutionQuery in project camunda-bpm-platform by camunda.
the class CaseExecutionQueryTest method testQueryByByteArrayVariableValueEquals.
public void testQueryByByteArrayVariableValueEquals() {
byte[] bytes = "somebytes".getBytes();
caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aByteArrayValue", bytes).create();
CaseExecutionQuery query = caseService.createCaseExecutionQuery();
try {
query.variableValueEquals("aByteArrayValue", bytes).list();
fail();
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.runtime.CaseExecutionQuery in project camunda-bpm-platform by camunda.
the class RepetitionRuleTest method testRepeatStageWithoutEntryCriteriaWhenCompleting.
@Deployment(resources = "org/camunda/bpm/engine/test/cmmn/repetition/RepetitionRuleTest.testRepeatStageWithoutEntryCriteria.cmmn")
public void testRepeatStageWithoutEntryCriteriaWhenCompleting() {
// given
String caseInstanceId = createCaseInstanceByKey(CASE_ID, Variables.createVariables().putValue("repeating", true)).getId();
CaseExecutionQuery stageQuery = caseService.createCaseExecutionQuery().activityId("PI_Stage_1");
assertEquals(1, stageQuery.count());
CaseExecution activeStageCaseExecution = stageQuery.active().singleResult();
assertNotNull(activeStageCaseExecution);
CaseExecution humanTaskCaseExecution = queryCaseExecutionByActivityId("PI_HumanTask_1");
// when (1)
complete(humanTaskCaseExecution.getId());
// then (1)
stageQuery = caseService.createCaseExecutionQuery().activityId("PI_Stage_1");
assertEquals(1, stageQuery.count());
activeStageCaseExecution = stageQuery.active().singleResult();
assertNotNull(activeStageCaseExecution);
humanTaskCaseExecution = queryCaseExecutionByActivityId("PI_HumanTask_1");
// when (2)
caseService.setVariable(caseInstanceId, "repeating", false);
complete(humanTaskCaseExecution.getId());
// then (3)
CaseExecutionQuery query = caseService.createCaseExecutionQuery();
assertEquals(1, query.count());
assertEquals(caseInstanceId, query.singleResult().getId());
}
Aggregations