Package org.drools.rule.constraint

Examples of org.drools.rule.constraint.MvelConstraint


            }

            String mvelExpr = normalizeMVELLiteralExpression(vtype, field, expression, leftValue, operator, rightValue, restrictionDescr);
            boolean isIndexable = operator.equals("==");
            MVELCompilationUnit compilationUnit = buildCompilationUnit(context, pattern, mvelExpr);
            return new MvelConstraint(context.getPkg().getName(), mvelExpr, compilationUnit, isIndexable, field, extractor);
        } else {
            LiteralRestriction restriction = buildLiteralRestriction(context, extractor, restrictionDescr, field, vtype);
            return restriction != null ? new LiteralConstraint(extractor, restriction) : null;
        }
    }
View Full Code Here


            boolean isUnification = restriction instanceof UnificationRestriction;
            if (isUnification) {
                expression = resolveUnificationAmbiguity(expression, declarations, leftValue, rightValue, restriction);
            }
            boolean isIndexable = operator.equals("==");
            return new MvelConstraint(context.getPkg().getName(), expression, isIndexable, declarations, getIndexingDeclaration(restriction), extractor, isUnification);
        } else {
            return new VariableConstraint(extractor, restriction);
        }
    }
View Full Code Here

                Evaluator evaluator = buildLiteralEvaluator(context, extractor, restrictionDescr, field, vtype);
                return new EvaluatorConstraint(field, evaluator, extractor);
            }

            String mvelExpr = normalizeMVELLiteralExpression(vtype, field, expression, leftValue, operator, rightValue, restrictionDescr);
            return new MvelConstraint(context.getPkg().getName(), mvelExpr);
        } else {
            LiteralRestriction restriction = buildLiteralRestriction(context, extractor, restrictionDescr, field, vtype);
            return restriction != null ? new LiteralConstraint(extractor, restriction) : null;
        }
    }
View Full Code Here

        }

        String expression = expressionBuilder.toString();
        MVELCompilationUnit compilationUnit = buildCompilationUnit(context, pattern, expression);

        MvelConstraint combinedConstraint = new MvelConstraint(packageName, expression,
                                                               declarations.toArray(new Declaration[declarations.size()]),
                                                               compilationUnit, false, null, null, false);

        pattern.addConstraint(combinedConstraint);
    }
View Full Code Here

            boolean isDynamic = requiredOperators.length > 0 ||
                    ClassObjectType.Activation_ObjectType.isAssignableFrom( pattern.getObjectType()) ||
                    !context.getPackageBuilder().getTypeDeclaration(((ClassObjectType)pattern.getObjectType()).getClassType()).isTypesafe();

            Constraint constraint = new MvelConstraint(context.getPkg().getName(), expr, mvelDeclarations, compilationUnit, isDynamic);
            pattern.addConstraint( constraint );
        }
    }
View Full Code Here

        }

        String expression = expressionBuilder.toString();
        MVELCompilationUnit compilationUnit = buildCompilationUnit(context, pattern, expression);

        MvelConstraint combinedConstraint = new MvelConstraint(packageName, expression,
                                                               declarations.toArray(new Declaration[declarations.size()]),
                                                               compilationUnit, false, null, null, false);

        pattern.addConstraint(combinedConstraint);
    }
View Full Code Here

            boolean isDynamic = requiredOperators.length > 0 ||
                    ClassObjectType.Activation_ObjectType.isAssignableFrom( pattern.getObjectType()) ||
                    (!((ClassObjectType)pattern.getObjectType()).getClassType().isArray() &&
                    !context.getPackageBuilder().getTypeDeclaration(((ClassObjectType)pattern.getObjectType()).getClassType()).isTypesafe());

            Constraint constraint = new MvelConstraint(context.getPkg().getName(), expr, mvelDeclarations, compilationUnit, isDynamic);
            pattern.addConstraint( constraint );
        }
    }
View Full Code Here

            if (isUnification) {
                expression = resolveUnificationAmbiguity(expression, declarations, leftValue, rightValue);
            }
            boolean isIndexable = operator.equals("==");
            MVELCompilationUnit compilationUnit = isUnification ? null : buildCompilationUnit(context, pattern, expression);
            return new MvelConstraint(context.getPkg().getName(), expression, declarations, compilationUnit, isIndexable, getIndexingDeclaration(restriction), extractor, isUnification);
        } else {
            return new VariableConstraint(extractor, restriction);
        }
    }
View Full Code Here

            }

            String mvelExpr = normalizeMVELLiteralExpression(vtype, field, expression, leftValue, operator, rightValue, restrictionDescr);
            boolean isIndexable = operator.equals("==");
            MVELCompilationUnit compilationUnit = buildCompilationUnit(context, pattern, mvelExpr);
            return new MvelConstraint(context.getPkg().getName(), mvelExpr, compilationUnit, isIndexable, field, extractor);
        } else {
            LiteralRestriction restriction = buildLiteralRestriction(context, extractor, restrictionDescr, field, vtype);
            return restriction != null ? new LiteralConstraint(extractor, restriction) : null;
        }
    }
View Full Code Here

        if (isUnification) {
            expression = resolveUnificationAmbiguity(expression, declarations, leftValue, rightValue);
        }
        IndexUtil.ConstraintType constraintType = IndexUtil.ConstraintType.decode(operatorDescr.getOperator());
        MVELCompilationUnit compilationUnit = isUnification ? null : buildCompilationUnit(context, pattern, expression);
        return new MvelConstraint(context.getPkg().getName(), expression, declarations, compilationUnit, constraintType, requiredDeclaration, extractor, isUnification);
    }
View Full Code Here

TOP

Related Classes of org.drools.rule.constraint.MvelConstraint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.