use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class FeelIntegrationTest method testFeelInputEntryWithAlternativeName.
@Test
@DecisionResource(resource = DMN)
public void testFeelInputEntryWithAlternativeName() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultInputEntryExpressionLanguage("feel");
DmnEngine dmnEngine = configuration.buildEngine();
DmnDecisionResult decisionResult = dmnEngine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
assertThat(decisionResult.getSingleEntry()).isEqualTo("a");
verify(feelEngineSpy, atLeastOnce()).evaluateSimpleUnaryTests(anyString(), anyString(), any(VariableContext.class));
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class DmnEngineRuleTest method shouldCreateDefaultDmnEngineWithoutConfiguration.
@Test
public void shouldCreateDefaultDmnEngineWithoutConfiguration() {
DmnEngine dmnEngine = engineRule.getDmnEngine();
assertThat(dmnEngine).isInstanceOf(DefaultDmnEngine.class).isNotNull();
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-bpm-platform by camunda.
the class DecisionInvocation method invoke.
@Override
protected void invoke() throws Exception {
final DmnEngine dmnEngine = Context.getProcessEngineConfiguration().getDmnEngine();
invocationResult = dmnEngine.evaluateDecision((DmnDecision) decisionDefinition, variableContext);
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-bpm-platform by camunda.
the class DmnEngineConfigurationTest method getConfigurationOfDmnEngine.
protected DefaultDmnEngineConfiguration getConfigurationOfDmnEngine() {
ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) engine.getProcessEngineConfiguration();
DmnEngine dmnEngine = processEngineConfiguration.getDmnEngine();
return (DefaultDmnEngineConfiguration) dmnEngine.getConfiguration();
}
use of org.camunda.bpm.dmn.engine.DmnEngine in project camunda-engine-dmn by camunda.
the class ExpressionLanguageTest method testExecuteLiteralExpressionWithGroovyDmnEngineConfiguration.
@Test
@DecisionResource(resource = DECISION_WITH_LITERAL_EXPRESSION_DMN)
public void testExecuteLiteralExpressionWithGroovyDmnEngineConfiguration() {
DmnEngine juelEngine = createEngineWithDefaultExpressionLanguage("groovy");
juelEngine.evaluateDecision(decision, Variables.createVariables().putValue("a", 1).putValue("b", 2));
verify(scriptEngineResolver, atLeastOnce()).getScriptEngineForLanguage("groovy");
verify(scriptEngineResolver, never()).getScriptEngineForLanguage("juel");
}
Aggregations