Package org.drools.reteoo

Examples of org.drools.reteoo.RuleTerminalNode$RTNCleanupAdapter


        String pkgName = stream.readUTF();
        String ruleName = stream.readUTF();
        Package pkg = ruleBase.getPackage( pkgName );
        Rule rule = pkg.getRule( ruleName );

        RuleTerminalNode ruleTerminalNode = (RuleTerminalNode) leftTuple.getLeftTupleSink();
        GroupElement subRule = ruleTerminalNode.getSubRule();

        PropagationContext pc = context.propagationContexts.get( stream.readLong() );

        AgendaItem activation = new AgendaItem( activationNumber,
                                                leftTuple,
View Full Code Here


        String pkgName = stream.readUTF();
        String ruleName = stream.readUTF();
        Package pkg = ruleBase.getPackage( pkgName );
        Rule rule = pkg.getRule( ruleName );

        RuleTerminalNode ruleTerminalNode = (RuleTerminalNode) leftTuple.getLeftTupleSink();

        PropagationContext pc = context.propagationContexts.get( stream.readLong() );

        AgendaItem activation;
View Full Code Here

        BuildContext buildContext = new BuildContext((InternalRuleBase) knowledgeBase.getRuleBase(), ((ReteooRuleBase) knowledgeBase.getRuleBase())
                .getReteooBuilder().getIdGenerator());
        //simple rule that fires after 10 seconds
        final Rule rule = new Rule("test-rule");
        new RuleTerminalNode(1,new MockTupleSource(2), rule, rule.getLhs(), 0, buildContext);
       
        final List<String> fired = new ArrayList<String>();
       
        rule.setConsequence( new Consequence() {
            public void evaluate(KnowledgeHelper knowledgeHelper,
View Full Code Here

                                                                                      org.drools.rule.Rule rule,
                                                                                      GroupElement subrule,
                                                                                      int subruleIndex,
                                                                                      BuildContext context,
                                                                                      Object... args ) {
                                            return new RuleTerminalNode( id,
                                                                         source,
                                                                         rule,
                                                                         subrule,
                                                                         0,
                                                                         context ) {
View Full Code Here

        ObjectTypeNode otn = getObjectTypeNode(kbase, "InitialFactImpl" );
        assertNotNull( otn );

        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otn.getSinkPropagator().getSinks()[0];
       
        RuleTerminalNode rtNode = ( RuleTerminalNode ) liaNode.getSinkPropagator().getSinks()[0];
        assertEquals( Long.MAX_VALUE, rtNode.getDeclaredMask() );
        assertEquals( Long.MAX_VALUE, rtNode.getInferredMask() );
    }  
View Full Code Here

        ObjectTypeNode otn = getObjectTypeNode(kbase, "Person" );
        assertNotNull( otn );

        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otn.getSinkPropagator().getSinks()[0];
       
        RuleTerminalNode rtNode = ( RuleTerminalNode ) liaNode.getSinkPropagator().getSinks()[0];
        assertEquals( Long.MAX_VALUE, rtNode.getDeclaredMask() );
        assertEquals( Long.MAX_VALUE, rtNode.getInferredMask() );
    }  
View Full Code Here

        assertEquals( Long.MAX_VALUE, alphaNode.getInferredMask() );       
       
       
        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) alphaNode.getSinkPropagator().getSinks()[0];
       
        RuleTerminalNode rtNode = ( RuleTerminalNode ) liaNode.getSinkPropagator().getSinks()[0];
        assertEquals( Long.MAX_VALUE, rtNode.getDeclaredMask() );
        assertEquals( Long.MAX_VALUE, rtNode.getInferredMask() );
   
View Full Code Here

        ObjectTypeNode otn = getObjectTypeNode(kbase, "A" );
        assertNotNull( otn );

        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otn.getSinkPropagator().getSinks()[0];
       
        RuleTerminalNode rtNode = ( RuleTerminalNode ) liaNode.getSinkPropagator().getSinks()[0];
        assertEquals( 0, rtNode.getDeclaredMask() );
        assertEquals( 0, rtNode.getInferredMask() );
    }  
View Full Code Here

        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otn.getSinkPropagator().getSinks()[0];
       
        List<String> sp = getSettableProperties(wm, otn);
       
        RuleTerminalNode rtNode = ( RuleTerminalNode ) liaNode.getSinkPropagator().getSinks()[0];
        assertEqualscalculatePositiveMask(list("a"), sp), rtNode.getDeclaredMask() );
        assertEqualscalculatePositiveMask(list("a"), sp), rtNode.getInferredMask() );       
    }      
View Full Code Here

        assertEquals( calculatePositiveMask(list("a"), sp), alphaNode.getDeclaredMask( ) );
        assertEquals( calculatePositiveMask(list("a"), sp), alphaNode.getInferredMask());
       
        LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) alphaNode.getSinkPropagator().getSinks()[0];       
       
        RuleTerminalNode rtNode = ( RuleTerminalNode ) liaNode.getSinkPropagator().getSinks()[0];
        assertEquals0, rtNode.getDeclaredMask() ); // rtn declares nothing
        assertEqualscalculatePositiveMask(list("a"), sp), rtNode.getInferredMask() ); // rtn infers from alpha
   
View Full Code Here

TOP

Related Classes of org.drools.reteoo.RuleTerminalNode$RTNCleanupAdapter

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.