Package org.drools.runtime

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


            }
        } );

        txTemplate.execute( new TransactionCallback() {
            public Object doInTransaction(TransactionStatus status) {
                ksession2.fireAllRules();
                return null;
            }
        } );

        assertEquals( 6,
View Full Code Here


                           new MyObject( "myGlobalObj" ) );

        FactHandle handle = session.insert( new MyObject( "myObj1" ) );
        assertNotNull( handle );

        int fired = session.fireAllRules();
        assertEquals( 1,
                                 fired );

        session.retract( handle );
View Full Code Here

        handle = session.insert( new MyObject( "myObj2" ) );

        session.update( handle,
                        new MyObject( "myObj3" ) );

        fired = session.fireAllRules();

        remoteN1.dispose();
        grid1.get( SocketService.class ).close();
    }
View Full Code Here

        kstateful.setGlobal( "list",
                             list );
        kstateful.insert( new Person( "Darth",
                                      "Cheddar",
                                      50 ) );
        kstateful.fireAllRules();
        assertEquals( 1,
                      list.size() );
    }

    @Test
View Full Code Here

        kstateful.setGlobal( "list",
                             list );
        kstateful.insert( new Person( "Darth",
                                      "Cheddar",
                                      50 ) );
        kstateful.fireAllRules();
        assertEquals( 2,
                      list.size() );
    }

    @Test
View Full Code Here

        kstateful.setGlobal( "list",
                             list );
        kstateful.insert( new Person( "Darth",
                                      "Cheddar",
                                      50 ) );
        kstateful.fireAllRules();
        assertEquals( 2,
                      list.size() );
    }

    @Test
View Full Code Here

        //                                                                      MarshallerFactory.newIdentityMarshallingStrategy(),
                                                                              false );

        results = (List) ksession.getGlobal( "results" );

        ksession.fireAllRules();

        assertEquals( 0,
                      results.size() );

        kbase.removeKnowledgePackage( "org.drools" );
View Full Code Here

        ksession = SerializationHelper.getSerialisedStatefulKnowledgeSession( ksession,
        //                                                                      MarshallerFactory.newIdentityMarshallingStrategy(),
                                                                              false );

        results = (List) ksession.getGlobal( "results" );
        ksession.fireAllRules();

        assertEquals( 1,
                      results.size() );
    }
View Full Code Here

        ep.insert( new StockTick( 3,
                                  "RHT",
                                  22,
                                  20000 ) );

        ksession.fireAllRules();
        assertEquals( 3,
                      results.size() );

    }
View Full Code Here

        addDrlToKBase( kbase, "test_JBRULES_2206_1.drl" );
       
        // two matching rules were added, so 2 activations should have been created
        verify( ael, times(2) ).activationCreated( any( ActivationCreatedEvent.class ) );
        int fireCount = session.fireAllRules();
        // both should have fired
        assertEquals( 2, fireCount );
       
        addDrlToKBase( kbase, "test_JBRULES_2206_2.drl" );
       
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.