Examples of BatchExecutionCommandImpl


Examples of org.drools.command.runtime.BatchExecutionCommandImpl

    public Command newQuery(String identifier, String name, Object[] arguments) {
        return new QueryCommand(identifier, name, arguments);
    }

    public BatchExecutionCommand newBatchExecution(List<? extends Command> commands, String lookup) {
        return new BatchExecutionCommandImpl((List<GenericCommand<?>>) commands, lookup);
    }
View Full Code Here

Examples of org.drools.command.runtime.BatchExecutionCommandImpl

       
        Cheese stilton = new Cheese( "stilton", 5 );
       
        StatelessKnowledgeSession ksession = getSession2( ResourceFactory.newByteArrayResource( str.getBytes() ) );
        GenericCommand cmd = ( GenericCommand ) CommandFactory.newInsert( stilton, "outStilton" );
        BatchExecutionCommandImpl batch = new BatchExecutionCommandImplArrays.asList( new GenericCommand<?>[] { cmd } ) );
       
        ExecutionResults result = ( ExecutionResults ) ksession.execute( batch );
        stilton = ( Cheese ) result.getValue( "outStilton" );
        assertEquals( 30,
                      stilton.getPrice() );
View Full Code Here

Examples of org.drools.command.runtime.BatchExecutionCommandImpl

    public <P> VariableContext<P> getVariableContext() {
        return vars;
    }

    public BatchExecutionCommand getBatchExecution() {
        return new BatchExecutionCommandImpl((List<GenericCommand<?>>) cmds);
    }
View Full Code Here

Examples of org.drools.command.runtime.BatchExecutionCommandImpl

            if ( cmd == null ) {
                throw new RuntimeCamelException( "Body of in message not of the expected type 'org.drools.command.Command' for uri" + de.getEndpointUri()  );
            }

            if ( !(cmd instanceof BatchExecutionCommandImpl) ) {
                cmd = new BatchExecutionCommandImpl( Arrays.asList( new GenericCommand< ? >[]{(GenericCommand) cmd} ) );
            }

            CommandExecutor exec;
            ExecutionNodePipelineContextImpl droolsContext = exchange.getProperty( "drools-context",
                                                                                   ExecutionNodePipelineContextImpl.class );
View Full Code Here

Examples of org.drools.command.runtime.BatchExecutionCommandImpl

        }

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext context) {
            BatchExecutionCommandImpl cmds = (BatchExecutionCommandImpl) object;
            if ( cmds.getLookup() != null ) {
                writer.startNode( "lookup" );
                writer.setValue( cmds.getLookup() );
                writer.endNode();
            }
            List<GenericCommand< ? >> list = cmds.getCommands();

            for ( GenericCommand cmd : list ) {
                writeItem( new CommandsObjectContainer( cmd ),
                           context,
                           writer );
View Full Code Here

Examples of org.drools.command.runtime.BatchExecutionCommandImpl

                } else {
                    throw new IllegalArgumentException( "batch-execution does not support the child element name=''" + reader.getNodeName() + "' value=" + reader.getValue() + "'" );
                }
                reader.moveUp();
            }
            return new BatchExecutionCommandImpl( list,
                                              lookup );
        }
View Full Code Here

Examples of org.drools.command.runtime.BatchExecutionCommandImpl

  public Command newQuery(String identifier, String name, Object[] arguments) {
    return new QueryCommand(identifier, name, arguments);
  }

  public BatchExecutionCommand newBatchExecution(List<? extends Command> commands, String lookup) {
    return new BatchExecutionCommandImpl((List<GenericCommand<?>>) commands, lookup);
  }
View Full Code Here

Examples of org.drools.command.runtime.BatchExecutionCommandImpl

        List<GenericCommand<?>> cmds = new ArrayList<GenericCommand<?>>();
        cmds.add((GenericCommand<?>)CommandFactory.newSetGlobal("myGlobalObj", new MyObject("myglobalObj")));
        cmds.add((GenericCommand<?>)CommandFactory.newInsert(new MyObject("obj1"), "myObject1"));
        cmds.add((GenericCommand<?>)CommandFactory.newFireAllRules());
        BatchExecutionCommandImpl batch = new BatchExecutionCommandImpl(cmds, "out");
       
        ExecutionResults results = ksession.execute(batch);
       
      
        System.out.println("Results = "+results);
View Full Code Here

Examples of org.drools.command.runtime.BatchExecutionCommandImpl

    public Command newQuery(String identifier, String name, Object[] arguments) {
        return new QueryCommand(identifier, name, arguments);
    }

    public BatchExecutionCommand newBatchExecution(List<? extends Command> commands, String lookup) {
        return new BatchExecutionCommandImpl((List<GenericCommand<?>>) commands, lookup);
    }
View Full Code Here

Examples of org.drools.command.runtime.BatchExecutionCommandImpl

        }

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext context) {
            BatchExecutionCommandImpl cmds = (BatchExecutionCommandImpl) object;
            if ( cmds.getLookup() != null ) {
                writer.startNode( "lookup" );
                writer.setValue( cmds.getLookup() );
                writer.endNode();
            }
            List<GenericCommand< ? >> list = cmds.getCommands();

            for ( GenericCommand cmd : list ) {
                writeItem( new CommandsObjectContainer( cmd ),
                           context,
                           writer );
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.