Package org.drools.verifier.components

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


        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

     */
    @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

     */
    @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

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

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

        PatternSolver solver = new PatternSolver( pattern );

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

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

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

        PatternSolver solver = new PatternSolver( pattern );

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

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

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

        PatternSolver solver = new PatternSolver( pattern );

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

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

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

        PatternSolver solver = new PatternSolver( pattern );

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

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

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

        PatternSolver solver = new PatternSolver( pattern );

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

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

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

        PatternSolver solver = new PatternSolver( pattern );

        solver.addOperator( OperatorDescrType.AND );
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.