Package org.drools.reteoo

Examples of org.drools.reteoo.RuleTerminalNode$RTNCleanupAdapter


        assertEquals( "Rule must have a single terminal node",
                             1,
                             terminals.size() );

        final RuleTerminalNode terminal = (RuleTerminalNode) terminals.get( 0 );

    }
View Full Code Here


                                                new PropagationContextImpl( 1,
                                                                            1,
                                                                            null,
                                                                            tuple,
                                                                            null ),
                                                new RuleTerminalNode(0, null, context.getRule(), subrule, new BuildContext( (InternalRuleBase) ruleBase, null ))  );
        final DefaultKnowledgeHelper kbHelper = new DefaultKnowledgeHelper( wm );
        kbHelper.setActivation( item );
        ((MVELConsequence) context.getRule().getConsequence()).compile(  (MVELDialectRuntimeData) pkgBuilder.getPackageRegistry( pkg.getName() ).getDialectRuntimeRegistry().getDialectData( "mvel" ));
        context.getRule().getConsequence().evaluate( kbHelper,
                                                     wm );
View Full Code Here

                leftTupleSource = (LeftTupleSource) context.get( leftInput );
            }

            Rule rule = new Rule( name );

            final RuleTerminalNode rtn = new RuleTerminalNode( buildContext.getNextId(),
                                                               leftTupleSource,
                                                               rule,
                                                               null,
                                                               0,
                                                               buildContext );
            Consequence consequence = new Consequence() {
                public void evaluate(KnowledgeHelper knowledgeHelper,
                                     WorkingMemory workingMemory) throws Exception {

                }
               
                public String getName() {
                    return "default";
                }
            };

            rule.setConsequence( consequence );

            rtn.attach();
            context.put( name,
                         rtn );

        } else {
            throw new IllegalArgumentException( "Cannot arguments " + args );
View Full Code Here

        final HashMap map = new HashMap();
        workingMemory.setGlobal( "map",
                                 map );

        final LeftTuple tuple = new MockTuple( new HashMap() );
        tuple.setLeftTupleSink( new RuleTerminalNode(1, null, rule,rule.getLhs(), new BuildContext(ruleBase, null) )  );       
        final Activation activation = new MockActivation( rule,
                                                          0,
                                                          rule.getLhs(),
                                                          tuple );
View Full Code Here

        workingMemory.setGlobal( "map",
                                 map );

        final LeftTuple tuple = new MockTuple( new HashMap() );
        tuple.setLeftTupleSink( new RuleTerminalNode(1, null, newRule,newRule.getLhs(), new BuildContext(ruleBase, null) )  );
        final Activation activation = new MockActivation( newRule,
                                                          0,
                                                          newRule.getLhs(),
                                                          tuple );
View Full Code Here

               
                stream.readShort(); // Persistence.END
                break;
            }
            case NodeTypeEnums.RuleTerminalNode : {
                RuleTerminalNode ruleTerminalNode = (RuleTerminalNode) sink;
                TerminalNodeMemory memory = (TerminalNodeMemory) wm.getNodeMemory( ruleTerminalNode );
                memory.getTupleMemory().add( parentLeftTuple );

                int pos = context.terminalTupleMap.size();
                context.terminalTupleMap.put( pos,
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();
        GroupElement subRule = ruleTerminalNode.getSubRule();

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

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

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

                       subrule );

        TerminalNode terminal = null;

        if ( !(rule instanceof Query) ) {
            terminal = new RuleTerminalNode( context.getNextId(),
                                             context.getTupleSource(),
                                             rule,
                                             subrule,
                                             context );
        } else {
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

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.