Package org.drools.core.command.runtime

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


        StatefulKnowledgeSession ksession = registerKnowledgeRuntime( "ksession1",
                                                                      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

                                                                      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

    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

        }

        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

                } 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

        }

        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

                } 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

    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

    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

TOP

Related Classes of org.drools.core.command.runtime.BatchExecutionCommandImpl

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.