Package org.kie.api.runtime

Examples of org.kie.api.runtime.ClassObjectFilter




    protected void checkFirstDataFieldOfTypeStatus(FactType type, boolean valid, boolean missing, String ctx, Object... target) {
        Class<?> klass = type.getFactClass();
        Iterator iter = getKSession().getObjects( new ClassObjectFilter( klass ) ).iterator();
        assertTrue( iter.hasNext() );
        Object obj = iter.next();
        if (ctx == null) {
            while ( type.get( obj, "context" ) != null && iter.hasNext() )
                obj = iter.next();
View Full Code Here


    }


    public Double getDoubleFieldValue( FactType type ) {
        Class<?> klass = type.getFactClass();
        Iterator iter = getKSession().getObjects( new ClassObjectFilter( klass ) ).iterator();
        Object obj = iter.next();
        return (Double) type.get( obj, "value" );
    }
View Full Code Here

        return (Double) type.get( obj, "value" );
    }

    public Object getFieldValue( FactType type ) {
        Class<?> klass = type.getFactClass();
        Iterator iter = getKSession().getObjects( new ClassObjectFilter( klass ) ).iterator();
        Object obj = iter.next();
        return type.get( obj, "value" );
    }
View Full Code Here

        getKSession().getEntryPoint( "in_Cat" ).insert("aa");
        getKSession().getEntryPoint( "in_Sort" ).insert(1);

        getKSession().fireAllRules();

        Collection<EventFactHandle> fact1 = getKSession().getFactHandles(new ClassObjectFilter(getKbase().getFactType(packageName, "Vallued").getFactClass()));
            assertEquals( 1, fact1.size() );
        //assertEquals(true, getKbase().getFactType(packageName, "Vallued").get(fact1.iterator().next().getObject(), "continuous"));

        Collection<EventFactHandle> fact2 = getKSession().getFactHandles(new ClassObjectFilter(getKbase().getFactType(packageName, "Intervalled").getFactClass()));
            assertEquals( 1, fact2.size() );
        //assertEquals(true, getKbase().getFactType(packageName,"Intervalled").get(fact2.iterator().next().getObject(),"continuous"));

        Collection<EventFactHandle> fact3 = getKSession().getFactHandles(new ClassObjectFilter(getKbase().getFactType(packageName, "Cat").getFactClass()));
            assertEquals( 1, fact3.size() );
        //assertEquals(true, getKbase().getFactType(packageName,"Cat").get(fact3.iterator().next().getObject(),"categorical"));

        Collection<EventFactHandle> fact4 = getKSession().getFactHandles(new ClassObjectFilter(getKbase().getFactType(packageName, "Sort").getFactClass()));
            assertEquals( 1, fact4.size() );
        //assertEquals(true, getKbase().getFactType(packageName,"Sort").get(fact4.iterator().next().getObject(),"ordinal"));

    }
View Full Code Here



    protected void checkFirstDataFieldOfTypeStatus(FactType type, boolean valid, boolean missing, String ctx, Object... target) {
        Class<?> klass = type.getFactClass();
        Iterator iter = getKSession().getObjects( new ClassObjectFilter( klass ) ).iterator();
        assertTrue( iter.hasNext() );
        Object obj = iter.next();
        if (ctx == null) {
            while ( type.get( obj, "context" ) != null && iter.hasNext() )
                obj = iter.next();
View Full Code Here

    }


    public Double getDoubleFieldValue( FactType type ) {
        Class<?> klass = type.getFactClass();
        Iterator iter = getKSession().getObjects( new ClassObjectFilter( klass ) ).iterator();
        Object obj = iter.next();
        return (Double) type.get( obj, "value" );
    }
View Full Code Here

        return (Double) type.get( obj, "value" );
    }

    public Object getFieldValue( FactType type ) {
        Class<?> klass = type.getFactClass();
        Iterator iter = getKSession().getObjects( new ClassObjectFilter( klass ) ).iterator();
        Object obj = iter.next();
        return type.get( obj, "value" );
    }
View Full Code Here

        kSession.fireAllRules()//init model

        FactType scoreCardType = getKbase().getFactType( PMML4Helper.pmmlDefaultPackageName(), "ScoreCard" );
        assertNotNull( scoreCardType );

        assertEquals( 1, kSession.getObjects( new ClassObjectFilter( scoreCardType.getFactClass() ) ).size() );
        Object scoreCard = kSession.getObjects( new ClassObjectFilter( scoreCardType.getFactClass() ) ).iterator().next();

        System.out.printreportWMObjects( kSession )
        );
        assertEquals( "SampleScore", scoreCardType.get( scoreCard, "modelName" ) );
        assertEquals( 41.345, scoreCardType.get( scoreCard, "score" ) );
View Full Code Here

        KieSession kSession = ks.newKieContainer( ks.getRepository().getDefaultReleaseId() ).newKieSession();
        setKbase( kSession.getKieBase() );

        kSession.fireAllRules();

        assertEquals( 2, kSession.getObjects( new ClassObjectFilter( ModelMarker.class ) ).size() );
        assertEquals( 11, kSession.getObjects( new ClassObjectFilter( kSession.getKieBase().getFactType( packageName, "Synapse" ).getFactClass() ) ).size() );

        kSession.dispose();

        checkGeneratedRules();
    }
View Full Code Here

        IncrementalResults results = (( InternalKieBuilder ) kb ).incrementalBuild();
        kc.updateToVersion( releaseId1 );

        kSession.fireAllRules();

        assertEquals( 2, kSession.getObjects( new ClassObjectFilter( ModelMarker.class ) ).size() );
        assertEquals( 11, kSession.getObjects( new ClassObjectFilter( kSession.getKieBase().getFactType( packageName, "Synapse" ).getFactClass() ) ).size() );

        kSession.dispose();


        checkGeneratedRules();
View Full Code Here

TOP

Related Classes of org.kie.api.runtime.ClassObjectFilter

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.