Package org.drools.compiler

Examples of org.drools.compiler.Person


         Cheese cheese = new Cheese( "stilton",
                                     10 );
         Cheesery cheesery = new Cheesery();
         cheesery.addCheese( cheese );
         Person bob = new Person( "bob",
                                  "stilton" );
         Cheese cheese2 = new Cheese();
         bob.setCheese( cheese2 );

         FactHandle p = session.insert( bob );
         FactHandle c = session.insert( cheesery );

         session.fireAllRules();
View Full Code Here


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

         final Person bob = new Person( "Bob",
                                        15 );
         final Person mark = new Person( "Mark",
                                         16 );
         final Person michael = new Person( "Michael",
                                            14 );
         session.insert( bob );
         session.insert( mark );
         session.insert( michael );
         session.getAgenda().getAgendaGroup( "feeding" ).setFocus();
View Full Code Here

         final StatefulKnowledgeSession session = createKnowledgeSession( kbase );
         session.setGlobal( "results",
                            results );

         Person bob = new Person( "Bob",
                                  20 );
         bob.setAlive( true );
         Person foo = new Person( "Foo",
                                  0 );
         foo.setAlive( false );

         session.insert( bob );
         session.fireAllRules();

         assertEquals( 1,
View Full Code Here

         ksession.setGlobal( "results",
                             results );
         ksession.insert( new Cheese( "stilton" ) );
         ksession.insert( new Cheese( "brie" ) );
         ksession.insert( new Cheese( "muzzarella" ) );
         ksession.insert( new Person( "bob",
                                      "stilton" ) );
         ksession.fireAllRules();
         assertEquals( 2,
                       results.size() );
         assertEquals( "stilton",
View Full Code Here

         Thread t1 = new Thread( fireUntilHalt );
         t1.start();

         Thread.currentThread().sleep( 500 );
         ep.insert( new Person( "darth" ) );
         Thread.currentThread().sleep( 500 );
         ksession.halt();
         t1.join( 5000 );
         boolean alive = t1.isAlive();
         if ( alive ) {
View Full Code Here

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

         list.add( new Person( "darth" ) );
         ep.insert( new Cheese( "cheddar" ) );

         ksession.fireAllRules();
         assertEquals( 3,
                       list.size() );
View Full Code Here

         KnowledgeBase kbase = loadKnowledgeBaseFromString( drl );
         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );
         List list = new ArrayList();
         ksession.setGlobal("list", list);

         Person p = new Person( "Toni" );
         ksession.insert( p);
         ksession.insert( new Pet( "Toni" ) );

         ksession.fireAllRules();
View Full Code Here

         rule += "end";

         KnowledgeBase kbase = SerializationHelper.serializeObject( loadKnowledgeBaseFromString( rule ) );
         StatefulKnowledgeSession session = createKnowledgeSession( kbase );

         Person toni = new Person( "Toni",
                                   12 );
         toni.setPet( new Pet( "Mittens" ) );

         session.insert( new ArrayList() );
         session.insert( toni );

         session.fireAllRules();
View Full Code Here

         rule += "end";

         KnowledgeBase kbase = SerializationHelper.serializeObject( loadKnowledgeBaseFromString( rule ) );
         StatefulKnowledgeSession session = createKnowledgeSession( kbase );

         Person toni = new Person( "Toni",
                                   12 );
         toni.setPet( new Pet( "Mittens" ) );

         session.insert( new ArrayList() );
         session.insert( toni );

         session.fireAllRules();
View Full Code Here

         rule += "end";

         KnowledgeBase kbase = SerializationHelper.serializeObject( loadKnowledgeBaseFromString( rule ) );
         StatefulKnowledgeSession session = createKnowledgeSession( kbase );

         Person person = new Person();

         person.setPet( new Cat( "Mittens" ) );

         session.insert( person );

         session.fireAllRules();
     }
View Full Code Here

TOP

Related Classes of org.drools.compiler.Person

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.