Examples of BatchExecutionCommand


Examples of org.drools.command.runtime.BatchExecutionCommand

                } 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

Examples of org.drools.command.runtime.BatchExecutionCommand


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

Examples of org.drools.command.runtime.BatchExecutionCommand

  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

Examples of org.drools.command.runtime.BatchExecutionCommand

/**
* 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

Examples of org.drools.command.runtime.BatchExecutionCommand

       
        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

Examples of org.kie.api.command.BatchExecutionCommand

    @Test
    public void testInsert() throws Exception {
        Person p = new Person("Alice", "spicy meals", 30);
        List<Command> commands = new ArrayList<Command>();
        commands.add(CommandFactory.newInsert(p, "tempPerson"));
        BatchExecutionCommand command = CommandFactory.newBatchExecution(commands);
        String xmlCommand = template.requestBody("direct:marshall", command, String.class);

        String xml = template.requestBody("direct:test-session", xmlCommand, String.class);
        ExecutionResults res = (ExecutionResults) template.requestBody("direct:unmarshall", xml);
View Full Code Here

Examples of org.kie.api.command.BatchExecutionCommand

        Person john = new Person();
        john.setName("John Smith");

        List<Command> commands = new ArrayList<Command>();
        commands.add(CommandFactory.newInsert(john, "john"));
        BatchExecutionCommand batchExecutionCommand = CommandFactory.newBatchExecution(commands);

        ExecutionResults response = (ExecutionResults) template.requestBody("direct:test-with-session",
                batchExecutionCommand);
        assertTrue( "Expected valid ExecutionResults object",
                response != null );
View Full Code Here

Examples of org.kie.api.command.BatchExecutionCommand

      Person john = new Person();
        john.setName("John Smith");

        List<Command> commands = new ArrayList<Command>();
        commands.add(CommandFactory.newInsert(john, "john"));
        BatchExecutionCommand batchExecutionCommand = CommandFactory.newBatchExecution(commands);

        Map<String,Object> headers= new HashMap<String, Object>();
        headers.put(headerName,headerValue);
       
        // set mock expectations
View Full Code Here

Examples of org.kie.api.command.BatchExecutionCommand

    @Test
    public void testInsert() throws Exception {
        Person p = new Person("Alice", "spicy meals", 30);
        List<Command> commands = new ArrayList<Command>();
        commands.add(CommandFactory.newInsert(p, "tempPerson"));
        BatchExecutionCommand command = CommandFactory.newBatchExecution(commands);
        String xmlCommand = template.requestBody("direct:marshall", command, String.class);

        String xml = template.requestBody("direct:test-session", xmlCommand, String.class);
        ExecutionResults res = (ExecutionResults) template.requestBody("direct:unmarshall", xml);
View Full Code Here

Examples of org.kie.api.command.BatchExecutionCommand

        john.setName( "John Smith" );

        List<Command> commands = new ArrayList<Command>();
        commands.add( CommandFactory.newInsert( john,
                                                "john" ) );
        BatchExecutionCommand batchExecutionCommand = CommandFactory.newBatchExecution( commands );

        ExecutionResults response = (ExecutionResults) template.requestBody( "direct:test-with-session",
                                                                             batchExecutionCommand );
        assertTrue( "Expected valid ExecutionResults object",
                    response != null );
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.