Package org.kie.api.runtime

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


    public void stop() {
        LOG.debug("Stopping drools session and removing all rules.");
        final KieSession activeSession = session.getAndSet(null);
        if (activeSession != null) {
            activeSession.dispose();
        }
        if (currentReleaseId != null) {
            kieServices.getRepository().removeKieModule(currentReleaseId);
        }
    }
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

        kSession.getEntryPoint( "enable_Neuiris" ).insert( Boolean.FALSE );
        kSession.fireAllRules();

        assertEquals( 1, kSession.getObjects().size() );
        kSession.dispose();
    }

    private Collection getModelMarker( final KieSession kSession, final String modelName ) {
        return kSession.getObjects( new ObjectFilter() {
            public boolean accept( Object o ) {
View Full Code Here

        kSession.getEntryPoint( "enable_TreeTest" ).insert(Boolean.FALSE);
        kSession.fireAllRules();

        assertEquals( 1, kSession.getObjects().size() );

        kSession.dispose();
    }

    @Test
    public void testCleanupRegression() {
        KieSession kSession = getModelSession( source3 );
View Full Code Here

        kSession.getEntryPoint( "enable_LinReg" ).insert(Boolean.FALSE);
        kSession.fireAllRules();

        assertEquals( 1, kSession.getObjects().size() );

        kSession.dispose();
    }

    @Test
    public void testCleanupClustering() {
        KieSession kSession = getModelSession( source4 );
View Full Code Here

        kSession.getEntryPoint( "enable_CenterClustering" ).insert(Boolean.FALSE);
        kSession.fireAllRules();

        assertEquals( 1, kSession.getObjects().size() );

        kSession.dispose();
    }

    @Test
    public void testCleanupSVM() {
        KieSession kSession = getModelSession( source5 );
View Full Code Here

        kSession.getEntryPoint( "enable_SVMXORModel" ).insert(Boolean.FALSE);
        kSession.fireAllRules();

        assertEquals( 1, kSession.getObjects().size() );

        kSession.dispose();
    }

    @Test
    public void testCleanupScorecard() {
        KieSession kSession = getModelSession( source6 );
View Full Code Here

        kSession.getEntryPoint( "enable_SampleScore" ).insert(Boolean.FALSE);
        kSession.fireAllRules();

        assertEquals( 1, kSession.getObjects().size() );

        kSession.dispose();
    }



View Full Code Here

        kSession.fireAllRules();

        assertEquals( 2, kSession.getObjects( new ClassObjectFilter( ModelMarker.class ) ).size() );
        assertEquals( 11, kSession.getObjects( new ClassObjectFilter( kSession.getKieBase().getFactType( packageName, "Synapse" ).getFactClass() ) ).size() );

        kSession.dispose();
    }


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

        kSession.fireAllRules();

        assertEquals( 2, kSession.getObjects( new ClassObjectFilter( ModelMarker.class ) ).size() );
        assertEquals( 11, kSession.getObjects( new ClassObjectFilter( kSession.getKieBase().getFactType( packageName, "Synapse" ).getFactClass() ) ).size() );

        kSession.dispose();
    }



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.