Package org.drools.compiler

Examples of org.drools.compiler.PersonInterface


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

         final PersonInterface person = new Person( "michael",
                                                    "cheese" );
         person.setStatus( "start" );
         ksession.insert( person );

         // TODO ConsequenceException: org.drools.core.FactException: Update error: handle not found for object:
         //        ksession    = SerializationHelper.serializeObject(ksession);
         ksession.fireAllRules();
View Full Code Here


     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

        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

        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

        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

        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

        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

    @Test
    public void testNullBehaviour() throws Exception {
        KnowledgeBase kbase = loadKnowledgeBase( "null_behaviour.drl" );
        StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();

        final PersonInterface p1 = new Person( "michael",
                                               "food",
                                               40 );
        final PersonInterface p2 = new Person( null,
                                               "drink",
                                               30 );
        session.insert( p1 );
        session.insert( p2 );
View Full Code Here

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

        final PersonInterface p1 = new Person( null,
                                               "food",
                                               40 );
        final Primitives p2 = new Primitives();
        p2.setArrayAttribute( null );
View Full Code Here

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

        final PersonInterface person = new Person( "michael",
                                                   "cheese" );
        person.setStatus( "start" );
        ksession.insert( person );

        // TODO ConsequenceException: org.drools.core.FactException: Update error: handle not found for object:
        //        ksession    = SerializationHelper.serializeObject(ksession);
        ksession.fireAllRules();
View Full Code Here

TOP

Related Classes of org.drools.compiler.PersonInterface

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.