use of org.kie.workbench.common.dmn.api.definition.v1_1.Invocation in project drools by kiegroup.
the class DMNEvaluatorCompiler method compileInvocation.
private DMNExpressionEvaluator compileInvocation(DMNCompilerContext ctx, DMNModelImpl model, DMNBaseNode node, Invocation expression) {
Invocation invocation = expression;
// expression must be a literal text with the name of the function
String functionName = ((LiteralExpression) invocation.getExpression()).getText();
DMNInvocationEvaluator invEval = new DMNInvocationEvaluator(node.getName(), node.getSource(), functionName, invocation, null, feel.newFEELInstance());
for (Binding binding : invocation.getBinding()) {
if (binding.getParameter() == null) {
// error, missing binding parameter
MsgUtil.reportMessage(logger, DMNMessage.Severity.ERROR, binding, model, null, null, Msg.MISSING_PARAMETER_FOR_INVOCATION, node.getIdentifierString());
return null;
}
if (binding.getExpression() == null) {
MsgUtil.reportMessage(logger, DMNMessage.Severity.ERROR, binding, model, null, null, Msg.MISSING_PARAMETER_FOR_INVOCATION, node.getIdentifierString());
return null;
}
invEval.addParameter(binding.getParameter().getName(), compiler.resolveTypeRef(model, node, binding.getParameter(), binding.getParameter(), binding.getParameter().getTypeRef()), compileExpression(ctx, model, node, binding.getParameter().getName(), binding.getExpression()));
}
return invEval;
}
Aggregations