Package org.drools.command.runtime

Examples of org.drools.command.runtime.BatchExecutionCommand


        }

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext context) {
            BatchExecutionCommand cmds = (BatchExecutionCommand) 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


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


@XmlRegistry
public class ObjectFactory {
    public BatchExecutionCommand createBatchExecutionCommand() {
        return new BatchExecutionCommand();
    }
View Full Code Here

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

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

/**
* Class for transforming a BatchExecution command.
*/
class BatchExecutionTransformer extends CommandTransformer {
  public GenericCommand<?> transform(CommandTranslator cmdTrans, Object o , Unmarshaller unmarshaller) {
    BatchExecutionCommand be = (BatchExecutionCommand)o;
    List<GenericCommand<?>> xmlCmds = be.getCommands();
    for (ListIterator<GenericCommand<?>> i = xmlCmds.listIterator(); i.hasNext();) {
      GenericCommand<?> cmd = i.next();
      CommandTransformer ct = cmdTrans.getCommandTransformer(cmd.getClass());
      if (ct != null) {
        i.set(ct.transform(cmdTrans, cmd, unmarshaller));
View Full Code Here

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

TOP

Related Classes of org.drools.command.runtime.BatchExecutionCommand

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.