use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class ExpressionLanguageTest method getDmnEngineConfiguration.
@Override
public DmnEngineConfiguration getDmnEngineConfiguration() {
DefaultDmnEngineConfiguration configuration = new DefaultDmnEngineConfiguration();
configuration.setScriptEngineResolver(createScriptEngineResolver());
configuration.setElProvider(createElProvider());
return configuration;
}
use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class ExpressionLanguageTest method createEngineWithDefaultExpressionLanguage.
protected DmnEngine createEngineWithDefaultExpressionLanguage(String expressionLanguage) {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultInputExpressionExpressionLanguage(expressionLanguage);
configuration.setDefaultInputEntryExpressionLanguage(expressionLanguage);
configuration.setDefaultOutputEntryExpressionLanguage(expressionLanguage);
configuration.setDefaultLiteralExpressionLanguage(expressionLanguage);
return configuration.buildEngine();
}
use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class FeelIntegrationTest method testFeelInputExpressionWithCustomEngine.
@Test
@DecisionResource(resource = DMN)
public void testFeelInputExpressionWithCustomEngine() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultInputExpressionExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
// stubbing the default FEEL engine behavior
doReturn(3).when(feelEngineSpy).evaluateSimpleExpression(eq("score"), any(VariableContext.class));
DmnDecisionResult decisionResult = engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
assertThat(decisionResult.getSingleEntry()).isEqualTo("a");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class FeelIntegrationTest method getDmnEngineConfiguration.
@Override
public DmnEngineConfiguration getDmnEngineConfiguration() {
DefaultDmnEngineConfiguration configuration = new DefaultDmnEngineConfiguration();
configuration.setFeelEngineFactory(new TestFeelEngineFactory());
return configuration;
}
use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-engine-dmn by camunda.
the class FeelIntegrationTest method testFeelOutputEntry.
@Test
@DecisionResource(resource = DMN)
public void testFeelOutputEntry() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultOutputEntryExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
try {
engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
failBecauseExceptionWasNotThrown(UnsupportedOperationException.class);
} catch (UnsupportedOperationException e) {
assertThat(e).hasMessageStartingWith("FEEL-01016");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
}
Aggregations