Package org.kie.internal.runtime

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


        List<Setter> setterList = new ArrayList<Setter>();
        setterList.add( CommandFactory.newSetter( "age", String.valueOf( p.getAge() ) ) );
        setterList.add( CommandFactory.newSetter( "name", p.getName() ) );
        setterList.add( CommandFactory.newSetter( "likes", p.getLikes() ) );

        ksession.execute( CommandFactory.newModify( fh, setterList ) );
    }

    @Test
    public void testMVELTypeCoercion() {
        String str = "package org.drools.compiler.test; \n" +
View Full Code Here


        emEnv.put(COMMAND_ENTITY_MANAGER_FACTORY, emf);
        emEnv.put(COMMAND_ENTITY_MANAGER, jpm.getCommandScopedEntityManager());
       
        TransactionTestCommand txTestCmd = new TransactionTestCommand(mainObject, subObject, emEnv);
       
        commandKSession.execute(txTestCmd);

        ut.commit();
    }

    /**
 
View Full Code Here

                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

        List<Command> commands = new ArrayList<Command>();
        commands.add(CommandFactory.newInsert(new Person("darth", 105), "p"));
        commands.add(CommandFactory.newFireAllRules());

        ExecutionResults res1 = ksession.execute( CommandFactory.newBatchExecution(commands) );

        Marshaller marshaller = jaxbContext.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
                Boolean.TRUE);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

        emEnv.put(COMMAND_ENTITY_MANAGER, cache);
       
        TransactionTestCommand txTestCmd = new TransactionTestCommand(mainObject, subObject, emEnv);
      
       
        commandKSession.execute(txTestCmd);
       
    }

    private static int id=1;
   
View Full Code Here

             *  when starting and when committing the transaction they use.
             *  -> So that when we insert the mainObject here (via a _new_ CommandBasedStatefulKnowledgeSession),
             *     it does _not_ mess with the transaction state and the operation succeeds. 
             */
            TransactionTestCommand transactionTestSubCommand
                = new TransactionTestCommand(this.subObject, getPersistenceEnvironment()); commandKSession.execute(transactionTestSubCommand);
        }

        return null;
    }
View Full Code Here

        List<Command> commands = new ArrayList<Command>();
        commands.add(CommandFactory.newInsert(new Person("darth", 105), "p"));
        commands.add(CommandFactory.newFireAllRules());

        ExecutionResults res1 = ksession.execute( CommandFactory.newBatchExecution(commands) );

        Marshaller marshaller = jaxbContext.createMarshaller();
        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
                Boolean.TRUE);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

                list.size() );
        String externalForm = atomicFH.toExternalForm();
       
        ksession = InfinispanKnowledgeService.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

        KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        Person p1 = new Person( "John", "nobody", 25 );
        ksession.execute( CommandFactory.newInsert( p1 ) );
        org.kie.api.runtime.rule.FactHandle fh = ksession.getFactHandle( p1 );

        Person p = new Person( "Frank", "nobody", 30 );
        List<Setter> setterList = new ArrayList<Setter>();
        setterList.add( CommandFactory.newSetter( "age", String.valueOf( p.getAge() ) ) );
View Full Code Here

        List<Setter> setterList = new ArrayList<Setter>();
        setterList.add( CommandFactory.newSetter( "age", String.valueOf( p.getAge() ) ) );
        setterList.add( CommandFactory.newSetter( "name", p.getName() ) );
        setterList.add( CommandFactory.newSetter( "likes", p.getLikes() ) );

        ksession.execute( CommandFactory.newModify( fh, setterList ) );
    }

    @Test
    public void testMVELTypeCoercion() {
        String str = "package org.drools.compiler.test; \n" +
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.