Package org.drools.runtime

Examples of org.drools.runtime.StatefulKnowledgeSession.dispose()


                      this.afterResourceProcessed );
        assertTrue( this.compilationErrors );
        assertTrue( this.kbaseUpdated );
        this.resetEventCounters();

        ksession.dispose();
        kagent.dispose();
    }

    @Test
    public void testEventListenerWithoutIncrementalChangeSet() throws Exception {
View Full Code Here


        StatefulKnowledgeSession ksession = kagent.getKnowledgeBase().newStatefulKnowledgeSession();
        ksession.setGlobal( "list",
                            list );
        ksession.insert( new Person( "John", 34  ) );
        ksession.fireAllRules();
        ksession.dispose();
        assertEquals( 1,
                      list.size() );
        assertTrue( list.contains( "Rule1" ) );
        list.clear();
View Full Code Here

        ksession = kagent.getKnowledgeBase().newStatefulKnowledgeSession();
        ksession.setGlobal( "list",
                            list );
        ksession.insert( new Person( "John", 34  ) );
        ksession.fireAllRules();
        ksession.dispose();
        assertEquals( 1,
                      list.size() );
        assertTrue( list.contains( "Rule1" ) );
        list.clear();
View Full Code Here

        ksession = kagent.getKnowledgeBase().newStatefulKnowledgeSession();
        ksession.setGlobal( "list",
                            list );
        ksession.insert( new Person( "John", 34  ) );
        ksession.fireAllRules();
        ksession.dispose();
        assertEquals( 1,
                      list.size() );
        assertTrue( list.contains( "Rule1" ) );
        list.clear();
View Full Code Here

        ksession = kagent.getKnowledgeBase().newStatefulKnowledgeSession();
        ksession.setGlobal( "list",
                            list );
        ksession.insert( new Person( "John", 34  ) );
        ksession.fireAllRules();
        ksession.dispose();
        assertEquals( 2,
                      list.size() );
        assertTrue( list.contains( "Rule1" ) );
        assertTrue( list.contains( "Rule2" ) );
        list.clear();
View Full Code Here

        ksession = kagent.getKnowledgeBase().newStatefulKnowledgeSession();
        ksession.setGlobal( "list",
                            list );
        ksession.insert( new Person( "John", 34  ) );
        ksession.fireAllRules();
        ksession.dispose();
        assertEquals( 1,
                      list.size() );
        assertTrue( list.contains( "Rule3" ) );
        list.clear();
View Full Code Here

                      this.afterResourceProcessed );
        assertTrue( this.compilationErrors );
        assertTrue( this.kbaseUpdated );
        this.resetEventCounters();

        ksession.dispose();
        kagent.dispose();
    }

    @Override
    public KnowledgeAgent createKAgent(KnowledgeBase kbase,
View Full Code Here

        //The global list should contain 1 element
        assertEquals(1, list.size());
        assertTrue(list.contains("Instance number 2"));
       
       
        ksession.dispose();
        kagent.dispose();
    }

}
View Full Code Here

        kbase = SerializationHelper.serializeObject( kbase );
        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        ksession.insert( new Message( "help" ) );
        ksession.fireAllRules();
        ksession.dispose();
    }

    @Test
    public void testEvalWithBigDecimal() throws Exception {
        String str = "";
View Full Code Here

        assertEquals( 2,
                      ((List) session.getGlobal( "list" )).size() );

        state.setState( "finished" );

        session.dispose();

    }

    @Test
    public void testDisconnectedFactHandle() {
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.