Examples of LiteralRestriction


Examples of org.drools.rule.LiteralRestriction

                                                  right );
        if ( evaluator == null ) {
            return null;
        }

        return new LiteralRestriction( field,
                                       evaluator,
                                       extractor );
    }
View Full Code Here

Examples of org.drools.rule.LiteralRestriction

                                                  right );
        if ( evaluator == null ) {
            return null;
        }

        return new LiteralRestriction( field,
                                       evaluator,
                                       extractor );
    }
View Full Code Here

Examples of org.drools.rule.LiteralRestriction

            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

Examples of org.drools.rule.LiteralRestriction

                                                              InternalReadAccessor extractor,
                                                              LiteralRestrictionDescr literalRestrictionDescr,
                                                              FieldValue field,
                                                              ValueType vtype) {
        Evaluator evaluator = buildLiteralEvaluator(context, extractor, literalRestrictionDescr, vtype);
        return evaluator == null ? null : new LiteralRestriction(field, evaluator, extractor);
    }
View Full Code Here

Examples of org.drools.rule.LiteralRestriction

                                                  right );
        if ( evaluator == null ) {
            return null;
        }

        return new LiteralRestriction( field,
                                       evaluator,
                                       extractor );
    }
View Full Code Here

Examples of org.drools.rule.LiteralRestriction

            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

Examples of org.drools.verifier.components.LiteralRestriction

     *
     * @param descr
     */
    private void visit(LiteralRestrictionDescr descr) {

        LiteralRestriction restriction = LiteralRestriction.createRestriction( pattern,
                                                                               descr.getText() );

        restriction.setPatternIsNot( pattern.isPatternNot() );
        restriction.setConstraintPath( constraint.getPath() );
        restriction.setFieldPath( constraint.getFieldPath() );
        restriction.setOperator( Operator.determineOperator( descr.getEvaluator(),
                                                             descr.isNegated() ) );
        restriction.setOrderNumber( orderNumber );
        restriction.setParentPath( pattern.getPath() );
        restriction.setParentType( pattern.getVerifierComponentType() );

        // Set field value, if it is unset.
        field.setFieldType( restriction.getValueType() );

        data.add( restriction );
        solvers.addPatternComponent( restriction );
    }
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

        session.setAgendaFilter( new RuleNameMatchesAgendaFilter( "Find redundant restrictions from pattern possibilities" ) );

        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        Collection<Object> objects = new ArrayList<Object>();
        LiteralRestriction left = LiteralRestriction.createRestriction( pattern,
                                                                        "" );

        LiteralRestriction right = LiteralRestriction.createRestriction( pattern,
                                                                         "" );

        Redundancy redundancy = new Redundancy( left,
                                                right );
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

     */
    @Test
    public void testAddBasicAnd() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );

        PatternSolver solver = new PatternSolver( pattern );

        solver.addOperator( OperatorDescrType.AND );
View Full Code Here

Examples of org.drools.verifier.components.LiteralRestriction

     */
    @Test
    public void testAddBasicOr() {
        Pattern pattern = VerifierComponentMockFactory.createPattern1();

        LiteralRestriction literalRestriction = LiteralRestriction.createRestriction( pattern,
                                                                                      "" );
        LiteralRestriction literalRestriction2 = LiteralRestriction.createRestriction( pattern,
                                                                                       "" );

        PatternSolver solver = new PatternSolver( pattern );

        solver.addOperator( OperatorDescrType.OR );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.