Package org.kie.api.runtime

Examples of org.kie.api.runtime.ClassObjectFilter


        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        TraitFactory.setMode( mode, ksession.getKieBase() );

        ksession.fireAllRules();

        FactHandle personHandle = ksession.getFactHandles( new ClassObjectFilter( Person.class ) ).iterator().next();
        InternalFactHandle h = ((InternalFactHandle) personHandle);
        ObjectTypeConfigurationRegistry reg = ((InternalWorkingMemoryEntryPoint) h.getEntryPoint()).getObjectTypeConfigurationRegistry();
        ObjectTypeConf conf = reg.getObjectTypeConf( ((InternalWorkingMemoryEntryPoint) h.getEntryPoint()).getEntryPoint(), ((InternalFactHandle) personHandle).getObject() );
        assertTrue( conf.isTMSEnabled() );
View Full Code Here


        }

        ks.retract( handle );
        ks.fireAllRules();

        for ( Object o : ks.getObjects( new ClassObjectFilter( ks.getKieBase().getFactType( "org.drools.test", "Y" ).getFactClass() ) ) ) {
            assertTrue( o instanceof TraitableBean );
            TraitableBean tb = (TraitableBean) o;

            TraitField fld = tb._getFieldTMS().getRegisteredTraitField( "fld" );
            Set<Class<?>> types = fld.getRangeTypes();
View Full Code Here

        assertEquals( Arrays.asList( 1, 2 ), list );

        ks.retract( handle );
        ks.fireAllRules();

        for ( Object o : ks.getObjects( new ClassObjectFilter( ks.getKieBase().getFactType( "org.drools.test", "Y" ).getFactClass() ) ) ) {
            assertTrue( o instanceof TraitableBean );
        }

        try {
            ks = SerializationHelper.getSerialisedStatefulKnowledgeSession( ks, true );
View Full Code Here

        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );

        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        ksession.fireAllRules();

        FactHandle personHandle = ksession.getFactHandles( new ClassObjectFilter( Person.class ) ).iterator().next();
        InternalFactHandle h = ((InternalFactHandle) personHandle);
        ObjectTypeConfigurationRegistry reg = ((InternalWorkingMemoryEntryPoint) h.getEntryPoint()).getObjectTypeConfigurationRegistry();
        ObjectTypeConf conf = reg.getObjectTypeConf( ((InternalWorkingMemoryEntryPoint) h.getEntryPoint()).getEntryPoint(), ((InternalFactHandle) personHandle).getObject() );
        assertTrue( conf.isTMSEnabled() );
View Full Code Here

        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );

        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        ksession.fireAllRules();

        for ( Object o : ksession.getObjects( new ClassObjectFilter( Thing.class ) ) ) {
            Thing t = (Thing) o;
            Object core = t.getCore();
            assertTrue( core instanceof Person );
            assertTrue( core instanceof TraitableBean );
            assertEquals( 1, ( (TraitableBean) core)._getTraitMap().size() );
View Full Code Here

        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );

        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        ksession.fireAllRules();

        for ( Object o : ksession.getObjects( new ClassObjectFilter( Thing.class ) ) ) {
            Thing t = (Thing) o;
            Object core = t.getCore();
            assertTrue( core instanceof Person );
            assertTrue( core instanceof TraitableBean );
            assertEquals( 2, ( (TraitableBean) core)._getTraitMap().size() );
View Full Code Here

        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );

        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        ksession.fireAllRules();

        for ( Object o : ksession.getObjects( new ClassObjectFilter( Thing.class ) ) ) {
            Thing t = (Thing) o;
            Object core = t.getCore();
            assertTrue( core instanceof Person );
            assertTrue( core instanceof TraitableBean );
            assertEquals( 3, ( (TraitableBean) core)._getTraitMap().size() );
View Full Code Here

        assertFalse(verifier.hasErrors());

        boolean noProblems = verifier.fireAnalysis();
        assertTrue(noProblems);

        Collection<? extends Object> subsumptionList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Subsumption.class));
        Collection<? extends Object> redundancyList = ((VerifierImpl) verifier).getKnowledgeSession().getObjects(new ClassObjectFilter(Redundancy.class));

        assertEquals(2,
                     subsumptionList.size());
        assertEquals(1,
                     redundancyList.size());
View Full Code Here

        }

        ks.retract( handle );
        ks.fireAllRules();

        for ( Object o : ks.getObjects( new ClassObjectFilter( ks.getKieBase().getFactType( "org.drools.test", "Y" ).getFactClass() ) ) ) {
            assertTrue( o instanceof TraitableBean );
            TraitableBean tb = (TraitableBean) o;

            TraitField fld = tb._getFieldTMS().getRegisteredTraitField( "fld" );
            Set<Class<?>> types = fld.getRangeTypes();
View Full Code Here

        assertEquals( Arrays.asList( 1, 2 ), list );

        ks.retract( handle );
        ks.fireAllRules();

        for ( Object o : ks.getObjects( new ClassObjectFilter( ks.getKieBase().getFactType( "org.drools.test", "Y" ).getFactClass() ) ) ) {
            assertTrue( o instanceof TraitableBean );
        }

        try {
            ks = SerializationHelper.getSerialisedStatefulKnowledgeSession( ks, true );
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.