Search in sources :

Example 16 with DmnDecisionTableResult

use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-engine-dmn by camunda.

the class DmnDecisionEvaluationTest method shouldEvaluateDecisionsWithRequiredDecisionAndMultipleMatchingRules.

@Test
public void shouldEvaluateDecisionsWithRequiredDecisionAndMultipleMatchingRules() {
    DmnDecisionTableResult results = dmnEngine.evaluateDecisionTable(parseDecisionFromFile("A", DMN_DECISIONS_WITH_MULTIPLE_MATCHING_RULES), createVariables().putValue("dd", 3).putValue("ee", "ee").asVariableContext());
    List<Map<String, Object>> resultList = results.getResultList();
    assertThat(resultList.get(0)).containsEntry("aa", "aa");
    assertThat(resultList.get(1)).containsEntry("aa", "aaa");
}
Also used : DmnDecisionTableResult(org.camunda.bpm.dmn.engine.DmnDecisionTableResult) Map(java.util.Map) Test(org.junit.Test) DmnEngineTest(org.camunda.bpm.dmn.engine.test.DmnEngineTest)

Example 17 with DmnDecisionTableResult

use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-engine-dmn by camunda.

the class DmnDecisionEvaluationTest method shouldEvaluateSharedDecisions.

@Test
public void shouldEvaluateSharedDecisions() {
    DmnDecisionTableResult results = dmnEngine.evaluateDecisionTable(parseDecisionFromFile("A", DMN_SHARED_DECISIONS), createVariables().putValue("ff", "ff").asVariableContext());
    assertThat(results).hasSingleResult().containsEntry("aa", "aa");
}
Also used : DmnDecisionTableResult(org.camunda.bpm.dmn.engine.DmnDecisionTableResult) Test(org.junit.Test) DmnEngineTest(org.camunda.bpm.dmn.engine.test.DmnEngineTest)

Example 18 with DmnDecisionTableResult

use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-bpm-platform by camunda.

the class DecisionServiceTest method evaluateDecisionTableByKeyAndLatestVersion.

@Deployment(resources = DMN_DECISION_TABLE)
@Test
public void evaluateDecisionTableByKeyAndLatestVersion() {
    testRule.deploy(DMN_DECISION_TABLE_V2);
    DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableByKey(DECISION_DEFINITION_KEY, createVariables());
    assertThatDecisionHasResult(decisionResult, RESULT_OF_SECOND_VERSION);
}
Also used : DmnDecisionTableResult(org.camunda.bpm.dmn.engine.DmnDecisionTableResult) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 19 with DmnDecisionTableResult

use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-bpm-platform by camunda.

the class DecisionServiceTest method evaluateDecisionTableByKeyAndVersion.

@Deployment(resources = DMN_DECISION_TABLE)
@Test
public void evaluateDecisionTableByKeyAndVersion() {
    testRule.deploy(DMN_DECISION_TABLE_V2);
    DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableByKeyAndVersion(DECISION_DEFINITION_KEY, 1, createVariables());
    assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
Also used : DmnDecisionTableResult(org.camunda.bpm.dmn.engine.DmnDecisionTableResult) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 20 with DmnDecisionTableResult

use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-bpm-platform by camunda.

the class DecisionServiceTest method evaluateDecisionTableByKey.

@Deployment(resources = DMN_DECISION_TABLE)
@Test
public void evaluateDecisionTableByKey() {
    DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableByKey(DECISION_DEFINITION_KEY, createVariables());
    assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
Also used : DmnDecisionTableResult(org.camunda.bpm.dmn.engine.DmnDecisionTableResult) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

DmnDecisionTableResult (org.camunda.bpm.dmn.engine.DmnDecisionTableResult)56 Test (org.junit.Test)44 DmnEngineTest (org.camunda.bpm.dmn.engine.test.DmnEngineTest)33 DecisionResource (org.camunda.bpm.dmn.engine.test.DecisionResource)20 Deployment (org.camunda.bpm.engine.test.Deployment)9 DmnDecisionRuleResult (org.camunda.bpm.dmn.engine.DmnDecisionRuleResult)5 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)5 Map (java.util.Map)4 TypedValue (org.camunda.bpm.engine.variable.value.TypedValue)4 DmnDecisionResultException (org.camunda.bpm.dmn.engine.impl.DmnDecisionResultException)2 AbstractFoxPlatformIntegrationTest (org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)2 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)2 DmnDecisionRequirementsGraph (org.camunda.bpm.dmn.engine.DmnDecisionRequirementsGraph)1 DecisionService (org.camunda.bpm.engine.DecisionService)1 VariableMap (org.camunda.bpm.engine.variable.VariableMap)1 Deployment (org.jboss.arquillian.container.test.api.Deployment)1