Package org.kie.api.definition.type

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


    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

    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

    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

        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

        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        FactType tgt = kSession.getKieBase().getFactType( packageName, "Fld4" );

        kSession.getEntryPoint( "in_Fld1" ).insert( 0.9 );
        kSession.getEntryPoint( "in_Fld2" ).insert( 0.3 );
        kSession.getEntryPoint( "in_Fld3" ).insert( "x" );
        kSession.fireAllRules();
View Full Code Here

        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        FactType tgt = kSession.getKieBase().getFactType( packageName, "Fld4" );

        kSession.getEntryPoint( "in_Fld1" ).insert( 1.0 );
        kSession.getEntryPoint( "in_Fld2" ).insert( 1.0 );
        kSession.getEntryPoint( "in_Fld3" ).insert( "x" );
        kSession.fireAllRules();
View Full Code Here

        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        FactType ztype = kSession.getKieBase().getFactType( packageName, "Z" );
        assertNotNull( ztype );

        kSession.getEntryPoint( "in_X" ).insert( 0.0 );
        kSession.getEntryPoint( "in_Y" ).insert( 0.0 );
        kSession.fireAllRules();
View Full Code Here

        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        FactType ztype = kSession.getKieBase().getFactType( packageName, "Z" );
        assertNotNull( ztype );


        kSession.getEntryPoint( "in_X" ).insert( 0.0 );
        kSession.getEntryPoint( "in_Y" ).insert( 0.0 );
View Full Code Here

        setKbase( getKSession().getKieBase() );
        KieSession kSession = getKSession();

        kSession.fireAllRules()//init model

        FactType ztype = kSession.getKieBase().getFactType( packageName, "Z" );
        assertNotNull( ztype );


        kSession.getEntryPoint( "in_X" ).insert( 0.63 );
        kSession.getEntryPoint( "in_Y" ).insert( 0.0 );
View Full Code Here

TOP

Related Classes of org.kie.api.definition.type.FactType

Copyright © 2018 www.massapicom. 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.