Package org.drools

Examples of org.drools.WorkingMemory.fireAllRules()


                System.err.println( "----------------------------------------" );

                System.err.println( bobTicket );
                System.err.println( daveTicket );
               
                workingMemory.fireAllRules();

                System.err.println( "----------------------------------------" );

                try
                {
View Full Code Here


                {
                    cell = rowOfCells[j];
                    workingMemory.assertObject( cell );
                }
            }
            workingMemory.fireAllRules( );
            didStateChange = transitionState( );
        }
        catch ( Exception e )
        {
            e.printStackTrace( );
View Full Code Here

        workingMemory.assertObject( a, dynamic );
        workingMemory.assertObject( b, dynamic );
        workingMemory.assertObject( c, dynamic );
        workingMemory.assertObject( d, dynamic );

        workingMemory.fireAllRules( );
    }
}
View Full Code Here

    try {
      for (Iterator objectIter = objects.iterator(); objectIter.hasNext();) {
        workingMemory.assertObject(objectIter.next());
      }

      workingMemory.fireAllRules();
    } catch (FactException e) {
      throw new InvalidRuleSessionException(e.getMessage(), e);
    }

    List results = workingMemory.getObjects();
View Full Code Here

        // test serialization
        workingMemory = serializeWorkingMemory( workingMemory );
        workingMemory = serializeWorkingMemory( workingMemory );

        workingMemory.fireAllRules( );

        // test serialization
        workingMemory = serializeWorkingMemory( workingMemory );
        workingMemory = serializeWorkingMemory( workingMemory );
View Full Code Here

        workingMemory.insert( stilton );

        final Cheese cheddar = new Cheese( "cheddar",
                                           5 );
        workingMemory.insert( cheddar );
        workingMemory.fireAllRules();

        assertEquals( 1,
                      list.size() );

        assertEquals( "stilton",
View Full Code Here

        final Cheese stilton = new Cheese( "stilton",
                                           5 );
        workingMemory.insert( stilton );

        workingMemory.fireAllRules();

        assertEquals( new Integer( 5 ),
                      list.get( 0 ) );

        // Check a function can be removed from a package.
View Full Code Here

        final Cheese cheddar = new Cheese( "cheddar",
                                           5 );
        workingMemory.insert( cheddar );

        try {
            workingMemory.fireAllRules();
            fail( "Function should have been removed and NoClassDefFoundError thrown from the Consequence" );
        } catch ( final NoClassDefFoundError e ) {
        }

        // Check a new function can be added to replace an old function
View Full Code Here

        final Cheese brie = new Cheese( "brie",
                                        5 );
        workingMemory.insert( brie );

        workingMemory.fireAllRules();

        assertEquals( new Integer( 6 ),
                      list.get( 1 ) );

        builder = new PackageBuilder();
View Full Code Here

        final Cheese feta = new Cheese( "feta",
                                        5 );
        workingMemory.insert( feta );

        workingMemory.fireAllRules();

        assertEquals( new Integer( 5 ),
                      list.get( 2 ) );
    }
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.