Search in sources :

Example 21 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class CaseInstanceQueryTest method testQueryByLongVariableValueNotEquals.

public void testQueryByLongVariableValueNotEquals() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aLongValue", (long) 789).create();
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    query.variableValueNotEquals("aLongValue", (long) 790);
    verifyQueryResults(query, 1);
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

Example 22 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class CaseInstanceQueryTest method testQueryByShortVariableValueLessThanOrEqual.

public void testQueryByShortVariableValueLessThanOrEqual() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aShortValue", (short) 123).create();
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    query.variableValueLessThanOrEqual("aShortValue", (short) 124);
    verifyQueryResults(query, 1);
    query = caseService.createCaseInstanceQuery();
    query.variableValueLessThanOrEqual("aShortValue", (short) 123);
    verifyQueryResults(query, 1);
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

Example 23 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class CaseInstanceQueryTest method testQueryByDoubleVariableValueLessThan.

public void testQueryByDoubleVariableValueLessThan() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aDoubleValue", 1.5).create();
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    query.variableValueLessThan("aDoubleValue", 1.6);
    verifyQueryResults(query, 1);
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

Example 24 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class CaseInstanceQueryTest method testQueryByTerminated.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/CaseInstanceQueryTest.testQueryByTerminated.cmmn" })
public void testQueryByTerminated() {
    String caseInstanceId = caseService.withCaseDefinitionByKey("termination").create().getId();
    String caseExecutionId = caseService.createCaseExecutionQuery().activityId("PI_HumanTask_1").caseInstanceId(caseInstanceId).singleResult().getId();
    caseService.withCaseExecution(caseExecutionId).complete();
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    query.terminated();
    verifyQueryResults(query, 1);
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 25 with CaseInstanceQuery

use of org.camunda.bpm.engine.runtime.CaseInstanceQuery in project camunda-bpm-platform by camunda.

the class CaseInstanceQueryTest method testQueryByDateVariableValueGreaterThan.

public void testQueryByDateVariableValueGreaterThan() {
    Date now = new Date();
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aDateValue", now).create();
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    Date before = new Date(now.getTime() - 100000);
    query.variableValueGreaterThan("aDateValue", before);
    verifyQueryResults(query, 1);
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery) Date(java.util.Date)

Aggregations

CaseInstanceQuery (org.camunda.bpm.engine.runtime.CaseInstanceQuery)123 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)21 Deployment (org.camunda.bpm.engine.test.Deployment)10 NotValidException (org.camunda.bpm.engine.exception.NotValidException)9 ArrayList (java.util.ArrayList)8 CaseInstance (org.camunda.bpm.engine.runtime.CaseInstance)8 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)7 Date (java.util.Date)6 CaseExecutionQuery (org.camunda.bpm.engine.runtime.CaseExecutionQuery)4 CaseDefinition (org.camunda.bpm.engine.repository.CaseDefinition)3 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 CaseInstanceDto (org.camunda.bpm.engine.rest.dto.runtime.CaseInstanceDto)1 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)1