Package org.kie.api.definition.type

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


    public void testEntryPoints() throws Exception {

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

        FactType gender = getKbase().getFactType(packageName,"Gender");
        FactType noclaims = getKbase().getFactType(packageName,"NoOfClaims");
        FactType scrambled = getKbase().getFactType(packageName,"Scrambled");
        FactType domicile = getKbase().getFactType(packageName,"Domicile");
        FactType agecar = getKbase().getFactType(packageName,"AgeOfCar");
        FactType amklaims = getKbase().getFactType(packageName,"AmountOfClaims");

        assertEquals( 7, getKSession().getEntryPoints().size() );

        EntryPoint gender_ep = getKSession().getEntryPoint("in_Gender");
            Assert.assertNotNull(gender_ep);
        EntryPoint noclaims_ep = getKSession().getEntryPoint("in_NoOfClaims");
            Assert.assertNotNull(noclaims_ep);
        EntryPoint scrambled_ep = getKSession().getEntryPoint("in_Scrambled");
            Assert.assertNotNull(scrambled_ep);
        EntryPoint domicile_ep = getKSession().getEntryPoint("in_Domicile");
            Assert.assertNotNull(domicile_ep);
        EntryPoint agecar_ep = getKSession().getEntryPoint("in_AgeOfCar");
            Assert.assertNotNull(agecar_ep);
        EntryPoint amklaims_ep = getKSession().getEntryPoint("in_AmountOfClaims");
            Assert.assertNotNull(amklaims_ep);

        gender_ep.insert("M");
        noclaims_ep.insert("> 4");
        scrambled_ep.insert(4);
        domicile_ep.insert("way out");
        agecar_ep.insert(new Double("3.4"));
        amklaims_ep.insert(9);

        getKSession().fireAllRules();

        assertEquals( 6, getKSession().getObjects().size() );
        assertEquals( 1, getKSession().getObjects( new ClassObjectFilter( gender.getFactClass() ) ).size() );
        assertEquals( 1, getKSession().getObjects( new ClassObjectFilter( noclaims.getFactClass() ) ).size() );
        assertEquals( 1, getKSession().getObjects( new ClassObjectFilter( scrambled.getFactClass() ) ).size() );
        assertEquals( 1, getKSession().getObjects( new ClassObjectFilter( domicile.getFactClass() ) ).size() );
        assertEquals( 1, getKSession().getObjects( new ClassObjectFilter( agecar.getFactClass() ) ).size() );
        assertEquals( 1, getKSession().getObjects( new ClassObjectFilter( amklaims.getFactClass() ) ).size() );


        checkFirstDataFieldOfTypeStatus(amklaims,true,false, null,9);

        checkFirstDataFieldOfTypeStatus(domicile,false,false,null,"way out");
View Full Code Here



    @Test
    public void testDiscretize() throws Exception {

        FactType age = getKbase().getFactType(packageName,"Age");
        FactType cat = getKbase().getFactType(packageName,"AgeCategories");

        assertNotNull(getKSession().getEntryPoint("in_Age"));


        getKSession().getEntryPoint("in_Age").insert(-1);
View Full Code Here

    public void testMapValues() throws Exception {

//        FactType age = getKbase().getFactType(packageName,"Age");
//        FactType hgt = getKbase().getFactType(packageName,"Height");
//        FactType hair = getKbase().getFactType(packageName,"HairColor");
        FactType out = getKbase().getFactType(packageName,"Mapped");

        getKSession().getEntryPoint( "in_Age" ).insert(18);
        getKSession().getEntryPoint( "in_Height" ).insert(80.0);
        getKSession().getEntryPoint( "in_HairColor" ).insert("red");
View Full Code Here

    public void testFunctions0() throws Exception {

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

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

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

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

    public void testFunctions0Overwrite() throws Exception {

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

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

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

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

    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

    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

    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

    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

    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

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.