use of org.kie.dmn.model.v1_1.Binding 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;
}
use of org.kie.dmn.model.v1_1.Binding in project drools by kiegroup.
the class BindingConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
Binding b = (Binding) parent;
writeChildrenNode(writer, context, b.getParameter(), PARAMETER);
if (b.getExpression() != null)
writeChildrenNode(writer, context, b.getExpression(), MarshallingUtils.defineExpressionNodeName(b.getExpression()));
}
Aggregations