Examples of PersonInterface


Examples of org.drools.PersonInterface

        ruleBase.addPackage( pkg1 );
        ruleBase = SerializationHelper.serializeObject( ruleBase );
        final WorkingMemory workingMemory = ruleBase.newStatefulSession();

        // Adding person with null name and likes attributes
        final PersonInterface bob = new Person( null,
                                                null );
        bob.setStatus( "P1" );
        final PersonInterface pete = new Person( null,
                                                 null );
        bob.setStatus( "P2" );
        workingMemory.insert( bob );
        workingMemory.insert( pete );

        workingMemory.fireAllRules();

        assertEquals( "Indexing with null values is not working correctly.",
                      "OK",
                      bob.getStatus() );
        assertEquals( "Indexing with null values is not working correctly.",
                      "OK",
                      pete.getStatus() );

    }
View Full Code Here

Examples of org.drools.PersonInterface

        final FactHandle stiltonHandle = workingMemory.insert( stilton );
        final Cheese cheddar = new Cheese( "cheddar",
                                           7 );
        final FactHandle cheddarHandle = workingMemory.insert( cheddar );

        final PersonInterface paul = new Person( "paul",
                                                 "stilton",
                                                 12 );
        workingMemory.insert( paul );
        workingMemory.fireAllRules();
View Full Code Here

Examples of org.drools.PersonInterface

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

        final PersonInterface person = new Person( "Edson",
                                                   "cheese" );
        workingMemory.insert( person );

        workingMemory.fireAllRules();
View Full Code Here

Examples of org.drools.PersonInterface

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

        final PersonInterface person10 = new Person( "bob",
                                                     "cheese",
                                                     10 );
        workingMemory.insert( person10 );

        final PersonInterface person20 = new Person( "mic",
                                                     "cheese",
                                                     20 );
        workingMemory.insert( person20 );

        workingMemory.fireAllRules();
View Full Code Here

Examples of org.drools.compiler.PersonInterface

     public void testNullValuesIndexing() throws Exception {
         KnowledgeBase kbase = SerializationHelper.serializeObject( loadKnowledgeBase( "test_NullValuesIndexing.drl" ) );
         StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

         // Adding person with null name and likes attributes
         final PersonInterface bob = new Person( null,
                                                 null );
         bob.setStatus( "P1" );
         final PersonInterface pete = new Person( null,
                                                  null );
         bob.setStatus( "P2" );
         ksession.insert( bob );
         ksession.insert( pete );

         ksession.fireAllRules();

         assertEquals( "Indexing with null values is not working correctly.",
                       "OK",
                       bob.getStatus() );
         assertEquals( "Indexing with null values is not working correctly.",
                       "OK",
                       pete.getStatus() );
     }
View Full Code Here

Examples of org.drools.compiler.PersonInterface

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

         final PersonInterface bill = new Person( "bill",
                                                  null,
                                                  12 );
         bill.setAlive( true );
         session.insert( bill );
         session = SerializationHelper.getSerialisedStatefulKnowledgeSession( session,
                                                                              true );

         session.fireAllRules();
View Full Code Here

Examples of org.drools.compiler.PersonInterface

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

         final PersonInterface bill = new Person( "bill",
                                                  null,
                                                  42 );
         bill.setBigDecimal( new BigDecimal( "42" ) );

         final PersonInterface ben = new Person( "ben",
                                                 null,
                                                 43 );
         ben.setBigDecimal( new BigDecimal( "43" ) );

         session.insert( bill );
         session.insert( new Cheese( "gorgonzola", 43 ) );
         session.insert( ben );
         session = SerializationHelper.getSerialisedStatefulKnowledgeSession( session,
View Full Code Here

Examples of org.drools.compiler.PersonInterface

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

         final PersonInterface bill = new Person( "bill",
                                                  null,
                                                  12 );
         bill.setBigDecimal( new BigDecimal( "42" ) );
         bill.setBigInteger( new BigInteger( "42" ) );

         session.insert( bill );
         session = SerializationHelper.getSerialisedStatefulKnowledgeSession( session,
                                                                              true );
         session.fireAllRules();
View Full Code Here

Examples of org.drools.compiler.PersonInterface

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

         final PersonInterface peter = new Person( "peter",
                                                   null,
                                                   12 );
         ksession.insert( peter );
         final PersonInterface jane = new Person( "jane",
                                                  null,
                                                  10 );
         ksession.insert( jane );

         ksession = SerializationHelper.getSerialisedStatefulKnowledgeSession( ksession, true );
View Full Code Here

Examples of org.drools.compiler.PersonInterface

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

         final PersonInterface peter = new Person( "peter",
                                                   null,
                                                   12 );
         ksession.insert( peter );
         final PersonInterface jane = new Person( "jane",
                                                  null,
                                                  10 );
         ksession.insert( jane );

         ksession = SerializationHelper.getSerialisedStatefulKnowledgeSession( ksession,
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.