Package org.drools.reteoo

Examples of org.drools.reteoo.RuleMemory


        InternalWorkingMemory iwm = (InternalWorkingMemory) wm;
        Map<Rule, BaseNode[]> map = ((InternalRuleBase) iwm.getRuleBase()).getReteooBuilder().getTerminalNodes();
        for ( BaseNode[] nodes : map.values() ) {
            for ( BaseNode node : nodes ) {
                RuleTerminalNode rtn = (RuleTerminalNode) node;
                RuleMemory rs = (RuleMemory) iwm.getNodeMemory( rtn );
                RuleNetworkEvaluatorActivation item = rs.getAgendaItem();
                if ( item != null ) {
                    item.dequeue();
                    int count = item.evaluateNetwork(iwm);
                    if ( count > 0 ) {
                        ((InternalAgenda) iwm.getAgenda()).addActivation( item );
View Full Code Here


              // Only add the RIANode, if the LeftTupleSource is part of the RIANode subnetwork.
              if ( inSubNetwork( (RightInputAdapterNode)sink, originalLt ) ) {             
                  smem.getRuleMemories().add( memory.getRuleSegments() );
              }
          } else if ( NodeTypeEnums.isTerminalNode( sink) ) {
              RuleMemory rmem = ( RuleMemory ) smem.createNodeMemory( (MemoryFactory) sink, wm  );
                smem.getRuleMemories().add( rmem );
                rmem.getSegmentMemories()[smem.getPos()] = smem;
             
          }
        }
    }
View Full Code Here

                    if ( firstSink.getType() == NodeTypeEnums.RightInputAdaterNode) {
                        RiaNodeMemory memory = ( RiaNodeMemory) wm.getNodeMemory( (MemoryFactory) firstSink );
                        smem.getNodeMemories().add( memory.getRiaRuleMemory() );                       
                        memory.getRiaRuleMemory().setSegmentMemory( smem );
                    } else if ( NodeTypeEnums.isTerminalNode( firstSink) ) {            
                        RuleMemory rmem = ( RuleMemory ) wm.getNodeMemory( (MemoryFactory) firstSink );
                        smem.getNodeMemories().add( rmem );
                        rmem.setSegmentMemory( smem );
                    }                   
                    smem.setTipNode( firstSink );
                    break;
                }
            } else if ( sink.size() == 2 &&
View Full Code Here

                }
            } else {
                // RTNS and RiaNode's have their own segment, if they are the child of a split.
                if ( memory.getSegmentMemory() == null ) {
                    SegmentMemory childSmem = new SegmentMemory(sink);
                    RuleMemory rmem;
                    if ( NodeTypeEnums.isTerminalNode( sink  ) ) {
                        rmem = ( RuleMemory ) memory;
                    } else {
                        rmem =  ((RiaNodeMemory) memory ).getRiaRuleMemory();
                    }
                    rmem.getSegmentMemories()[ rmem.getSegmentMemories().length -1 ] = childSmem;
                    rmem.setSegmentMemory( childSmem );
                   
                    childSmem.setTipNode( sink );
                    childSmem.setSinkFactory( sink );                   
                }               
            }
View Full Code Here

              updateRiaAndTerminalMemory(++pos, ( LeftTupleSource ) sink, originalLt, smem, wm);
          } else if ( sink.getType() == NodeTypeEnums.RightInputAdaterNode) {     
              // Only add the RIANode, if the LeftTupleSource is part of the RIANode subnetwork.
              if ( inSubNetwork( (RightInputAdapterNode)sink, originalLt ) ) {
                  RiaNodeMemory riaMem = ( RiaNodeMemory) wm.getNodeMemory( (MemoryFactory) sink );
                  RuleMemory rmem = ( RuleMemory ) riaMem.getRiaRuleMemory();
                    smem.getRuleMemories().add( rmem );
                    rmem.getSegmentMemories()[smem.getPos()] = smem;
              }
          } else if ( NodeTypeEnums.isTerminalNode( sink) ) {             
              RuleMemory rmem = ( RuleMemory ) wm.getNodeMemory( (MemoryFactory) sink );
                smem.getRuleMemories().add( rmem );
                rmem.getSegmentMemories()[smem.getPos()] = smem;
             
          }
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.reteoo.RuleMemory

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.