Examples of FactType


Examples of org.kie.api.definition.type.FactType

    public void testFunctions1() throws Exception {

        setKSession( getModelSession( source3, true ) );
        setKbase( getKSession().getKieBase() );

        FactType userAge1 = getKbase().getFactType( packageName, "UserAge1" );

        getKSession().getEntryPoint( "in_Age" ).insert( 10 );

        getKSession().fireAllRules();
View Full Code Here

Examples of org.kie.api.definition.type.FactType

    public void testFunctions2() throws Exception {

        setKSession( getModelSession( source3, VERBOSE ) );
        setKbase( getKSession().getKieBase() );

        FactType userAge2 = getKbase().getFactType( packageName, "UserAge2" );

        getKSession().getEntryPoint( "in_Age" ).insert( 10 );

        getKSession().fireAllRules();
View Full Code Here

Examples of org.kie.api.definition.type.FactType

    public void testFunctions3() throws Exception {

        setKSession( getModelSession( source3, VERBOSE ) );
        setKbase( getKSession().getKieBase() );

        FactType userAge3 = getKbase().getFactType( packageName, "UserAge3" );

        getKSession().getEntryPoint( "in_Age" ).insert( 10 );

        getKSession().fireAllRules();
View Full Code Here

Examples of org.kie.api.definition.type.FactType

    public void testFunctions4() throws Exception {

        setKSession( getModelSession( source3, VERBOSE ) );
        setKbase( getKSession().getKieBase() );

        FactType userAge4 = getKbase().getFactType( packageName, "UserAge4" );

        getKSession().getEntryPoint( "in_Age" ).insert( 10 );

        getKSession().fireAllRules();
View Full Code Here

Examples of org.kie.api.definition.type.FactType

    public void testFunctions5() throws Exception {

        setKSession( getModelSession( source3, VERBOSE ) );
        setKbase( getKSession().getKieBase() );

        FactType userAge5 = getKbase().getFactType( packageName, "UserAge5" );

        getKSession().getEntryPoint( "in_Age" ).insert( 10 );

        getKSession().fireAllRules();
View Full Code Here

Examples of org.kie.api.definition.type.FactType

    public void testFunctions6() throws Exception {

        setKSession( getModelSession( source3, VERBOSE ) );
        setKbase( getKSession().getKieBase() );

        FactType userAge6 = getKbase().getFactType( packageName, "UserAge6" );

        getKSession().getEntryPoint( "in_Age" ).insert( 10 );

        getKSession().fireAllRules();
View Full Code Here

Examples of org.kie.api.definition.type.FactType

    public void testFunctionsNested() throws Exception {

        setKSession( getModelSession( source1, VERBOSE ) );
        setKbase( getKSession().getKieBase() );

        FactType userAge1 = getKbase().getFactType( packageName, "UserAge" );

        getKSession().getEntryPoint( "in_Age" ).insert( 10.0 );

        getKSession().fireAllRules();
View Full Code Here

Examples of org.kie.api.definition.type.FactType

    public void testComplexFunctionsNested() throws Exception {

        setKSession( getModelSession( source2, true ) );
        setKbase( getKSession().getKieBase() );

        FactType userAge1 = getKbase().getFactType( packageName, "UserAge" );

        getKSession().getEntryPoint( "in_Age" ).insert( 10.0 );

        getKSession().fireAllRules();
View Full Code Here

Examples of org.kie.api.definition.type.FactType

    public void testComplexFunctionsNested2() throws Exception {

        setKSession( getModelSession( source2, VERBOSE ) );
        setKbase( getKSession().getKieBase() );

        FactType userAge1 = getKbase().getFactType( packageName, "UserAge" );
        FactType userAge2 = getKbase().getFactType( packageName, "UserAgeComplex" );

        FactHandle h = getKSession().getEntryPoint( "in_Age" ).insert( 10.0 );

        getKSession().fireAllRules();

        checkFirstDataFieldOfTypeStatus( userAge1, true, false, null, 6270.0 );
        checkFirstDataFieldOfTypeStatus( userAge2, true, false, null, 44.1 );

        System.out.println( "_________________________________________________________________" );

        FactType age = getKbase().getFactType( packageName, "Age" );
        Object aged = getKSession().getObjects( new ClassObjectFilter( age.getFactClass() ) ).iterator().next();

        getKSession().delete( getKSession().getFactHandle( aged ) );
        getKSession().fireAllRules();

        assertEquals( 0, getKSession().getFactCount() );
View Full Code Here

Examples of org.kie.api.definition.type.FactType

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

        kSession.fireAllRules();
       
        FactType mu = kSession.getKieBase().getFactType( packageName, "DistanceMembership" );
        Collection mus = kSession.getObjects( new ClassObjectFilter( mu.getFactClass()) );
        assertTrue( mus.size() > 0 );
        for ( Object x : mus ) {
            Integer ix = (Integer) mu.get( x, "index" );
            String lab = (String) mu.get( x, "label" );
            Double m = (Double) mu.get( x, "mu" );

            if ( ix == 0 ) {
                assertEquals( "Klust1", lab );
                assertEquals( 41.1, m, 0.001 );
            } else if ( ix == 1 ) {
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.