Search in sources :

Example 1 with BindingInnerObjectEvaluator

use of org.drools.modelcompiler.constraints.BindingInnerObjectEvaluator in project drools by kiegroup.

the class KiePackagesBuilder method createBindingEvaluator.

private BindingEvaluator createBindingEvaluator(RuleContext ctx, Binding binding) {
    if (binding == null) {
        return null;
    }
    Variable[] inputs = binding.getInputVariables();
    if (inputs.length == 1) {
        return new BindingInnerObjectEvaluator(binding);
    }
    Declaration[] declarations = new Declaration[inputs.length];
    for (int i = 0; i < inputs.length; i++) {
        declarations[i] = ctx.getDeclaration(inputs[i]);
    }
    return new BindingEvaluator(declarations, binding);
}
Also used : PrototypeVariable(org.drools.model.PrototypeVariable) Variable(org.drools.model.Variable) Declaration(org.drools.core.rule.Declaration) WindowDeclaration(org.drools.core.rule.WindowDeclaration) TypeDeclarationUtil.createTypeDeclaration(org.drools.modelcompiler.util.TypeDeclarationUtil.createTypeDeclaration) TypeDeclaration(org.drools.core.rule.TypeDeclaration) BindingInnerObjectEvaluator(org.drools.modelcompiler.constraints.BindingInnerObjectEvaluator) BindingEvaluator(org.drools.modelcompiler.constraints.BindingEvaluator) SingleConstraint(org.drools.model.SingleConstraint) QueryNameConstraint(org.drools.core.rule.constraint.QueryNameConstraint) LambdaConstraint(org.drools.modelcompiler.constraints.LambdaConstraint) UnificationConstraint(org.drools.modelcompiler.constraints.UnificationConstraint) EntryPoint(org.drools.model.EntryPoint) AbstractConstraint(org.drools.modelcompiler.constraints.AbstractConstraint) Constraint(org.drools.model.Constraint) CombinedConstraint(org.drools.modelcompiler.constraints.CombinedConstraint) AbstractSingleConstraint(org.drools.model.constraints.AbstractSingleConstraint) DSL.entryPoint(org.drools.model.DSL.entryPoint)

Aggregations

Declaration (org.drools.core.rule.Declaration)1 TypeDeclaration (org.drools.core.rule.TypeDeclaration)1 WindowDeclaration (org.drools.core.rule.WindowDeclaration)1 QueryNameConstraint (org.drools.core.rule.constraint.QueryNameConstraint)1 Constraint (org.drools.model.Constraint)1 DSL.entryPoint (org.drools.model.DSL.entryPoint)1 EntryPoint (org.drools.model.EntryPoint)1 PrototypeVariable (org.drools.model.PrototypeVariable)1 SingleConstraint (org.drools.model.SingleConstraint)1 Variable (org.drools.model.Variable)1 AbstractSingleConstraint (org.drools.model.constraints.AbstractSingleConstraint)1 AbstractConstraint (org.drools.modelcompiler.constraints.AbstractConstraint)1 BindingEvaluator (org.drools.modelcompiler.constraints.BindingEvaluator)1 BindingInnerObjectEvaluator (org.drools.modelcompiler.constraints.BindingInnerObjectEvaluator)1 CombinedConstraint (org.drools.modelcompiler.constraints.CombinedConstraint)1 LambdaConstraint (org.drools.modelcompiler.constraints.LambdaConstraint)1 UnificationConstraint (org.drools.modelcompiler.constraints.UnificationConstraint)1 TypeDeclarationUtil.createTypeDeclaration (org.drools.modelcompiler.util.TypeDeclarationUtil.createTypeDeclaration)1