Examples of FactType


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

    @Test
    public void testContinuousDomainValues() throws Exception {


        FactType vals = getKbase().getFactType(packageName,"Vallued");
            assertNotNull( vals );
//        FactType defval = getKbase().getFactType(packageName,"DefaultValid");
//            assertNotNull(vals);
//        FactType definv = getKbase().getFactType(packageName,"DefaultInvalid");
//            assertNotNull(vals);

        Object data1 = vals.newInstance();
            vals.set(data1,"value",1);
        Object data2 = vals.newInstance();
            vals.set(data2,"value",2);
        Object data3 = vals.newInstance();
            vals.set(data3,"value",3);
        Object data0 = vals.newInstance();
            vals.set(data0,"value",0);
        Object data99 = vals.newInstance();
            vals.set(data99,"value",-1);

        getKSession().insert(data1);
        getKSession().insert(data2);
        getKSession().insert(data3);
        getKSession().insert(data0);
        getKSession().insert(data99);


        getKSession().fireAllRules();

        assertEquals( true, vals.get( data1, "valid" ) );
        assertEquals( false, vals.get( data1, "missing" ) );

        assertEquals( true, vals.get( data2, "valid" ) );
        assertEquals( false, vals.get( data2, "missing" ) );

        assertEquals( false, vals.get( data3, "valid" ) );
        assertEquals( false, vals.get( data3, "missing" ) );

        assertEquals( false, vals.get( data0, "valid" ) );
        assertEquals( true, vals.get( data0, "missing" ) );

        assertEquals( false, vals.get( data99, "valid" ) );
        assertEquals( false, vals.get( data99, "missing" ) );

    }
View Full Code Here

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

        getKSession().dispose();
    }

    @Test
    public void testKonst() throws Exception {
        FactType konst = getKbase().getFactType(packageName, "Konst");
        assertNotNull(konst);

        getKSession().fireAllRules();

        System.out.println(reportWMObjects(getKSession()));
View Full Code Here

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

    }


    @Test
    public void testAlias() throws Exception {
        FactType alias = getKbase().getFactType( packageName, "AliasAge" );
        FactType aliasmm = getKbase().getFactType( packageName, "AliasAgeMM" );
        assertNotNull( alias );
        assertNotNull( aliasmm );

        getKSession().getEntryPoint( "in_Age" ).insert( 33 );
        getKSession().fireAllRules();
View Full Code Here

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

    }

    @Test
    public void testNormDiscrete() throws Exception {

        FactType fld = getKbase().getFactType(packageName,"CatField");
        FactType val1 = getKbase().getFactType(packageName,"IsValue1");
        FactType val2 = getKbase().getFactType(packageName,"IsValue2");

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

        //value is "missing" for age, so should be mapped by the mapMissingTo policy
        getKSession().getEntryPoint( "in_CatField" ).insert("Value1");
View Full Code Here

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

    public void testDerivedTypesLinearNormMapMissing() throws Exception {

        //new PMML4Wrapper().getPmml().getTransformationDictionary().getDerivedField().get(0).getNormContinuous().getOutliers().value()


        FactType age = getKbase().getFactType(packageName,"Age");
        FactType age1 = getKbase().getFactType(packageName,"Age_norm");
        FactType age2 = getKbase().getFactType(packageName,"Age_norm2");
        FactType age3 = getKbase().getFactType(packageName,"Age_norm3");

        assertNotNull(getKSession().getEntryPoint( "in_Age" ));
        assertNull(getKSession().getEntryPoint( "in_Age_mis" ));
        assertNull(getKSession().getEntryPoint( "in_Age_norm" ));
View Full Code Here

Examples of org.kie.definition.type.FactType

    public FactType getFactType( final String name ) {
        readLock();
        try {
            for (Package pkg : this.pkgs.values()) {
                FactType type = pkg.getFactType( name );
                if (type != null) {
                    return type;
                }
            }
            return null;
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.