Search in sources :

Example 36 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByInvalidCaseDefinitionKey.

public void testQueryByInvalidCaseDefinitionKey() {
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    query.caseDefinitionKey("invalid");
    verifyQueryResults(query, 0);
    try {
        query.caseDefinitionKey(null);
        fail();
    } catch (NotValidException e) {
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

Example 37 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByDoubleVariableValueLessThanOrEqual.

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

Example 38 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByLongVariableValueEquals.

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

Example 39 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByBooleanVariableValueLessThanOrEqual.

public void testQueryByBooleanVariableValueLessThanOrEqual() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aBooleanValue", true).create();
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    try {
        query.variableValueLessThanOrEqual("aBooleanValue", false).list();
        fail();
    } catch (ProcessEngineException e) {
    }
}
Also used : CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 40 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByInvalidCaseInstanceBusinessKey.

public void testQueryByInvalidCaseInstanceBusinessKey() {
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    query.caseInstanceBusinessKey("invalid");
    verifyQueryResults(query, 0);
    try {
        query.caseInstanceBusinessKey(null);
        fail();
    } catch (NotValidException e) {
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) CaseInstanceQuery(org.camunda.bpm.engine.runtime.CaseInstanceQuery)

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