Package org.drools.runtime

Examples of org.drools.runtime.StatefulKnowledgeSession.update()


                    is( 8 ) );

        Mockito.reset( ael );
        // ---------------- 3rd scenario
        bob.setLikes( "brie" );
        ksession.update( bobHandle,
                         bob );
        ksession.fireAllRules();

        Mockito.verify( ael ).afterActivationFired( cap.capture() );
View Full Code Here


                                                                  false );

                // now try update
                handles[j] = getFactHandle( handles[j],
                                            ksession );
                ksession.update( handles[j],
                                 handles[j].getObject() );

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

                      fromMemory.betaMemory.getLeftTupleMemory().size() );
        assertEquals( 0,
                      notMemory.getRightTupleMemory().size() );

        // do an update and check it's  still memory size 2
        ksession.update( fh,
                         "crackers" );
        assertEquals( 2,
                      accMemory.betaMemory.getRightTupleMemory().size() );
        assertEquals( 2,
                      existsMemory.getRightTupleMemory().size() );
View Full Code Here

                // now try update
                // session was serialised so need to get factHandle
                handles[j] = getFactHandle( handles[j],
                                            ksession );
                ksession.update( handles[j],
                                 handles[j].getObject() );
                ksession = getSerialisedStatefulKnowledgeSession( ksession,
                                                                  true,
                                                                  false );
View Full Code Here

        FactHandle fa1 = (FactHandle) ksession.insert( a1 );
        FactHandle fa2 = (FactHandle) ksession.insert( a2 );

        // make sure the 'exists' is obeyed when fact is cycled causing add/remove node memory
        ksession.update( fa1,
                         a1 );
        ksession.update( fa2,
                         a2 );
        ksession.fireAllRules();
View Full Code Here

        FactHandle fa2 = (FactHandle) ksession.insert( a2 );

        // make sure the 'exists' is obeyed when fact is cycled causing add/remove node memory
        ksession.update( fa1,
                         a1 );
        ksession.update( fa2,
                         a2 );
        ksession.fireAllRules();

        assertEquals( 0,
                      list.size() );
View Full Code Here

        FactHandle fa1 = (FactHandle) ksession.insert( a1 );
        FactHandle fa2 = (FactHandle) ksession.insert( a2 );

        // make sure the 'exists' is obeyed when fact is cycled causing add/remove node memory
        ksession.update( fa1,
                         a1 );
        ksession.update( fa2,
                         a2 );
        ksession.fireAllRules();
View Full Code Here

        FactHandle fa2 = (FactHandle) ksession.insert( a2 );

        // make sure the 'exists' is obeyed when fact is cycled causing add/remove node memory
        ksession.update( fa1,
                         a1 );
        ksession.update( fa2,
                         a2 );
        ksession.fireAllRules();

        assertEquals( 2,
                      list.size() );
View Full Code Here

        assertEquals( 0,
                      list.size() );

        // modify a2, so that a1 is now blocked by a3
        a2.setField2( "1" ); // Do
        ksession.update( fa2,
                         a2 );
        a2.setField2( "2" ); // Undo
        ksession.update( fa2,
                         a2 );
View Full Code Here

        // modify a2, so that a1 is now blocked by a3
        a2.setField2( "1" ); // Do
        ksession.update( fa2,
                         a2 );
        a2.setField2( "2" ); // Undo
        ksession.update( fa2,
                         a2 );

        // modify a3 to cycle, so that it goes on the memory end, but in a previous bug still blocked a1
        ksession.update( fa3,
                         a3 );
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.