Search in sources :

Example 16 with DmnDecisionResultEntries

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

the class DmnDecisionResultListenerTest method testCollectSumHitPolicySingleEntry.

@Deployment(resources = { TEST_PROCESS, TEST_DECISION_COLLECT_SUM })
public void testCollectSumHitPolicySingleEntry() {
    startTestProcess("single entry");
    assertEquals(1, results.size());
    DmnDecisionResultEntries firstOutput = results.get(0);
    assertEquals(12, firstOutput.getFirstEntry());
    assertEquals(Variables.integerValue(12), firstOutput.getFirstEntryTyped());
}
Also used : DmnDecisionResultEntries(org.camunda.bpm.dmn.engine.DmnDecisionResultEntries) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 17 with DmnDecisionResultEntries

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

the class DmnDecisionResultListenerTest method testCollectCountHitPolicyNoOutput.

@Deployment(resources = { TEST_PROCESS, TEST_DECISION_COLLECT_COUNT })
public void testCollectCountHitPolicyNoOutput() {
    startTestProcess("no output");
    assertEquals(1, results.size());
    DmnDecisionResultEntries firstOutput = results.get(0);
    assertEquals(0, firstOutput.getFirstEntry());
    assertEquals(Variables.integerValue(0), firstOutput.getFirstEntryTyped());
}
Also used : DmnDecisionResultEntries(org.camunda.bpm.dmn.engine.DmnDecisionResultEntries) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 18 with DmnDecisionResultEntries

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

the class DmnDecisionResultListenerTest method testEmptyOutput.

@Deployment(resources = { TEST_PROCESS, TEST_DECISION })
public void testEmptyOutput() {
    startTestProcess("empty output");
    assertFalse("The decision result 'ruleResult' should not be empty", results.isEmpty());
    DmnDecisionResultEntries decisionOutput = results.get(0);
    assertNull(decisionOutput.getFirstEntry());
}
Also used : DmnDecisionResultEntries(org.camunda.bpm.dmn.engine.DmnDecisionResultEntries) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 19 with DmnDecisionResultEntries

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

the class DmnDecisionResultListenerTest method testSingleEntryList.

@Deployment(resources = { TEST_PROCESS, TEST_DECISION })
public void testSingleEntryList() {
    startTestProcess("single entry list");
    assertEquals(2, results.size());
    for (DmnDecisionResultEntries output : results) {
        assertEquals("foo", output.getFirstEntry());
        assertEquals(Variables.stringValue("foo"), output.getFirstEntryTyped());
    }
}
Also used : DmnDecisionResultEntries(org.camunda.bpm.dmn.engine.DmnDecisionResultEntries) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 20 with DmnDecisionResultEntries

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

the class DmnDecisionResultListenerTest method testMultipleEntriesList.

@Deployment(resources = { TEST_PROCESS, TEST_DECISION })
public void testMultipleEntriesList() {
    startTestProcess("multiple entries list");
    assertEquals(2, results.size());
    for (DmnDecisionResultEntries output : results) {
        assertEquals(2, output.size());
        assertEquals("foo", output.get("result1"));
        assertEquals("bar", output.get("result2"));
        assertEquals(Variables.stringValue("foo"), output.getEntryTyped("result1"));
        assertEquals(Variables.stringValue("bar"), output.getEntryTyped("result2"));
    }
}
Also used : DmnDecisionResultEntries(org.camunda.bpm.dmn.engine.DmnDecisionResultEntries) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

DmnDecisionResultEntries (org.camunda.bpm.dmn.engine.DmnDecisionResultEntries)27 Deployment (org.camunda.bpm.engine.test.Deployment)18 ArrayList (java.util.ArrayList)5 DmnDecisionResult (org.camunda.bpm.dmn.engine.DmnDecisionResult)4 DecisionResource (org.camunda.bpm.dmn.engine.test.DecisionResource)4 DmnEngineTest (org.camunda.bpm.dmn.engine.test.DmnEngineTest)4 Test (org.junit.Test)4 Map (java.util.Map)2 TypedValue (org.camunda.bpm.engine.variable.value.TypedValue)2 DmnDecisionRuleResult (org.camunda.bpm.dmn.engine.DmnDecisionRuleResult)1 DmnDecisionTableEvaluationEvent (org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationEvent)1 DmnEvaluatedDecisionRule (org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedDecisionRule)1 DmnEvaluatedOutput (org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedOutput)1 DmnDecisionResultEntriesImpl (org.camunda.bpm.dmn.engine.impl.DmnDecisionResultEntriesImpl)1 DmnDecisionResultException (org.camunda.bpm.dmn.engine.impl.DmnDecisionResultException)1 DmnDecisionResultImpl (org.camunda.bpm.dmn.engine.impl.DmnDecisionResultImpl)1 VariableValueDto (org.camunda.bpm.engine.rest.dto.VariableValueDto)1 VariableMap (org.camunda.bpm.engine.variable.VariableMap)1