Examples of execute()


Examples of org.kie.api.runtime.CommandExecutor.execute()

        if ( exec == null ) {
            throw new RuntimeException( "No defined ksession for uri " + ke.getEndpointUri() );
        }

        ExecutionResults results = exec.execute( (BatchExecutionCommandImpl) cmd );

        exchange.getIn().setBody( results );
    }
}
View Full Code Here

Examples of org.kie.api.runtime.KieSession.execute()

                list.size() );
        String externalForm = atomicFH.toExternalForm();
       
        ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(ksession.getId(), kbase, null, env);
       
        atomicFH = ksession.execute(CommandFactory.fromExternalFactHandleCommand(externalForm));
       
        value.addAndGet(1);
        ksession.update(atomicFH, value);
       
        ksession.fireAllRules();
View Full Code Here

Examples of org.kie.api.runtime.StatelessKieSession.execute()

            }
        };

        ksession.addEventListener(agendaEventListener);

        ksession.execute("1");
        ksession.execute("2");

        assertEquals(2, firings.size());

        ksession.removeEventListener(agendaEventListener);
View Full Code Here

Examples of org.kie.internal.executor.api.Command.execute()

        ExecutionResults results = new ExecutionResults();
        Map<String, Object> data = new HashMap<String, Object>();
        for (String cmd : commandsList) {
            Class<?> forName = Class.forName(cmd.trim(), true, cl);
            Command newInstance = (Command) forName.newInstance();
            ExecutionResults execute = newInstance.execute(commandContext);
            Set<String> keySet = execute.keySet();
            for (String key : keySet) {
                data.put(key, execute.getData(key));
                //I'm adding the results as part of the context for the next commands execution
                commandContext.getData().put(key, execute.getData(key));
View Full Code Here

Examples of org.kie.internal.runtime.StatefulKnowledgeSession.execute()

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

    @Override
    protected StatefulKnowledgeSession registerKnowledgeRuntime(String identifier,
View Full Code Here

Examples of org.kie.internal.runtime.StatelessKnowledgeSession.execute()

        Person student = new Person("student", 18);
        commands.add( CommandFactory.newInsert( student ));

        System.out.println("Starting execution...");
        commands.add(CommandFactory.newFireAllRules());
        ksession.execute(CommandFactory.newBatchExecution(commands));

        System.out.println("Finished...");

        assertEquals( 2, list.size() );
        assertTrue( list.contains( 1 ) );
View Full Code Here

Examples of org.kie.runtime.KieSession.execute()

                list.size() );
        String externalForm = atomicFH.toExternalForm();
       
        ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(ksession.getId(), kbase, null, env);
       
        atomicFH = ksession.execute(CommandFactory.fromExternalFactHandleCommand(externalForm));
       
        value.addAndGet(1);
        ksession.update(atomicFH, value);
       
        ksession.fireAllRules();
View Full Code Here

Examples of org.kie.runtime.StatefulKnowledgeSession.execute()

        if( ksession instanceof StatefulKnowledgeSessionImpl ) {
            kresults = ((StatefulKnowledgeSessionImpl)ksession).execute(context, this.command );
        }
        else {
            // Graceful failure
            kresults = ksession.execute(this.command);
        }
       
        if ( this.outIdentifier != null ) {
            ((ExecutionResultImpl)((KnowledgeCommandContext) context ).getExecutionResults()).getResults().put( this.outIdentifier, kresults );
        }
View Full Code Here

Examples of org.kie.runtime.StatelessKieSession.execute()

        StatelessKieSession kstateless = (StatelessKieSession) context.getBean("statelessSession");
        assertEquals(1, kstateless.getWorkingMemoryEventListeners().size());
        assertTrue(kstateless.getWorkingMemoryEventListeners().toArray()[0] instanceof MockWorkingMemoryEventListener);

        kstateless.setGlobal("list", list);
        kstateless.execute(new Person());
        //this assert to show that our listener was called X number of times.
        // once from agenda listener, and second from working memory event listener
        assertEquals(2, counterFromListener);
    }
View Full Code Here

Examples of org.knopflerfish.service.console.CommandGroup.execute()

                    }
                } else {
                    cg = sessionCommandGroup;
                }
                if (out instanceof PrintWriter) {
                    status = cg.execute(args, in, (PrintWriter) out, session);
                } else {
                    status = cg.execute(args, in, new PrintWriter(out), session);
                }
                if (commandGroupRef != null) {
                    try {
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.