Search in sources :

Example 71 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByDateVariableValueEquals.

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

Example 72 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByBooleanVariableValueLessThan.

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

Example 73 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByShortVariableValueLessThan.

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

Example 74 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByInvalidSubCaseInstanceId.

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

Example 75 with CaseInstanceQuery

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

the class CaseInstanceQueryTest method testQueryByCaseInstanceBusinessKeyAndCaseDefinitionKey.

public void testQueryByCaseInstanceBusinessKeyAndCaseDefinitionKey() {
    CaseInstanceQuery query = caseService.createCaseInstanceQuery();
    query.caseInstanceBusinessKey("0").caseDefinitionKey(CASE_DEFINITION_KEY);
    verifyQueryResults(query, 1);
    query.caseInstanceBusinessKey("1").caseDefinitionKey(CASE_DEFINITION_KEY);
    verifyQueryResults(query, 1);
    query.caseInstanceBusinessKey("2").caseDefinitionKey(CASE_DEFINITION_KEY);
    verifyQueryResults(query, 1);
    query.caseInstanceBusinessKey("3").caseDefinitionKey(CASE_DEFINITION_KEY);
    verifyQueryResults(query, 1);
    query.caseInstanceBusinessKey("1").caseDefinitionKey(CASE_DEFINITION_KEY_2);
    verifyQueryResults(query, 1);
}
Also used : 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