Package org.kie.api.runtime

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


            ksession.fireAllRules();
            list.clear();
            Thread.sleep(500); // now wait to see if any more fire, they shouldn't
            ksession.fireAllRules();
            assertEquals( 0, list.size() );
            ksession.dispose();
        } catch (InterruptedException e) {
            throw new RuntimeException( e );
        }
    }
View Full Code Here


        FactHandle b = ksession.insert( new Message( "b" ) );
        ksession.delete(b);
        int fired = ksession.fireAllRules(1);
       
        assertEquals( 0, fired );
        ksession.dispose();
    }

    @Test
    public void testClassNotFoundAfterDeserialization() throws Exception {
        // JBRULES-3670
View Full Code Here

        session.getAgenda().getAgendaGroup( "End" ).setFocus();
        session.getAgenda().getAgendaGroup( "Start" ).setFocus();

        int x = session.fireAllRules( 10 );
        assertEquals( 2, x );
        session.dispose();
    }

    @Test
    public void testNotNodesUnlinking() throws Exception {
        // BZ-1101471
View Full Code Here

        session.getAgenda().getAgendaGroup( "End" ).setFocus();
        session.getAgenda().getAgendaGroup( "Start" ).setFocus();

        int x = session.fireAllRules( 10 );
        assertEquals( 2, x );
        session.dispose();
    }

    @Test
    public void testNotNodesUnlinking() throws Exception {
        // BZ-1101471
View Full Code Here

        FactHandle b = ksession.insert( new Message( "b" ) );
        ksession.delete(b);
        int fired = ksession.fireAllRules(1);
       
        assertEquals( 0, fired );
        ksession.dispose();
    }

    @Test
    public void testClassNotFoundAfterDeserialization() throws Exception {
        // JBRULES-3670
View Full Code Here

        KieSession kSession = kBase.newKieSession( conf != null ? conf : getKnowledgeSessionConfiguration(kSessionModel), environment );
        wireListnersAndWIHs(kSessionModel, kSession);

        KieSession oldSession = kSessions.remove(kSessionName);
        if (oldSession != null) {
            oldSession.dispose();
        }
        kSessions.put(kSessionName, kSession);

        return kSession;
    }
View Full Code Here

        visitorSession.insert( pmml );
        visitorSession.fireAllRules();

        String modelEvaluatingRules = sb.toString();

        visitorSession.dispose();

        //System.out.println( modelEvaluatingRules );
        return modelEvaluatingRules;
  }
View Full Code Here

        ksession.insert( inrec );
        ksession.fireAllRules();
        Assert.assertEquals( 1, ksession.getFactHandles().size() );
        Assert.assertEquals( "setting 1", inrec.getOutcome() );

        ksession.dispose();
        ksession = createKnowledgeSession(kbase);
        inrec = new Holder( null );
        System.out.println( "Holds: " + inrec.getValue() );
        ksession.insert( inrec );
        ksession.fireAllRules();
View Full Code Here

        ksession.insert( inrec );
        ksession.fireAllRules();
        Assert.assertEquals( 1, ksession.getFactHandles().size() );
        Assert.assertEquals( "setting null", inrec.getOutcome() );

        ksession.dispose();
        ksession = createKnowledgeSession(kbase);
        inrec = new Holder( 0 );
        System.out.println( "Holds: " + inrec.getValue() );
        ksession.insert( inrec );
        ksession.fireAllRules(); // appropriate rule is not fired!
View Full Code Here

            ksession.fireAllRules();
            list.clear();
            Thread.sleep(500); // now wait to see if any more fire, they shouldn't
            ksession.fireAllRules();
            assertEquals( 0, list.size() );
            ksession.dispose();
        } catch (InterruptedException e) {
            throw new RuntimeException( e );
        }
    }
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.