Package org.drools.compiler

Examples of org.drools.compiler.CheeseEqual


        KieBaseConfiguration kbc = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kbc.setOption( EqualityBehaviorOption.EQUALITY );
        KnowledgeBase kbase = SerializationHelper.serializeObject( loadKnowledgeBase( kbc ) );
        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

        CheeseEqual cheese = new CheeseEqual( "stilton",
                                              10 );
        ksession.insert( cheese );
        org.kie.api.runtime.rule.FactHandle fh = ksession.getFactHandle( new CheeseEqual( "stilton",
                                                                                         10 ) );
        assertNotNull( fh );
    }
View Full Code Here


        RuleBase ruleBase = RuleBaseFactory.newRuleBase(conf);

        ruleBase = SerializationHelper.serializeObject( ruleBase );
        final StatefulSession session = ruleBase.newStatefulSession();

        CheeseEqual cheese = new CheeseEqual( "stilton",
                                              10 );
        session.insert( cheese );
        FactHandle fh1 = session.getFactHandle( new Cheese( "stilton",
                                                            10 ) );
        assertNull( fh1 );
View Full Code Here

         KieBaseConfiguration kbc = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
         kbc.setOption( EqualityBehaviorOption.EQUALITY );
         KnowledgeBase kbase = SerializationHelper.serializeObject( loadKnowledgeBase( kbc ) );
         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

         CheeseEqual cheese = new CheeseEqual( "stilton",
                                               10 );
         ksession.insert( cheese );
         FactHandle fh = ksession.getFactHandle( new CheeseEqual( "stilton",
                                                                                          10 ) );
         assertNotNull( fh );
     }
View Full Code Here

         KieBaseConfiguration kbc = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
         kbc.setOption(EqualityBehaviorOption.IDENTITY);
         KnowledgeBase kbase = SerializationHelper.serializeObject(loadKnowledgeBase(kbc));
         StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);

         CheeseEqual cheese = new CheeseEqual( "stilton",
                                               10 );
         ksession.insert( cheese );
         FactHandle fh1 = ksession.getFactHandle( new Cheese( "stilton",
                                                             10 ) );
         assertNull( fh1 );
View Full Code Here

        Collection list = ksession.getObjects();
        // CheeseEqual was updated, making it stated, so it wouldn't have been logically deleted
        assertEquals( 1,
                      list.size() );
        assertEquals( new CheeseEqual("person", 3), list.iterator().next());
        FactHandle fh = ksession.getFactHandle( list.iterator().next() );
        ksession.retract( fh );
       
        list = ksession.getObjects();
        assertEquals( 0,
View Full Code Here

       
        List list = IteratorToList.convert( workingMemory.iterateObjects() );
        // CheeseEqual was updated, making it stated, so it wouldn't have been logically retracted
        assertEquals( 1,
                      list.size() );
        assertEquals( new CheeseEqual("person", 3), list.get( 0 ));
        FactHandle fh = workingMemory.getFactHandle( list.get(0) );
        workingMemory.retract( fh );
       
        list = IteratorToList.convert( workingMemory.iterateObjects() );
        assertEquals( 0,
View Full Code Here

         KieBaseConfiguration kbc = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
         kbc.setOption( EqualityBehaviorOption.EQUALITY );
         KnowledgeBase kbase = SerializationHelper.serializeObject( loadKnowledgeBase( kbc ) );
         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

         CheeseEqual cheese = new CheeseEqual( "stilton",
                                               10 );
         ksession.insert( cheese );
         org.kie.api.runtime.rule.FactHandle fh = ksession.getFactHandle( new CheeseEqual( "stilton",
                                                                                          10 ) );
         assertNotNull( fh );
     }
View Full Code Here

         RuleBase ruleBase = RuleBaseFactory.newRuleBase(conf);

         ruleBase = SerializationHelper.serializeObject( ruleBase );
         final StatefulSession session = ruleBase.newStatefulSession();

         CheeseEqual cheese = new CheeseEqual( "stilton",
                                               10 );
         session.insert( cheese );
         FactHandle fh1 = session.getFactHandle( new Cheese( "stilton",
                                                             10 ) );
         assertNull( fh1 );
View Full Code Here

        KieBaseConfiguration kbc = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
        kbc.setOption( EqualityBehaviorOption.EQUALITY );
        KnowledgeBase kbase = SerializationHelper.serializeObject( loadKnowledgeBase( kbc ) );
        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

        CheeseEqual cheese = new CheeseEqual( "stilton",
                                              10 );
        ksession.insert( cheese );
        org.kie.api.runtime.rule.FactHandle fh = ksession.getFactHandle( new CheeseEqual( "stilton",
                                                                                         10 ) );
        assertNotNull( fh );
    }
View Full Code Here

        RuleBase ruleBase = RuleBaseFactory.newRuleBase(conf);

        ruleBase = SerializationHelper.serializeObject( ruleBase );
        final StatefulSession session = ruleBase.newStatefulSession();

        CheeseEqual cheese = new CheeseEqual( "stilton",
                                              10 );
        session.insert( cheese );
        FactHandle fh1 = session.getFactHandle( new Cheese( "stilton",
                                                            10 ) );
        assertNull( fh1 );
View Full Code Here

TOP

Related Classes of org.drools.compiler.CheeseEqual

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.