use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testSingleOutputTypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleOutputTypedValue() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
DmnDecisionResultEntries 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"));
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testSingleEntryUntypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleEntryUntypedValue() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
TypedValue typedValue = decisionResult.getSingleEntryTyped();
assertThat(typedValue).isEqualTo(Variables.untypedValue("singleValue"));
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testSingleEntryUntypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleEntryUntypedValue() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
TypedValue typedValue = decisionResult.getSingleEntryTyped();
assertThat(typedValue).isEqualTo(Variables.untypedValue("singleValue"));
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testSingleEntryTypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleEntryTypedValue() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
TypedValue typedValue = decisionResult.getSingleEntryTyped();
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class VariableContextScriptBindings method get.
/**
* Dedicated implementation which does not fall back on the {@link #calculateBindingMap()} for performance reasons
*/
public Object get(Object key) {
Object result = null;
if (wrappedBindings.containsKey(key)) {
result = wrappedBindings.get(key);
} else {
if (key instanceof String) {
TypedValue resolvedValue = variableContext.resolve((String) key);
result = unpack(resolvedValue);
}
}
return result;
}
Aggregations