Package org.drools.reteoo

Examples of org.drools.reteoo.ObjectSource


                               child );

                // if a previous object source was bound, but no tuple source
                if (context.getObjectSource() != null && context.getTupleSource() == null) {
                    // we know this is the root OTN, so record it
                    ObjectSource source = context.getObjectSource();
                    while ( !(source instanceof ObjectTypeNode) ) {
                        source = source.getParentObjectSource();
                    }
                    context.setRootObjectTypeNode( (ObjectTypeNode) source );
                   
                   
                    // adapt it to a Tuple source                   
View Full Code Here


                addLeftTupleSink( ruleBase,
                                  leftTupleSink,
                                  nodes );
            }
        } else {
            ObjectSource node = ( ObjectSource ) sink;
            for ( ObjectSink objectSink : node.getSinkPropagator().getSinks() ) {
                addObjectSink( ruleBase,
                               objectSink,
                               nodes );
            }
        }
View Full Code Here

        if ( args.size() != 0 ) {
            String[] a = args.get( 0 );
            String name = a[0].trim();
            String leftInput = a[1].trim();

            ObjectSource objectSource = (ObjectSource) context.get( leftInput );

            ObjectSink mockedSink = Mockito.mock( ObjectSink.class,
                                                  Mockito.withSettings().extraInterfaces( DSLMock.class ) );

            objectSource.addObjectSink( mockedSink );

            context.put( name,
                         mockedSink );
        } else {
            throw new IllegalArgumentException( "Cannot parse arguments " + args );
View Full Code Here

                addLeftTupleSink( ruleBase,
                                  leftTupleSink,
                                  nodes );
            }
        } else {
            ObjectSource node = ( ObjectSource ) sink;
            for ( ObjectSink objectSink : node.getSinkPropagator().getSinks() ) {
                addObjectSink( ruleBase,
                               objectSink,
                               nodes );
            }
        }
View Full Code Here

                gatherNodeInfo( sink,
                                nodeStack,
                                info );
            }
        } else if ( parent instanceof ObjectSource ) {
            ObjectSource source = (ObjectSource) parent;
            for ( ObjectSink sink : source.getSinkPropagator().getSinks() ) {
                gatherNodeInfo( sink,
                                nodeStack,
                                info );
            }
        } else if ( parent instanceof LeftTupleSource ) {
            LeftTupleSource source = (LeftTupleSource) parent;
            for ( LeftTupleSink sink : source.getSinkPropagator().getSinks() ) {
                gatherNodeInfo( sink,
                                nodeStack,
                                info );
            }
        } else if ( parent instanceof RuleTerminalNode || parent instanceof QueryTerminalNode ) {
View Full Code Here

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

            if ( ! "mock".equals( rightInput ) ) {
                ObjectSource rightObjectSource = (ObjectSource) context.get( rightInput );
                rightObjectSource.addObjectSink( betaNode );
            }

        } else {
            StringBuilder msgBuilder = new StringBuilder();
            msgBuilder.append( "Can not parse MockBetaNode step arguments: \n" );
View Full Code Here

                leftTupleSource =  Mockito.mock( LeftTupleSource.class );;
            } else {
                leftTupleSource = (LeftTupleSource) context.get( leftInput );
            }

            ObjectSource rightObjectSource;
            if ( "mock".equals( rightInput ) ) {
                rightObjectSource =  Mockito.mock( ObjectSource.class );;
            } else {
                rightObjectSource = (ObjectSource) context.get( rightInput );
            }
View Full Code Here

                leftTupleSource = Mockito.mock( LeftTupleSource.class );
            } else {
                leftTupleSource = (LeftTupleSource) context.get( leftInput );
            }

            ObjectSource rightObjectSource;
            if ( "mock".equals( rightInput ) ) {
                rightObjectSource = Mockito.mock( ObjectSource.class );
            } else {
                rightObjectSource = (ObjectSource) context.get( rightInput );
            }
View Full Code Here

                leftTupleSource = Mockito.mock( LeftTupleSource.class );
            } else {
                leftTupleSource = (LeftTupleSource) context.get( leftInput );
            }

            ObjectSource rightObjectSource;
            if ( "mock".equals( rightInput ) ) {
                rightObjectSource = Mockito.mock( ObjectSource.class );
            } else {
                rightObjectSource = (ObjectSource) context.get( rightInput );
            }
View Full Code Here

                leftTupleSource = new MockTupleSource( buildContext.getNextId() );
            } else {
                leftTupleSource = (LeftTupleSource) context.get( leftInput );
            }

            ObjectSource rightObjectSource;
            if ( "mock".equals( rightInput ) ) {
                rightObjectSource = new MockObjectSource( buildContext.getNextId() );
            } else {
                rightObjectSource = (ObjectSource) context.get( rightInput );
            }
View Full Code Here

TOP

Related Classes of org.drools.reteoo.ObjectSource

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.