Package org.drools.rule

Examples of org.drools.rule.VariableRestriction$CharVariableContextEntry


       
        Pattern a = new Pattern( 0, ot, "$a" );
        Pattern b = new Pattern( 1, ot, "$b" );
        b.addConstraint( new VariableConstraint(
                         new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                         new VariableRestriction( null, a.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                AfterEvaluatorDefinition.AFTER,
                                                                                                "-2,2" ) ) ) );
        Pattern c = new Pattern( 2, ot, "$c" );
        c.addConstraint( new VariableConstraint(
                                                new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                                                new VariableRestriction( null, a.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                                       AfterEvaluatorDefinition.AFTER,
                                                                                                                       "-3,4" ) ) ) );
        Pattern d = new Pattern( 3, ot, "$d" );
        d.addConstraint( new VariableConstraint(
                                                new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                                                new VariableRestriction( null, b.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                                       AfterEvaluatorDefinition.AFTER,
                                                                                                                       "1,2" ) ) ) );
        d.addConstraint( new VariableConstraint(
                                                new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                                                new VariableRestriction( null, c.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                                       AfterEvaluatorDefinition.AFTER,
                                                                                                                       "2,3" ) ) ) );
        Pattern e = new Pattern( 4, ot, "$e" );
        e.addConstraint( new VariableConstraint(
                                                new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                                                new VariableRestriction( null, d.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                                       AfterEvaluatorDefinition.AFTER,
                                                                                                                       "1,10" ) ) ) );

        GroupElement not = new GroupElement( Type.NOT );
        not.addChild( e );
View Full Code Here


       
        Pattern a = new Pattern( 0, ot, "$a" );
        Pattern b = new Pattern( 1, ot, "$b" );
        b.addConstraint( new VariableConstraint(
                         new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                         new VariableRestriction( null, a.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                AfterEvaluatorDefinition.AFTER,
                                                                                                "-2,2" ) ) ) );
        Pattern c = new Pattern( 2, ot, "$c" );
        c.addConstraint( new VariableConstraint(
                                                new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                                                new VariableRestriction( null, a.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                                       AfterEvaluatorDefinition.AFTER,
                                                                                                                       "-3,4" ) ) ) );
        Pattern d = new Pattern( 3, ot, "$d" );
        d.addConstraint( new VariableConstraint(
                                                new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                                                new VariableRestriction( null, b.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                                       AfterEvaluatorDefinition.AFTER,
                                                                                                                       "1,2" ) ) ) );
        d.addConstraint( new VariableConstraint(
                                                new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                                                new VariableRestriction( null, c.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                                       AfterEvaluatorDefinition.AFTER,
                                                                                                                       "2,3" ) ) ) );
        Pattern e = new Pattern( 4, ot, "$e" );
        e.addConstraint( new VariableConstraint(
                                                new SelfReferenceClassFieldReader( StockTick.class, "this" ),
                                                new VariableRestriction( null, d.getDeclaration(), evals.getEvaluator( ValueType.OBJECT_TYPE,
                                                                                                                       AfterEvaluatorDefinition.AFTER,
                                                                                                                       "1,10" ) ) ) );

        GroupElement not = new GroupElement( Type.NOT );
        not.addChild( e );
View Full Code Here

                                                                getClass().getClassLoader() );

        Evaluator evaluator = getEvaluator( clazz,
                                            ":=".equals( evaluatorString ) ? Operator.EQUAL.getOperatorString() : evaluatorString );
       
        Restriction vr = new VariableRestriction( extractor, declaration, evaluator );               

        if ":=".equals( evaluatorString ) ) {
            vr = new UnificationRestriction( (VariableRestrictionvr );
        }
View Full Code Here

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

            restriction = new VariableRestriction( extractor,
                                                   declr,
                                                   evaluator );

            if ( declr.getPattern().getObjectType().equals( new ClassObjectType( DroolsQuery.class ) ) && Operator.EQUAL.getOperatorString().equals( operator ) ) {
                // declaration is query argument, so allow for unification.
View Full Code Here

                                                  right );
        if ( evaluator == null ) {
            return null;
        }
       
        Restriction restriction = new VariableRestriction( extractor,
                                                           declaration,
                                                           evaluator );
       
        if ( declaration.getPattern().getObjectType().equals( new ClassObjectType( DroolsQuery.class ) ) )  {
            // declaration is query argument, so allow for unification.
View Full Code Here

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

                return new VariableRestriction( extractor,
                                                implicit,
                                                evaluator );
            }
        }
View Full Code Here

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

                restriction = new VariableRestriction( extractor,
                                                       declr,
                                                       evaluator );
               
                if ( declr.getPattern().getObjectType().equals( new ClassObjectType( DroolsQuery.class ) ) && Operator.EQUAL.getOperatorString().equals( operator ) ) {
                    // declaration is query argument, so allow for unification.
View Full Code Here

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

                restriction = new VariableRestriction( extractor,
                                                       declr,
                                                       evaluator );

                if ( declr.getPattern().getObjectType().equals( new ClassObjectType( DroolsQuery.class ) ) ) {
                    // declaration is query argument, so allow for unification.
View Full Code Here

                                                  right );
        if ( evaluator == null ) {
            return null;
        }
       
        Restriction restriction = new VariableRestriction( extractor,
                                                           declaration,
                                                           evaluator );

        // TODO: FIXME: Implement proper support for Unifications
//        if ( declaration.getPattern().getObjectType().equals( new ClassObjectType( DroolsQuery.class ) ) )  {
View Full Code Here

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

                return new VariableRestriction( extractor,
                                                implicit,
                                                evaluator );
            }
        }
View Full Code Here

TOP

Related Classes of org.drools.rule.VariableRestriction$CharVariableContextEntry

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.