Package org.drools

Examples of org.drools.WorkingMemory.fireAllRules()


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

            workingMemory.modifyObject( loungeHandle, lounge );
            workingMemory.modifyObject( bedroomHandle, bedroom );           
            workingMemory.fireAllRules( );           
        }
        catch ( Exception e )
        {
            e.printStackTrace( );
        }
View Full Code Here


        //add the JFrame to the ApplicationData to allow for user interaction
        WorkingMemory workingMemory = ruleBase.newWorkingMemory( );
        workingMemory.setApplicationData( "frame", frame );
        workingMemory.assertObject( cart );
        workingMemory.fireAllRules( );

        //returns the state of the cart
        return cart.toString( );
    }
}
View Full Code Here

            stopwatch( 1 );
            WorkingMemory workingMemory = ruleBase.newWorkingMemory( );

            Number fact = new Number( factValues[i] );
            workingMemory.assertObject( fact );
            workingMemory.fireAllRules( );
            results.addAll( workingMemory.getObjects( ) );

            verbose( fact + ":" + stopwatch( 1 ) );
        }
View Full Code Here

        {
            stopwatch( 1 );

            Number fact = new Number( factValues[i] );
            workingMemory.assertObject( fact );
            workingMemory.fireAllRules( );

            verbose( fact + ":" + stopwatch( 1 ) );
        }

        System.out.println( "Total time:" + stopwatch( 0 ) );
View Full Code Here

        for ( int i = 0; i < numberOfFacts; i++ )
        {
            workingMemory.assertObject( new Number( factValues[i] ) );
        }
        verbose( "Firing all rules..." );
        workingMemory.fireAllRules( );

        if ( verbose )
        {
            for ( Iterator i = workingMemory.getObjects( ).iterator( ); i.hasNext(); )
            {
View Full Code Here

        for ( int i = 0; i < 10; i++ )
        {
            workingMemory.assertObject( new Integer( i ) );
        }

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

        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( "----------" );
        workingMemory = ruleBase.newWorkingMemory( );
        workingMemory.addEventListener(
            new DebugWorkingMemoryEventListener( ) );
        workingMemory.assertObject( "Goodbye" );
        workingMemory.fireAllRules( );
    }

    /** Just in case you want to dump out the contents to disk */
    private static void dumpGeneratedSourceToDisk(RuleSetLoader ruleSetLoader) throws IOException,
                                                                              FileNotFoundException {
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

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.