Package org.kie.api.definition.type

Examples of org.kie.api.definition.type.FactType.newInstance()


         Object person = pf.newInstance();
         pf.set( person,
                 "creditRating",
                 "OK" );

         Object application = af.newInstance();
         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
         ksession.insert( person );
         ksession.insert( application );

         ksession.fireAllRules();
View Full Code Here


         // Retrieve the generated fact type
         FactType cheeseFact = kbase.getFactType( "org.drools.generatedbeans",
                                                  "Cheese" );

         // Create a new Fact instance
         Object cheese = cheeseFact.newInstance();

         cheeseFact.set( cheese,
                         "type",
                         "stilton" );
         assertEquals( "stilton",
View Full Code Here

         assertEquals( "stilton",
                       cheeseFact.get( cheese,
                                       "type" ) );

         // testing equals method
         Object cheese2 = cheeseFact.newInstance();
         cheeseFact.set( cheese2,
                         "type",
                         "stilton" );
         assertEquals( cheese,
                       cheese2 );
View Full Code Here

                       cheese2 );

         FactType personType = kbase.getFactType( "org.drools.generatedbeans",
                                                  "Person" );

         Object ps = personType.newInstance();
         personType.set( ps,
                         "name",
                         "mark" );
         personType.set( ps,
                         "last",
View Full Code Here

                         "proctor" );
         personType.set( ps,
                         "age",
                         42 );

         Object ps2 = personType.newInstance();
         personType.set( ps2,
                         "name",
                         "mark" );
         personType.set( ps2,
                         "last",
View Full Code Here

         // Retrieve the generated fact type
         FactType personFact = kbase.getFactType( "org.drools.generatedbeans",
                                                  "Person" );

         // Create a new Fact instance
         Object person = personFact.newInstance();

         // Set a field value using the more verbose method chain...
         // should we add short cuts?
         personFact.getField( "likes" ).set( person,
                                             cheese );
View Full Code Here

         List list = new ArrayList();
         session.setGlobal( "list",
                            list );

         FactType addressFact = kbase.getFactType( "com.jboss.qa", "Address" );
         Object address = addressFact.newInstance();
         session.insert( address );
         session.fireAllRules();

         list = (List) session.getGlobal( "list" );
         assertEquals( 1,
View Full Code Here

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

        FactType ft = kbase.getFactType( "com.sample", "FactTest" );

        ksession.insert( ft.newInstance() );
        ksession.fireAllRules();
        ksession.insert( ft.newInstance() );
        ksession.fireAllRules();
        ksession.insert( ft.newInstance() );
        ksession.fireAllRules();
View Full Code Here

        FactType ft = kbase.getFactType( "com.sample", "FactTest" );

        ksession.insert( ft.newInstance() );
        ksession.fireAllRules();
        ksession.insert( ft.newInstance() );
        ksession.fireAllRules();
        ksession.insert( ft.newInstance() );
        ksession.fireAllRules();

        SessionPseudoClock clock = ksession.getSessionClock();
View Full Code Here

        ksession.insert( ft.newInstance() );
        ksession.fireAllRules();
        ksession.insert( ft.newInstance() );
        ksession.fireAllRules();
        ksession.insert( ft.newInstance() );
        ksession.fireAllRules();

        SessionPseudoClock clock = ksession.getSessionClock();
        clock.advanceTime( 1, TimeUnit.MINUTES );
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.