Package org.drools.compiler

Examples of org.drools.compiler.PolymorphicFact


        final List list = new ArrayList();
        ksession.setGlobal( "results",
                            list );

        final PolymorphicFact fact = new PolymorphicFact( new Integer( 10 ) );
        final org.kie.api.runtime.rule.FactHandle handle = ksession.insert( fact );

        ksession.fireAllRules();

        assertEquals( 1,
                      list.size() );
        assertEquals( fact.getData(),
                      list.get( 0 ) );

        fact.setData( "10" );
        ksession.update( handle,
                         fact );
        ksession.fireAllRules();

        assertEquals( 2,
                      list.size() );
        assertEquals( fact.getData(),
                      list.get( 1 ) );

        try {
            fact.setData( new Boolean( true ) );
            ksession.update( handle,
                             fact );

            assertEquals( 2,
                          list.size() );
View Full Code Here

TOP

Related Classes of org.drools.compiler.PolymorphicFact

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.