Search in sources :

Example 6 with DmnDecisionRequirementsGraph

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

the class ParseDecisionTest method shouldParseDrgFromInputStream.

@Test
public void shouldParseDrgFromInputStream() {
    InputStream inputStream = IoUtil.fileAsStream(NO_INPUT_DMN);
    DmnDecisionRequirementsGraph drg = dmnEngine.parseDecisionRequirementsGraph(inputStream);
    assertDecisionRequirementsGraph(drg, "definitions");
}
Also used : InputStream(java.io.InputStream) DmnDecisionRequirementsGraph(org.camunda.bpm.dmn.engine.DmnDecisionRequirementsGraph) Test(org.junit.Test) DmnEngineTest(org.camunda.bpm.dmn.engine.test.DmnEngineTest)

Example 7 with DmnDecisionRequirementsGraph

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

the class DmnDecisionEvaluationTest method shouldEvaluateDecisionWithRuleOrderHitPolicyReturningAList.

@Test
public void shouldEvaluateDecisionWithRuleOrderHitPolicyReturningAList() {
    DmnDecisionRequirementsGraph graph = dmnEngine.parseDecisionRequirementsGraph(IoUtil.fileAsStream(DRG_RULE_ORDER_DMN));
    initVariables();
    variables.putValue("dayType", "WeekDay");
    DmnDecisionResult result = dmnEngine.evaluateDecision(graph.getDecision("dish-decision"), variables);
    assertThat(result.getSingleEntry()).isNotNull().isEqualTo("Steak");
}
Also used : DmnDecisionResult(org.camunda.bpm.dmn.engine.DmnDecisionResult) DmnDecisionRequirementsGraph(org.camunda.bpm.dmn.engine.DmnDecisionRequirementsGraph) Test(org.junit.Test) DmnEngineTest(org.camunda.bpm.dmn.engine.test.DmnEngineTest)

Aggregations

DmnDecisionRequirementsGraph (org.camunda.bpm.dmn.engine.DmnDecisionRequirementsGraph)7 DmnEngineTest (org.camunda.bpm.dmn.engine.test.DmnEngineTest)7 Test (org.junit.Test)7 InputStream (java.io.InputStream)3 DmnDecisionResult (org.camunda.bpm.dmn.engine.DmnDecisionResult)2 DmnDecision (org.camunda.bpm.dmn.engine.DmnDecision)1 DmnDecisionTableResult (org.camunda.bpm.dmn.engine.DmnDecisionTableResult)1 DmnModelInstance (org.camunda.bpm.model.dmn.DmnModelInstance)1 Definitions (org.camunda.bpm.model.dmn.instance.Definitions)1