Package org.drools.verifier.components

Examples of org.drools.verifier.components.LiteralRestriction


        Pattern pattern2 = VerifierComponentMockFactory.createPattern2();

        /*
         * Working pair
         */
        LiteralRestriction r1 = LiteralRestriction.createRestriction( pattern1,
                                                                      "10" );
        r1.setOperator( Operator.GREATER );
        r1.setFieldPath( "0" );
        r1.setOrderNumber( 0 );

        LiteralRestriction r2 = LiteralRestriction.createRestriction( pattern1,
                                                                      "10" );
        r2.setOperator( Operator.LESS );
        r2.setFieldPath( "0" );
        r2.setOrderNumber( 1 );

        /*
         * Pair that doesn't work.
         */
        LiteralRestriction r3 = LiteralRestriction.createRestriction( pattern2,
                                                                      "1" );
        r3.setOperator( Operator.GREATER_OR_EQUAL );
        r3.setFieldPath( "1" );
        r3.setOrderNumber( 0 );

        LiteralRestriction r4 = LiteralRestriction.createRestriction( pattern2,
                                                                      "" );
        r4.setOperator( Operator.EQUAL );
        r4.setFieldPath( "1" );
        r4.setOrderNumber( 1 );

        data.add( r1 );
        data.add( r2 );
        data.add( r3 );
        data.add( r4 );
View Full Code Here


            createRestriction(currentOrderNumber, value, operator);
        }
    }

    private void createRestriction(int currentOrderNumber, String value, Operator operator) {
        LiteralRestriction restriction = LiteralRestriction.createRestriction(pattern, value);
        restriction.setFieldPath(field.getPath());
        restriction.setPatternIsNot(pattern.isPatternNot());
        restriction.setParentPath(pattern.getPath());
        restriction.setParentType(pattern.getVerifierComponentType());
        restriction.setOrderNumber(currentOrderNumber);
        restriction.setOperator(operator);
        field.setFieldType(restriction.getValueType());
        data.add(restriction);
        solvers.addPatternComponent(restriction);
    }
View Full Code Here

TOP

Related Classes of org.drools.verifier.components.LiteralRestriction

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.