use of org.camunda.bpm.dmn.engine.impl.DmnExpressionImpl in project camunda-engine-dmn by camunda.
the class DmnDecisionTableConditionTransformHandler method createFromInputEntry.
protected DmnExpressionImpl createFromInputEntry(DmnElementTransformContext context, InputEntry inputEntry) {
DmnExpressionImpl condition = createDmnElement(context, inputEntry);
condition.setId(inputEntry.getId());
condition.setName(inputEntry.getLabel());
condition.setExpressionLanguage(getExpressionLanguage(context, inputEntry));
condition.setExpression(getExpression(inputEntry));
return condition;
}
use of org.camunda.bpm.dmn.engine.impl.DmnExpressionImpl in project camunda-engine-dmn by camunda.
the class DmnDecisionTableInputExpressionTransformHandler method createFromInputExpression.
protected DmnExpressionImpl createFromInputExpression(DmnElementTransformContext context, InputExpression inputExpression) {
DmnExpressionImpl dmnExpression = createDmnElement(context, inputExpression);
dmnExpression.setId(inputExpression.getId());
dmnExpression.setName(inputExpression.getLabel());
dmnExpression.setTypeDefinition(createTypeDefinition(context, inputExpression));
dmnExpression.setExpressionLanguage(getExpressionLanguage(context, inputExpression));
dmnExpression.setExpression(getExpression(inputExpression));
return dmnExpression;
}
use of org.camunda.bpm.dmn.engine.impl.DmnExpressionImpl in project camunda-engine-dmn by camunda.
the class DmnLiternalExpressionTransformHandler method createFromLiteralExpressionEntry.
protected DmnExpressionImpl createFromLiteralExpressionEntry(DmnElementTransformContext context, LiteralExpression literalExpression) {
DmnExpressionImpl dmnExpression = createDmnElement(context, literalExpression);
dmnExpression.setId(literalExpression.getId());
dmnExpression.setName(literalExpression.getLabel());
dmnExpression.setExpressionLanguage(getExpressionLanguage(context, literalExpression));
dmnExpression.setExpression(getExpression(literalExpression));
return dmnExpression;
}
use of org.camunda.bpm.dmn.engine.impl.DmnExpressionImpl in project camunda-engine-dmn by camunda.
the class ExpressionCachingTest method createExpression.
private DmnExpressionImpl createExpression(String text, String language) {
DmnExpressionImpl expression = spy(new DmnExpressionImpl());
expression.setExpression(text);
expression.setExpressionLanguage(language);
return expression;
}
use of org.camunda.bpm.dmn.engine.impl.DmnExpressionImpl in project camunda-engine-dmn by camunda.
the class ExpressionCachingTest method testCompiledScriptCaching.
@Test
public void testCompiledScriptCaching() throws ScriptException {
// given
DmnExpressionImpl expression = createExpression("1 > 2", "groovy");
// when
expressionEvaluationHandler.evaluateExpression("groovy", expression, emptyVariableContext());
// then
InOrder inOrder = inOrder(expression, scriptEngineSpy);
inOrder.verify(expression, atLeastOnce()).getCachedCompiledScript();
inOrder.verify(compilableSpy, times(1)).compile(anyString());
inOrder.verify(expression, times(1)).cacheCompiledScript(any(CompiledScript.class));
// when (2)
expressionEvaluationHandler.evaluateExpression("groovy", expression, emptyVariableContext());
// then (2)
inOrder.verify(expression, atLeastOnce()).getCachedCompiledScript();
inOrder.verify(compilableSpy, times(0)).compile(anyString());
}
Aggregations