Search in sources :

Example 51 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByNullCaseInstanceVariableValueLessThan.

public void testQueryByNullCaseInstanceVariableValueLessThan() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aNullValue", null).create();
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    try {
        query.caseInstanceVariableValueLessThan("aNullValue", null).list();
        fail();
    } catch (NotValidException e) {
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Example 52 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByBooleanVariableValueNotEquals.

public void testQueryByBooleanVariableValueNotEquals() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aBooleanValue", true).create();
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    query.variableValueNotEquals("aBooleanValue", false);
    verifyQueryResults(query, 1);
}
Also used : CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Example 53 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByIntegerCaseInstanceVariableValueEquals.

public void testQueryByIntegerCaseInstanceVariableValueEquals() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("anIntegerValue", 456).create();
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    query.caseInstanceVariableValueEquals("anIntegerValue", 456);
    verifyQueryResults(query, 2);
}
Also used : CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Example 54 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByNullVariableValueGreaterThanOrEqual.

public void testQueryByNullVariableValueGreaterThanOrEqual() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aNullValue", null).create();
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    try {
        query.variableValueGreaterThanOrEqual("aNullValue", null).list();
        fail();
    } catch (NotValidException e) {
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Example 55 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByCaseInstaceId.

public void testQueryByCaseInstaceId() {
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    List<CaseInstance> caseInstances = caseService.createCaseInstanceQuery().caseDefinitionKey(CASE_DEFINITION_KEY).list();
    for (CaseInstance caseInstance : caseInstances) {
        query.caseInstanceId(caseInstance.getId());
        verifyQueryResults(query, 2);
    }
    CaseInstance instance = caseService.createCaseInstanceQuery().caseDefinitionKey(CASE_DEFINITION_KEY_2).singleResult();
    query.caseInstanceId(instance.getId());
    verifyQueryResults(query, 3);
}
Also used : CaseInstance(org.camunda.bpm.engine.runtime.CaseInstance) CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Aggregations

CaseExecutionQuery (org.camunda.bpm.engine.runtime.CaseExecutionQuery)226 Deployment (org.camunda.bpm.engine.test.Deployment)70 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)47 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)24 NotValidException (org.camunda.bpm.engine.exception.NotValidException)24 CaseInstance (org.camunda.bpm.engine.runtime.CaseInstance)16 ArrayList (java.util.ArrayList)14 VariableInstance (org.camunda.bpm.engine.runtime.VariableInstance)13 Date (java.util.Date)12 Task (org.camunda.bpm.engine.task.Task)10 VariableMap (org.camunda.bpm.engine.variable.VariableMap)9 HashMap (java.util.HashMap)8 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)4 CaseInstanceQuery (org.camunda.bpm.engine.runtime.CaseInstanceQuery)4 CaseService (org.camunda.bpm.engine.CaseService)2 NotAllowedException (org.camunda.bpm.engine.exception.NotAllowedException)2 DescribesScenario (org.camunda.bpm.qa.upgrade.DescribesScenario)2 ScenarioSetup (org.camunda.bpm.qa.upgrade.ScenarioSetup)2 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 CaseExecutionDto (org.camunda.bpm.engine.rest.dto.runtime.CaseExecutionDto)1