Package org.kie.api.runtime

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


    public void testSimpleTreeOutput() throws Exception {
        setKSession( getModelSession( source2, VERBOSE ) );
        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        FactType tgt = kSession.getKieBase().getFactType( packageName, "Fld9" );
        FactType tok = kSession.getKieBase().getFactType( PMML4Helper.pmmlDefaultPackageName(), "TreeToken" );

        kSession.getEntryPoint( "in_Fld1" ).insert( -1.0 );
View Full Code Here


        kSession.getEntryPoint( "in_Fld1" ).insert( -1.0 );
        kSession.getEntryPoint( "in_Fld2" ).insert( -1.0 );
        kSession.getEntryPoint( "in_Fld3" ).insert( "optA" );

        kSession.fireAllRules();

        Object token = getToken( kSession );
        assertEquals( 0.8, tok.get( token, "confidence" ) );
        assertEquals( "null", tok.get( token, "current" ) );
        assertEquals( 50.0, tok.get( token, "totalCount" ) );
View Full Code Here

    @Test
    public void testNaiveBayes() throws Exception {
        KieSession kieSession = getModelSession( source1, VERBOSE );
        setKSession( kieSession );

        kieSession.fireAllRules()//init model

        kieSession.getEntryPoint( "in_Gender" ).insert( "male" );
        kieSession.getEntryPoint( "in_NoOfClaims" ).insert( "2" );
        kieSession.getEntryPoint( "in_AgeOfCar" ).insert( 1.0 );
View Full Code Here

        kieSession.getEntryPoint( "in_Gender" ).insert( "male" );
        kieSession.getEntryPoint( "in_NoOfClaims" ).insert( "2" );
        kieSession.getEntryPoint( "in_AgeOfCar" ).insert( 1.0 );

        kieSession.fireAllRules();

        QueryResults q1 = kieSession.getQueryResults( "ProbabilityOf500", "NaiveBayesInsurance", Variable.v );
        assertEquals( 1, q1.size() );
        Object a1 = q1.iterator().next().get( q1.getIdentifiers()[ 1 ] );
        assertTrue( a1 instanceof Double );
View Full Code Here


    @Test
    public void testCleanupANN() {
        KieSession kSession = getModelSession( source1 );
        kSession.fireAllRules();
        assertTrue( kSession.getObjects().size() > 0 );

        Collection qres = getModelMarker( kSession, "Neuiris" );
        assertEquals( 1, qres.size() );
View Full Code Here

        Collection qres = getModelMarker( kSession, "Neuiris" );
        assertEquals( 1, qres.size() );

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

        assertEquals( 1, kSession.getObjects().size() );
        kSession.dispose();
    }
View Full Code Here


    @Test
    public void testCleanupDT() {
        KieSession kSession = getModelSession( source2 );
        kSession.fireAllRules();
        assertTrue( kSession.getObjects().size() > 0 );

        Collection qres = getModelMarker( kSession, "TreeTest" );
        assertEquals( 1, qres.size() );
View Full Code Here

        Collection qres = getModelMarker( kSession, "TreeTest" );
        assertEquals( 1, qres.size() );

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

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

        kSession.dispose();
    }
View Full Code Here

    }

    @Test
    public void testCleanupRegression() {
        KieSession kSession = getModelSession( source3 );
        kSession.fireAllRules();
        assertTrue( kSession.getObjects().size() > 0 );

        Collection qres = getModelMarker( kSession, "LinReg" );
        assertEquals( 1, qres.size() );
View Full Code Here

        Collection qres = getModelMarker( kSession, "LinReg" );
        assertEquals( 1, qres.size() );

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

        assertEquals( 1, kSession.getObjects().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.