Package org.drools

Examples of org.drools.WorkingMemory.fireAllRules()


            workingMemory = ruleBase.newWorkingMemory( );
            list = new ArrayList( );
            workingMemory.setApplicationData( "list",
                                              list );
            workingMemory.assertObject( "help" );
            workingMemory.fireAllRules( );
            assertEquals( "help",
                          list.get( 0 ) );

            // Try with URL to Distribution conf file
            ruleBaseLoader = new RuleBaseLoader( );
View Full Code Here


            workingMemory = ruleBase.newWorkingMemory( );
            list = new ArrayList( );
            workingMemory.setApplicationData( "list",
                                              list );
            workingMemory.assertObject( "help" );
            workingMemory.fireAllRules( );
            assertEquals( "help",
                          list.get( 0 ) );

        }
        catch ( Exception e )
View Full Code Here

        }
        for (HeatPump pump : simulator.getHeatPumps()) {
            workingMemory.assertObject(pump, true);
        }
        System.out.println("---- begin initial fireAllRules");
        workingMemory.fireAllRules();
        System.out.println("---- end initial fireAllRules");

        // The 'executor' bean is lazy-init so we can control when the simulator starts
        // (which is now). Alternatively, we could have defined a start method to begin
        // the simulation.
View Full Code Here

        System.out.println("FIRE RULES(Hello)");
        System.out.println("----------");
        WorkingMemory workingMemory = ruleBase.newWorkingMemory();
        workingMemory.addEventListener(new DebugWorkingMemoryEventListener());
        workingMemory.assertObject("Hello");
        workingMemory.fireAllRules();
       
        System.out.println( "\n" );

        System.out.println("FIRE RULES(GoodBye)");
        System.out.println("----------");
View Full Code Here

        System.out.println("FIRE RULES(GoodBye)");
        System.out.println("----------");
        workingMemory = ruleBase.newWorkingMemory( );
        workingMemory.addEventListener(new DebugWorkingMemoryEventListener());
        workingMemory.assertObject("Goodbye");
        workingMemory.fireAllRules();
    }
}
View Full Code Here

            fibonacci = new Fibonacci( 50 );
            start = System.currentTimeMillis( );
            workingMemory.assertObject( fibonacci );

            workingMemory.fireAllRules( );
            stop = System.currentTimeMillis( );

            System.err.println( "fibonacci(" + fibonacci.getSequence( )
                                + ") == " + fibonacci.getValue( ) + " took "
                                + ( stop - start ) + "ms" );
View Full Code Here

            fibonacci = new Fibonacci( 50 );
            start = System.currentTimeMillis( );
            workingMemory.assertObject( fibonacci );

            workingMemory.fireAllRules( );
            stop = System.currentTimeMillis( );
            System.err.println( "fibonacci(" + fibonacci.getSequence( )
                                + ") == " + fibonacci.getValue( ) + " took "
                                + ( stop - start ) + "ms" );
View Full Code Here

        // Assert the facts, and fire the rules.
        Fibonacci fibonacci = new Fibonacci( 50 );
        long start = System.currentTimeMillis( );
        workingMemory.assertObject( fibonacci );
        workingMemory.fireAllRules( );
        long stop = System.currentTimeMillis( );
        System.err.println( "fibonacci(" + fibonacci.getSequence( ) + ") == " + fibonacci.getValue( ) + " took " + (stop - start) + "ms" );
    }
}
View Full Code Here

  private void executeRules(Claim claim, Team team) throws SAXException, IOException, IntegrationException, FactException {
    WorkingMemory engine = _ruleBase.newWorkingMemory();
    engine.assertObject(claim);
    engine.assertObject(team);
    engine.fireAllRules();
  }
 
 
  //set up the example scenarios below
  private Claim getBetweenSomeDateLongtail1() {
View Full Code Here

            bedroom.setTemperature(292);

            FactHandle loungeHandle = workingMemory.assertObject( lounge );
            FactHandle bedroomHandle = workingMemory.assertObject( bedroom );
            FactHandle heatingHandle = workingMemory.assertObject( heating );           
            workingMemory.fireAllRules( );

            lounge.setTemperature(295);
            bedroom.setTemperature(295);

            workingMemory.modifyObject( loungeHandle, lounge );
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.