Examples of ResultHandlerImpl


Examples of org.drools.agent.KnowledgeAgentTest.ResultHandlerImpl

         insertStage.setReceiver( batchExecution );

         Pipeline pipeline = PipelineFactory.newStatelessKnowledgeSessionPipeline( ksession );
         pipeline.setReceiver( insertStage );

         ResultHandlerImpl resultHandler = new ResultHandlerImpl();
         pipeline.insert( "hello", resultHandler );

         assertEquals( 2, list.size() );
         assertTrue( list.contains( "rule1" ) );
         assertTrue( list.contains( "rule2" ) );
View Full Code Here

Examples of org.drools.runtime.pipeline.impl.XStreamStatefulSessionTest.ResultHandlerImpl

        transformer.setReceiver( insertStage );

        Pipeline pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
        pipeline.setReceiver( transformer );

        ResultHandlerImpl resultHandler = new ResultHandlerImpl();
        pipeline.insert( xml,
                         resultHandler );
       
        FactHandle factHandle = ( FactHandle ) ((Map)resultHandler.getObject()).keySet().iterator().next();
        assertNotNull( factHandle );

        // now round trip that fact
        Action executeResult = PipelineFactory.newExecuteResultHandler();
       
        Action assignAsResult = PipelineFactory.newAssignObjectAsResult();
        assignAsResult.setReceiver( executeResult );
       
        transformer = PipelineFactory.newXStreamToXmlTransformer( xstream );
        transformer.setReceiver( assignAsResult );
       
        KnowledgeRuntimeCommand getObject = PipelineFactory.newStatefulKnowledgeSessionGetObject();
        getObject.setReceiver( transformer );

        pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
        pipeline.setReceiver( getObject );
       
        resultHandler = new ResultHandlerImpl();
        pipeline.insert( factHandle, resultHandler );
       
        assertXMLEqual( xml, (String) resultHandler.getObject() );
    }
View Full Code Here

Examples of org.drools.runtime.pipeline.impl.XStreamStatefulSessionTest.ResultHandlerImpl

        transformer.setReceiver( setGlobalStage );

        Pipeline pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
        pipeline.setReceiver( transformer );

        ResultHandlerImpl resultHandler = new ResultHandlerImpl();
        pipeline.insert( xml,
                         resultHandler );


        // now round trip that global
        Action executeResult = PipelineFactory.newExecuteResultHandler();
       
        Action assignAsResult = PipelineFactory.newAssignObjectAsResult();
        assignAsResult.setReceiver( executeResult );
       
        transformer = PipelineFactory.newXStreamToXmlTransformer( xstream );
        transformer.setReceiver( assignAsResult );
       
        KnowledgeRuntimeCommand getGlobalStage = PipelineFactory.newStatefulKnowledgeSessionGetGlobal( );
        getGlobalStage.setReceiver( transformer );

        pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
        pipeline.setReceiver( getGlobalStage );
       
        resultHandler = new ResultHandlerImpl();
        pipeline.insert( "list", resultHandler );
       
        assertXMLEqual( xml, (String) resultHandler.getObject() );
    }
View Full Code Here

Examples of org.drools.runtime.pipeline.impl.XStreamStatefulSessionTest.ResultHandlerImpl

        transformer.setReceiver( setGlobalStage );

        Pipeline pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
        pipeline.setReceiver( transformer );

        ResultHandlerImpl resultHandler = new ResultHandlerImpl();
        pipeline.insert( xml,
                         resultHandler );


        // now round trip that global
        Action executeResult = PipelineFactory.newExecuteResultHandler();
       
        Action assignAsResult = PipelineFactory.newAssignObjectAsResult();
        assignAsResult.setReceiver( executeResult );
       
        transformer = PipelineFactory.newXStreamToXmlTransformer( xstream );
        transformer.setReceiver( assignAsResult );
       
        KnowledgeRuntimeCommand getGlobalStage = PipelineFactory.newStatefulKnowledgeSessionGetGlobal( );       
        getGlobalStage.setReceiver( transformer );

        pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
        pipeline.setReceiver( getGlobalStage );
       
        resultHandler = new ResultHandlerImpl();
        pipeline.insert( "list", resultHandler )
       
        assertXMLEqual( xml, (String) resultHandler.getObject() );
    }
View Full Code Here

Examples of org.drools.runtime.pipeline.impl.XStreamStatefulSessionTest.ResultHandlerImpl

        transformer.setReceiver( insertStage );

        Pipeline pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
        pipeline.setReceiver( transformer );

        ResultHandlerImpl resultHandler = new ResultHandlerImpl();
        pipeline.insert( xml,
                         resultHandler );
       
        FactHandle factHandle = ( FactHandle ) ((Map)resultHandler.getObject()).keySet().iterator().next();
        assertNotNull( factHandle );

        // now round trip that fact
        Action executeResult = PipelineFactory.newExecuteResultHandler();
       
        Action assignAsResult = PipelineFactory.newAssignObjectAsResult();
        assignAsResult.setReceiver( executeResult );
       
        transformer = PipelineFactory.newXStreamToXmlTransformer( xstream );
        transformer.setReceiver( assignAsResult );
       
        KnowledgeRuntimeCommand getObject = PipelineFactory.newStatefulKnowledgeSessionGetObject();     
        getObject.setReceiver( transformer );

        pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
        pipeline.setReceiver( getObject );
       
        resultHandler = new ResultHandlerImpl();
        pipeline.insert( factHandle, resultHandler )
       
        assertXMLEqual( xml, (String) resultHandler.getObject() );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.