Examples of BatchExecutionCommand


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 );

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

Examples of org.kie.api.command.BatchExecutionCommand

        setter.invoke( message, "HelloWorld");

        KieCommands kcmd = ks.getCommands();
        Command<?> insert = kcmd.newInsert(message, "message");
        Command<?> fire = kcmd.newFireAllRules();
        BatchExecutionCommand batch = kcmd.newBatchExecution(Arrays.asList(insert, fire), "defaultKieSession");

        String payload = BatchExecutionHelper.newXStreamMarshaller().toXML(batch);

        ServiceResponse<String> reply = client.executeCommands("kie1", payload);
        Assert.assertEquals(ServiceResponse.ResponseType.SUCCESS, reply.getType());
View Full Code Here

Examples of org.kie.api.command.BatchExecutionCommand

        setter.invoke(message, "HelloWorld");

        KieCommands kcmd = ks.getCommands();
        Command<?> insert = kcmd.newInsert(message, "message");
        Command<?> fire = kcmd.newFireAllRules();
        BatchExecutionCommand batch = kcmd.newBatchExecution(Arrays.asList(insert, fire), "defaultKieSession");

        String payload = BatchExecutionHelper.newXStreamMarshaller().toXML(batch);

        String containerId = "command-script-container";
        KieServerCommand create = new CreateContainerCommand(new KieContainerResource( containerId, releaseId1, null));
View Full Code Here

Examples of org.kie.api.command.BatchExecutionCommand

                        batch.add(cmds.newInsert(inout.getValue(), inout.getKey()));
                    }
                    List<Object> facts = getInputOnlyList(inputMessage, operation, session);
                    batch.add(cmds.newInsertElements(facts));
                    batch.add(cmds.newFireAllRules());
                    BatchExecutionCommand exec = cmds.newBatchExecution(batch, KnowledgeConstants.RESULT);
                    ExecutionResults results = session.getStateless().execute(exec);
                    for (String id : inouts.keySet()) {
                        expressionVariables.put(id, results.getValue(id));
                    }
                    expressionVariables.putAll(getGlobalVariables(session));
View Full Code Here

Examples of org.kie.api.command.BatchExecutionCommand

        FluentBatchExecution f = new FluentBatchExecutionImpl();

        List list = new ArrayList();

        // @formatter:off         
        BatchExecutionCommand cmd = f.newBatchExecution()
                .setGlobal("list", list)
                .insert(new Person("yoda", 150)).set("y")
                .insert(new Person("salaboy", 28)).set("x")
                .fireAllRules()
                .getBatchExecution();
View Full Code Here

Examples of org.kie.api.command.BatchExecutionCommand

        FluentBatchExecution f = new FluentBatchExecutionImpl();

        List list = new ArrayList();

        // @formatter:off         
        BatchExecutionCommand cmd = f.newBatchExecution()
                .setGlobal("list", list).set("myGlobal")
                .insert(new Person("yoda", 150)).set("y")
                .insert(new Person("salaboy", 28)).set("x")
                .fireAllRules()
                .getBatchExecution();
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
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.