Search in sources :

Example 36 with DecisionDefinitionQuery

use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.

the class DecisionDefinitionQueryTest method queryByWithoutDecisionRequirementsDefinition.

@Test
public void queryByWithoutDecisionRequirementsDefinition() {
    testRule.deploy(DRD_DISH_RESOURCE, DRD_SCORE_RESOURCE);
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    verifyQueryResults(query, 9);
    verifyQueryResults(query.withoutDecisionRequirementsDefinition(), 4);
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Example 37 with DecisionDefinitionQuery

use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.

the class DecisionDefinitionQueryTest method queryByName.

@Test
public void queryByName() {
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    query.decisionDefinitionName("Two");
    verifyQueryResults(query, 1);
    query.decisionDefinitionName("One");
    verifyQueryResults(query, 2);
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Example 38 with DecisionDefinitionQuery

use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.

the class DecisionDefinitionQueryTest method queryByKey.

@Test
public void queryByKey() {
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    // decision one
    query.decisionDefinitionKey("one");
    verifyQueryResults(query, 2);
    // decision two
    query.decisionDefinitionKey("two");
    verifyQueryResults(query, 1);
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Example 39 with DecisionDefinitionQuery

use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.

the class DecisionDefinitionQueryTest method queryByDecisionRequirementsDefinitionId.

@Test
public void queryByDecisionRequirementsDefinitionId() {
    testRule.deploy(DRD_DISH_RESOURCE, DRD_SCORE_RESOURCE);
    List<DecisionRequirementsDefinition> drds = repositoryService.createDecisionRequirementsDefinitionQuery().orderByDecisionRequirementsDefinitionName().asc().list();
    String dishDrdId = drds.get(0).getId();
    String scoreDrdId = drds.get(1).getId();
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    verifyQueryResults(query.decisionRequirementsDefinitionId("non existing"), 0);
    verifyQueryResults(query.decisionRequirementsDefinitionId(dishDrdId), 3);
    verifyQueryResults(query.decisionRequirementsDefinitionId(scoreDrdId), 2);
}
Also used : DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) DecisionRequirementsDefinition(org.camunda.bpm.engine.repository.DecisionRequirementsDefinition) Test(org.junit.Test)

Example 40 with DecisionDefinitionQuery

use of org.camunda.bpm.engine.repository.DecisionDefinitionQuery in project camunda-bpm-platform by camunda.

the class DecisionDefinitionQueryTest method queryByInvalidCategoryLike.

@Test
public void queryByInvalidCategoryLike() {
    DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();
    query.decisionDefinitionCategoryLike("invalid");
    verifyQueryResults(query, 0);
    try {
        query.decisionDefinitionCategoryLike(null);
        fail();
    } catch (NotValidException e) {
    // Expected exception
    }
}
Also used : NotValidException(org.camunda.bpm.engine.exception.NotValidException) DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) Test(org.junit.Test)

Aggregations

DecisionDefinitionQuery (org.camunda.bpm.engine.repository.DecisionDefinitionQuery)49 Test (org.junit.Test)23 NotValidException (org.camunda.bpm.engine.exception.NotValidException)10 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)10 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)2 DecisionDefinitionQueryDto (org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionQueryDto)2 Deployment (org.camunda.bpm.engine.test.Deployment)2 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 DecisionRequirementsDefinition (org.camunda.bpm.engine.repository.DecisionRequirementsDefinition)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 DecisionDefinitionDto (org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionDto)1