Package org.kie.api

Examples of org.kie.api.KieBase.newKieSession()


        KieBase kbase = KieServices.Factory.get()
                .newKieContainer(kbuilder.getKieModule().getReleaseId())
                .getKieBase();

        KieSession ksession = kbase.newKieSession();

        ksession.insert(new Person("Petr", 25));

        FactHandle george = ksession.insert(new Person("George", 19));
View Full Code Here


public class ExecutionFlowControlTest extends CommonTestMethodBase {

    @Test(timeout = 10000)
    public void testSalienceIntegerAndLoadOrder() throws Exception {
        KieBase kbase = loadKnowledgeBase("test_salienceIntegerRule.drl");
        KieSession ksession = kbase.newKieSession();
        final List list = new ArrayList();
        ksession.setGlobal( "list", list );

        final PersonInterface person = new Person( "Edson", "cheese" );
        ksession.insert( person );
View Full Code Here

    }

    @Test
    public void testSalienceExpression() throws Exception {
        KieBase kbase = loadKnowledgeBase("test_salienceExpressionRule.drl");
        KieSession ksession = kbase.newKieSession();

        final List list = new ArrayList();
        ksession.setGlobal( "list", list );

        final PersonInterface person10 = new Person( "bob", "cheese", 10 );
View Full Code Here

                      + "    list.add( f1 );\n"
                      + "    foo.setId( 'xxx' );\n"
                      + "end\n" + "\n";

        KieBase kbase = loadKnowledgeBaseFromString(text);
        KieSession ksession = kbase.newKieSession();
        List list = new ArrayList();
        ksession.setGlobal( "list", list );       
        ksession.insert ( new Foo(null, null) );
        ksession.insert ( new Pet(null) );
       
View Full Code Here

                      + "then\n"
                      + "    list.add( \"c\" );\n"
                      + "end\n";

        KieBase kbase = loadKnowledgeBaseFromString(text);
        KieSession ksession = kbase.newKieSession();

        final List list = new ArrayList();
        ksession.setGlobal( "list", list );
        ksession.fireAllRules();
View Full Code Here

                      + "then\n"
                      + "    list.add( s );\n"
                      + "end\n" + "\n";

        KieBase kbase = loadKnowledgeBaseFromString(text);
        KieSession ksession = kbase.newKieSession();

        final List list = new ArrayList();
        ksession.setGlobal( "list", list );
        ksession.insert( "a" );
        ksession.insert( "b" );
View Full Code Here

                      + "    list.add( f1 );\n"
                      + "    foo.setId( 'xxx' );\n"
                      + "end\n" + "\n";

        KieBase kbase = loadKnowledgeBaseFromString(text);
        KieSession ksession = kbase.newKieSession();
        List list = new ArrayList();
        ksession.setGlobal( "list", list );       
        ksession.insert ( new Foo(null, null) );
        ksession.insert ( new Pet(null) );
       
View Full Code Here

    }   

    @Test
    public void testNoLoop() throws Exception {
        KieBase kbase = loadKnowledgeBase("no-loop.drl");
        KieSession ksession = kbase.newKieSession();;

        final List list = new ArrayList();
        ksession.setGlobal( "list", list );

        final Cheese brie = new Cheese( "brie", 12 );
View Full Code Here

    }

    @Test
    public void testNoLoopWithModify() throws Exception {
        KieBase kbase = loadKnowledgeBase("no-loop_with_modify.drl");
        KieSession ksession =  kbase.newKieSession();

        final List list = new ArrayList();
        ksession.setGlobal( "list", list );

        final Cheese brie = new Cheese( "brie", 12 );
View Full Code Here

    }

    @Test
    public void testLockOnActive() throws Exception {
        KieBase kbase = loadKnowledgeBase("test_LockOnActive.drl");
        KieSession ksession = kbase.newKieSession();

        final List list = new ArrayList();
        ksession.setGlobal( "list", list );

        // AgendaGroup "group1" is not active, so should receive activation
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.