Package org.drools.runtime

Examples of org.drools.runtime.BatchExecutionResults


        ReteooWorkingMemory session = ( ReteooWorkingMemory ) newWorkingMemory();
        try {
            session.startBatchExecution();
            ((org.drools.process.command.Command)command).execute( session );
            session.fireAllRules( this.agendaFilter );
            BatchExecutionResults result = session.getBatchExecutionResult();
            return result;
        } finally {
            session.endBatchExecution();
        }
    }
View Full Code Here


                        PipelineContext context) {
        BasePipelineContext kContext = (BasePipelineContext) context;
        if ( object instanceof Collection ) {
            object = CommandFactory.newBatchExecution( (List<Command>) object );
        }
        BatchExecutionResults result = kContext.getBatchExecutor().execute( (Command) object );

        emit( result,
              kContext );
    }
View Full Code Here

   
    public BatchExecutionResults execute(Command command) {       
        try {
            session.startBatchExecution();
            ((org.drools.process.command.Command)command).execute( session );
            BatchExecutionResults result = session.getBatchExecutionResult();
            return result;
        } finally {
            session.endBatchExecution();
        }
    }
View Full Code Here

    }

    public void marshal(Object object,
                        HierarchicalStreamWriter writer,
                        MarshallingContext context) {
        BatchExecutionResults result = (BatchExecutionResults) object;
        for ( String identifier : result.getIdentifiers() ) {
            writer.startNode( "result" );
            writer.addAttribute( "identifier", identifier );
            Object value = result.getValue( identifier );
            writeItem( value,
                       context,
                       writer );
            writer.endNode();
        }
View Full Code Here

        try {           
            ((ReteooWorkingMemory)this.commandService.getSession()).startBatchExecution();
           
            this.commandService.execute( (org.drools.process.command.Command) command );
           
            BatchExecutionResults result = ((ReteooWorkingMemory)this.commandService.getSession()).getBatchExecutionResult();
            return result;
        } finally {
            ((ReteooWorkingMemory)this.commandService.getSession()).endBatchExecution();
        }
    }
View Full Code Here

       
        Cheese stilton = new Cheese( "stilton", 5 );
       
        StatelessKnowledgeSession ksession = getSession2( ResourceFactory.newByteArrayResource( str.getBytes() ) );
        Command cmd = CommandFactory.newInsertObject( stilton, "outStilton" );
        BatchExecutionResults result = ksession.execute( cmd );
        stilton = ( Cheese ) result.getValue( "outStilton" );
        assertEquals( 30,
                      stilton.getPrice() );      
    }
View Full Code Here

        cmds.add( setGlobal1 );
        cmds.add( setGlobal2 );
        cmds.add( setGlobal3 );
        cmds.addinsert );
       
        BatchExecutionResults result = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
       
        assertEquals( 30,
                      stilton.getPrice() );
       
        assertNull( result.getValue( "list1" ) );
       
        list2 = ( List ) result.getValue( "list2" );
        assertEquals( 1, list2.size() );
        assertSame( stilton, list2.get( 0 ) );
       
         
       
        list3 = ( List ) result.getValue( "outList3" );
        assertEquals( 1, list3.size() );
        assertSame( stilton, list3.get( 0 ) );       
    }   
View Full Code Here

        cmds.add( CommandFactory.newInsertObject( cheddar2 ) );
        cmds.add( CommandFactory.newInsertObject( cheddar3 ) );
       
        cmds.addCommandFactory.newQuery( "cheeses", "cheeses" ) );
       
        BatchExecutionResults batchResult = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
       
        org.drools.runtime.rule.QueryResults results = ( org.drools.runtime.rule.QueryResults) batchResult.getValue( "cheeses" );
        assertEquals( 3, results.size() );       
        assertEquals( 2, results.getIdentifiers().length );
        Set newSet = new HashSet();
        for ( org.drools.runtime.rule.QueryResultsRow result : results ) {
            list = new ArrayList();
View Full Code Here

TOP

Related Classes of org.drools.runtime.BatchExecutionResults

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.