Search in sources :

Example 61 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByBooleanVariableValueGreaterThan.

public void testQueryByBooleanVariableValueGreaterThan() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aBooleanValue", true).create();
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    try {
        query.variableValueGreaterThan("aBooleanValue", false).list();
        fail();
    } catch (NotValidException e) {
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Example 62 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByDateVariableValueLessThan.

public void testQueryByDateVariableValueLessThan() {
    Date now = new Date();
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aDateValue", now).create();
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    Date after = new Date(now.getTime() + 100000);
    query.variableValueLessThan("aDateValue", after);
    verifyQueryResults(query, 1);
}
Also used : Date(java.util.Date) CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Example 63 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByStringCaseInstanceVariableValueLessThanOrEqual.

public void testQueryByStringCaseInstanceVariableValueLessThanOrEqual() {
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aStringValue", "abc").create();
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    query.caseInstanceVariableValueLessThanOrEqual("aStringValue", "abd");
    verifyQueryResults(query, 2);
    query = caseService.createCaseExecutionQuery();
    query.caseInstanceVariableValueLessThanOrEqual("aStringValue", "abc");
    verifyQueryResults(query, 2);
}
Also used : CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Example 64 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByDateVariableValueLessThanOrEqual.

public void testQueryByDateVariableValueLessThanOrEqual() {
    Date now = new Date();
    caseService.withCaseDefinitionByKey(CASE_DEFINITION_KEY).setVariable("aDateValue", now).create();
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    Date after = new Date(now.getTime() + 100000);
    query.variableValueLessThanOrEqual("aDateValue", after);
    verifyQueryResults(query, 1);
    query = caseService.createCaseExecutionQuery();
    query.variableValueLessThanOrEqual("aDateValue", now);
    verifyQueryResults(query, 1);
}
Also used : Date(java.util.Date) CaseExecutionQuery(org.camunda.bpm.engine.runtime.CaseExecutionQuery)

Example 65 with CaseExecutionQuery

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

the class CaseExecutionQueryTest method testQueryByCaseDefinitionKey.

public void testQueryByCaseDefinitionKey() {
    CaseExecutionQuery query = caseService.createCaseExecutionQuery();
    query.caseDefinitionKey(CASE_DEFINITION_KEY);
    verifyQueryResults(query, 8);
    query.caseDefinitionKey(CASE_DEFINITION_KEY_2);
    verifyQueryResults(query, 3);
}
Also used : 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