Package org.kie.api

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


        assertEquals(0, kbuilder.getResults().getMessages().size());

        KieBaseConfiguration conf = ks.newKieBaseConfiguration();
        conf.setOption(RuleEngineOption.RETEOO);
        KieBase kbase = ks.newKieContainer(kbuilder.getKieModule().getReleaseId()).newKieBase(conf);
        KieSession ksession = kbase.newKieSession();
        ksession.fireAllRules();
    }

    @Test
    public void testListnersOnStatlessKieSession() {
View Full Code Here


    @Test
    public void multipleJoinsUsingSameOTN() throws Exception {
        KieBase kbase = loadKnowledgeBase("test_LRUnlinking.drl");
        kbase = SerializationHelper.serializeObject( kbase );

        final KieSession wmOne = kbase.newKieSession();
        final KieSession wmTwo = kbase.newKieSession();

        final List<Person> listOne = new ArrayList<Person>();
        final List<Person> listTwo = new ArrayList<Person>();
View Full Code Here

    public void multipleJoinsUsingSameOTN() throws Exception {
        KieBase kbase = loadKnowledgeBase("test_LRUnlinking.drl");
        kbase = SerializationHelper.serializeObject( kbase );

        final KieSession wmOne = kbase.newKieSession();
        final KieSession wmTwo = kbase.newKieSession();

        final List<Person> listOne = new ArrayList<Person>();
        final List<Person> listTwo = new ArrayList<Person>();

        wmOne.setGlobal( "results",
View Full Code Here

    }

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

        final List l = new ArrayList();
        final Person a = new Person( "a" );
        ksession.setGlobal( "a", a );
        ksession.setGlobal( "l", l );
View Full Code Here

    @Test
    @Ignore("in Java 8, the byte[] generated by serialization are not the same and requires investigation")
    public void testLogicalInsertionsWithModify() throws Exception {
        KieBase kbase = loadKnowledgeBase("test_LogicalInsertionsWithUpdate.drl");
        KieSession ksession = kbase.newKieSession();

        final Person p = new Person( "person" );
        p.setAge( 2 );
        FactHandle h = ksession.insert( p );
        assertEquals(1,
View Full Code Here

    }

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

        final List events = new ArrayList();

        ksession.setGlobal( "events", events );
View Full Code Here

    @Test
    @Ignore("in Java 8, the byte[] generated by serialization are not the same and requires investigation")
    public void testLogicalInsertionsNot() throws Exception {
        KieBase kbase = loadKnowledgeBase("test_LogicalInsertionsNot.drl");
        KieSession ksession = kbase.newKieSession();

        final Person a = new Person( "a" );
        final Cheese cheese = new Cheese( "brie",
                                          1 );
        ksession.setGlobal( "cheese",
View Full Code Here

    }

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

        final List list = new ArrayList();

        final Person person = new Person( "person" );
        final Cheese cheese = new Cheese( "cheese",
View Full Code Here

    @Test
    @Ignore("in Java 8, the byte[] generated by serialization are not the same and requires investigation")
    public void testLogicalInsertionsUpdateEqual() throws Exception {
        // calling update on a justified FH, states it
        KieBase kbase = loadKnowledgeBase("test_LogicalInsertionsUpdateEqual.drl");
        KieSession ksession = kbase.newKieSession();

        final Person p = new Person( "person" );
        p.setAge( 2 );
        FactHandle h = ksession.insert( p );
        assertEquals(1,
View Full Code Here

    @Test
    @Ignore("in Java 8, the byte[] generated by serialization are not the same and requires investigation")
    public void testLogicalInsertionsWithExists() throws Exception {
        KieBase kbase = loadKnowledgeBase("test_LogicalInsertionWithExists.drl");
        KieSession ksession = kbase.newKieSession();

        final Person p1 = new Person( "p1",
                                      "stilton",
                                      20 );
        p1.setStatus( "europe" );
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.