Package org.drools.rule

Examples of org.drools.rule.Rule.addCondition()


            public String toString()
            {
                return "f1.getValue() != -1";
            }
        };
        calculateRule.addCondition( conditionCalculateC );

        // <java:condition>f2.getValue() != -1</java:condition>
        final Condition conditionCalculateD = new Condition( )
        {
            public boolean isAllowed(Tuple tuple)
View Full Code Here


            public String toString()
            {
                return "f2.getValue() != -1";
            }
        };
        calculateRule.addCondition( conditionCalculateD );

        // <java:condition>f3.getValue() == -1</java:condition>
        final Condition conditionCalculateE = new Condition( )
        {
            public boolean isAllowed(Tuple tuple)
View Full Code Here

            public String toString()
            {
                return "f3.getValue() == -1";
            }
        };
        calculateRule.addCondition( conditionCalculateE );

        // <java:consequence>
        // f3.setValue( f1.getValue() + f2.getValue() );
        // System.err.println( f3.getSequence() + " == " + f3.getValue() );
        // drools.modifyObject( f3 );
View Full Code Here

        Rule rule = new Rule( "test-rule 1" );
        Declaration paramDecl = rule.addParameterDeclaration( "paramVar", new MockObjectType( true ) );
        //add consequence
        rule.setConsequence( new org.drools.spi.InstrumentedConsequence( ) );
        //add condition
        rule.addCondition( new org.drools.spi.InstrumentedCondition( ) );

        RuleBase ruleBase = new RuleBaseImpl( new Rete( ) );

        ParameterNode node = new ParameterNode( null, paramDecl );
View Full Code Here

        Rule rule = new Rule( "test-rule 1" );
        Declaration paramDecl = rule.addParameterDeclaration( "paramVar", new MockObjectType( true ) );
        //add consequence
        rule.setConsequence( new org.drools.spi.InstrumentedConsequence() );
        //add condition
        rule.addCondition( new org.drools.spi.InstrumentedCondition() );

        ParameterNode node = new ParameterNode( null, paramDecl );

        Set decls = node.getTupleDeclarations( );
View Full Code Here

        c2.addDeclaration( stringDecl2 );
        c2.isAllowed( true );
        InstrumentedCondition c3 = new InstrumentedCondition( );
        c3.addDeclaration( intDecl );
        c3.isAllowed( true );
        rule.addCondition( c1 );
        rule.addCondition( c2 );
        rule.addCondition( c3 );

        // rule.addCondition( new org.drools.spi.InstrumentedCondition( ) );
        ruleSet.addRule( rule );
View Full Code Here

        c2.isAllowed( true );
        InstrumentedCondition c3 = new InstrumentedCondition( );
        c3.addDeclaration( intDecl );
        c3.isAllowed( true );
        rule.addCondition( c1 );
        rule.addCondition( c2 );
        rule.addCondition( c3 );

        // rule.addCondition( new org.drools.spi.InstrumentedCondition( ) );
        ruleSet.addRule( rule );
        Builder builder = new Builder( );
View Full Code Here

        InstrumentedCondition c3 = new InstrumentedCondition( );
        c3.addDeclaration( intDecl );
        c3.isAllowed( true );
        rule.addCondition( c1 );
        rule.addCondition( c2 );
        rule.addCondition( c3 );

        // rule.addCondition( new org.drools.spi.InstrumentedCondition( ) );
        ruleSet.addRule( rule );
        Builder builder = new Builder( );
        builder.addRuleSet( ruleSet );
View Full Code Here

            public String toString()
            {
                return "context.isState(\"start\")";
            }
        };
        findFirstSeatRule.addCondition( conditionA1 );

        // Build and Add the Consequence to the Rule
        // <java:consequence>
        // System.out.println("FIRE: find first seat: " + guest);
        // import org.drools.examples.manners.model.Seating;
View Full Code Here

            public String toString()
            {
                return "context.isState(\"find_seating\")";
            }
        };
        findSeatingRule.addCondition( conditionB1 );

        // <java:condition>seating.getGuest2() == null</java:condition>
        final Condition conditionB2 = new Condition( )
        {
            public boolean isAllowed(Tuple tuple)
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.