Examples of BatchExecutionCommandImpl


Examples of org.drools.core.command.runtime.BatchExecutionCommandImpl

                                                                      null );
        InsertObjectCommand cmd = new InsertObjectCommand( me );
        cmd.setOutIdentifier( "camel-rider" );
        cmd.setReturnObject( false );

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

        ExecutionResults results = ksession.execute( script );
        handle = ((FactHandle) results.getFactHandle( "camel-rider" )).toExternalForm();

    }
View Full Code Here

Examples of org.drools.core.command.runtime.BatchExecutionCommandImpl

    public BatchExecutionCommand newBatchExecution(List<? extends Command> commands) {
        return newBatchExecution( commands, null );
    }

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

Examples of org.drools.core.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.core.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.core.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.core.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.core.command.runtime.BatchExecutionCommandImpl

    public BatchExecutionCommand newBatchExecution(List<? extends Command> commands) {
        return newBatchExecution( commands, null );
    }

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

Examples of org.drools.core.command.runtime.BatchExecutionCommandImpl

    public void insertAndFireAll(Exchange exchange) {
        final Message in = exchange.getIn();
        final Object body = in.getBody();

        BatchExecutionCommandImpl command = new BatchExecutionCommandImpl();
        final List<GenericCommand<?>> commands = command.getCommands();
        commands.add(new InsertObjectCommand(body, "obj1"));
        commands.add(new FireAllRulesCommand());

        in.setBody(command);
    }
View Full Code Here

Examples of org.drools.core.command.runtime.BatchExecutionCommandImpl

        setAddress.invoke( lucaz,
                           lucazAddress );
        setAddress.invoke( baunax,
                           baunaxAddress );

        BatchExecutionCommandImpl cmd = new BatchExecutionCommandImpl();
        cmd.setLookup( "ksession1" );
        cmd.getCommands().add( new InsertObjectCommand( lucaz,
                                                        "lucaz" ) );
        cmd.getCommands().add( new InsertObjectCommand( baunax,
                                                        "baunax" ) );
        cmd.getCommands().add( new FireAllRulesCommand() );

        StringWriter xmlReq = new StringWriter();
        Marshaller marshaller = getJaxbContext().createMarshaller();
        marshaller.setProperty( "jaxb.formatted.output",
                                true );
View Full Code Here

Examples of org.drools.core.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
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.