Package org.drools.reteoo.FromNode

Examples of org.drools.reteoo.FromNode.FromMemory


                break;
            }
            case NodeTypeEnums.FromNode : {
                //context.out.println( ".... FromNode" );
                // FNs generate new fact handles on-demand to wrap objects and need special procedures when serializing to persistent storage
                FromMemory memory = (FromMemory) context.wm.getNodeMemory( (MemoryFactory) sink );

                Map<Object, RightTuple> matches = (Map<Object, RightTuple>) leftTuple.getObject();
                for ( RightTuple rightTuples : matches.values() ) {
                    // first we serialize the generated fact handle ID
                    stream.writeShort( PersisterEnums.FACT_HANDLE );
View Full Code Here


                break;
            }
            case NodeTypeEnums.FromNode: {
              //context.out.println( ".... FromNode" );
              // FNs generate new fact handles on-demand to wrap objects and need special procedures when serializing to persistent storage
              FromMemory memory = (FromMemory) context.wm.getNodeMemory( (NodeMemory) sink );

              Map<Object, RightTuple> matches = (Map<Object, RightTuple>) memory.betaMemory.getCreatedHandles().get( leftTuple );
              for ( RightTuple rightTuples : matches.values() ) {
                  // first we serialize the generated fact handle ID
                  stream.writeShort( PersisterEnums.FACT_HANDLE );
View Full Code Here

                break;
            }
            case NodeTypeEnums.FromNode: {
//              context.out.println( "FromNode" );
                // FNs generate new fact handles on-demand to wrap objects and need special procedures when serializing to persistent storage
                FromMemory memory = (FromMemory) context.wm.getNodeMemory( (NodeMemory) sink );
               
                memory.betaMemory.getLeftTupleMemory().add( parentLeftTuple );
                Map<Object, RightTuple> matches =  new LinkedHashMap<Object, RightTuple>();
                memory.betaMemory.getCreatedHandles().put( parentLeftTuple, matches );
               
View Full Code Here

                break;
            }
            case NodeTypeEnums.FromNode: {
              //context.out.println( ".... FromNode" );
              // FNs generate new fact handles on-demand to wrap objects and need special procedures when serializing to persistent storage
              FromMemory memory = (FromMemory) context.wm.getNodeMemory( (NodeMemory) sink );

              Map<Object, RightTuple> matches = (Map<Object, RightTuple>) memory.betaMemory.getCreatedHandles().get( leftTuple );
              for ( RightTuple rightTuples : matches.values() ) {
                  // first we serialize the generated fact handle ID
                  stream.writeShort( PersisterEnums.FACT_HANDLE );
View Full Code Here

        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        ReteooWorkingMemoryInterface wm = ((StatefulKnowledgeSessionImpl) ksession).session;
        AccumulateMemory accMemory = (AccumulateMemory) wm.getNodeMemory( accNode );
        BetaMemory existsMemory = (BetaMemory) wm.getNodeMemory( existsNode );
        FromMemory fromMemory = (FromMemory) wm.getNodeMemory( fromNode );
        BetaMemory notMemory = (BetaMemory) wm.getNodeMemory( notNode );

        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
        ksession.setGlobal( "list",
                            list );
View Full Code Here

                break;
            }
            case NodeTypeEnums.FromNode: {
                //              context.out.println( "FromNode" );
                // FNs generate new fact handles on-demand to wrap objects and need special procedures when serializing to persistent storage
                FromMemory memory = (FromMemory) context.wm.getNodeMemory( (NodeMemory) sink );

                memory.betaMemory.getLeftTupleMemory().add( parentLeftTuple );
                Map<Object, RightTuple> matches = new LinkedHashMap<Object, RightTuple>();
                parentLeftTuple.setObject( matches );
View Full Code Here

                break;
            }
            case NodeTypeEnums.FromNode : {
                //context.out.println( ".... FromNode" );
                // FNs generate new fact handles on-demand to wrap objects and need special procedures when serializing to persistent storage
                FromMemory memory = (FromMemory) context.wm.getNodeMemory( (NodeMemory) sink );

                Map<Object, RightTuple> matches = (Map<Object, RightTuple>) leftTuple.getObject();
                for ( RightTuple rightTuples : matches.values() ) {
                    // first we serialize the generated fact handle ID
                    stream.writeShort( PersisterEnums.FACT_HANDLE );
View Full Code Here

    protected void doVisit(NetworkNode node,
                           Stack<NetworkNode> nodeStack,
                           StatefulKnowledgeSessionInfo info) {
        FromNode fn = (FromNode) node;
        DefaultNodeInfo ni = (DefaultNodeInfo) info.getNodeInfo( node );
        final FromMemory memory = (FromMemory) info.getSession().getNodeMemory( fn );
       
        ni.setMemoryEnabled( true );
       
        if( fn.isLeftTupleMemoryEnabled() ) {
            ni.setTupleMemorySize( memory.betaMemory.getLeftTupleMemory().size() );
View Full Code Here

                break;
            }
            case NodeTypeEnums.FromNode: {
//              context.out.println( "FromNode" );
                // FNs generate new fact handles on-demand to wrap objects and need special procedures when serializing to persistent storage
                FromMemory memory = (FromMemory) context.wm.getNodeMemory( (NodeMemory) sink );
               
                memory.betaMemory.getLeftTupleMemory().add( parentLeftTuple );               
                Map<Object, RightTuple> matches =  new LinkedHashMap<Object, RightTuple>();
                memory.betaMemory.getCreatedHandles().put( parentLeftTuple, matches );
               
View Full Code Here

                              workingMemory );

        assertEquals( 2,
                      asserted.size() );

        final FromMemory memory = (FromMemory) workingMemory.getNodeMemory( from );
        assertEquals( 1,
                      memory.betaMemory.getLeftTupleMemory().size() );
        assertNull( memory.betaMemory.getRightTupleMemory() );
        RightTuple rightTuple2 = tuple.firstChild.getRightParent();
        RightTuple rightTuple1 = tuple.firstChild.getLeftParentNext().getRightParent();
View Full Code Here

TOP

Related Classes of org.drools.reteoo.FromNode.FromMemory

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.