Java Code Examples for org.camunda.bpm.dmn.engine.DmnDecisionTableResult#getFirstResult()

The following examples show how to use org.camunda.bpm.dmn.engine.DmnDecisionTableResult#getFirstResult() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DmnDecisionTableResultTest.java    From camunda-engine-dmn with Apache License 2.0 6 votes vote down vote up
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleOutputUntypedValue() {
  DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
  assertThat(decisionResult).hasSize(1);

  DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();

  TypedValue typedEntry = ruleResult.getEntryTyped("firstOutput");
  assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));

  typedEntry = ruleResult.getEntryTyped("secondOutput");
  assertThat(typedEntry).isNull();

  typedEntry = ruleResult.getFirstEntryTyped();
  assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));

  typedEntry = ruleResult.getSingleEntryTyped();
  assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
}
 
Example 2
Source File: DmnDecisionTableResultTest.java    From camunda-engine-dmn with Apache License 2.0 6 votes vote down vote up
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleOutputTypedValue() {
  DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
  assertThat(decisionResult).hasSize(1);

  DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();

  TypedValue typedValue = ruleResult.getEntryTyped("firstOutput");
  assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));

  typedValue = ruleResult.getEntryTyped("secondOutput");
  assertThat(typedValue).isNull();

  typedValue = ruleResult.getFirstEntryTyped();
  assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));

  typedValue = ruleResult.getSingleEntryTyped();
  assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
}
 
Example 3
Source File: DmnDecisionTableResultTest.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleOutputUntypedValue() {
  DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
  assertThat(decisionResult).hasSize(1);

  DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();

  TypedValue typedEntry = ruleResult.getEntryTyped("firstOutput");
  assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));

  typedEntry = ruleResult.getEntryTyped("secondOutput");
  assertThat(typedEntry).isNull();

  typedEntry = ruleResult.getFirstEntryTyped();
  assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));

  typedEntry = ruleResult.getSingleEntryTyped();
  assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
}
 
Example 4
Source File: DmnDecisionTableResultTest.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleOutputTypedValue() {
  DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
  assertThat(decisionResult).hasSize(1);

  DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();

  TypedValue typedValue = ruleResult.getEntryTyped("firstOutput");
  assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));

  typedValue = ruleResult.getEntryTyped("secondOutput");
  assertThat(typedValue).isNull();

  typedValue = ruleResult.getFirstEntryTyped();
  assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));

  typedValue = ruleResult.getSingleEntryTyped();
  assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
}