Hi,
 
Given the rule you show it doesn't matter how many records you have on a
table UNLESS they are inserted into working memory. So, assuming you
have code outside of that below which inserts each individual record
into working memory, then you can expect one activation to appear on the
agenda for each Emp_Crime_Record object in working memory that have
disposition equal to "GUILTY". Does this make sense?
 
Rule activations are put on the agenda as objects are inserted into
working memory and not when you call fireAllRules() - which executes the
activations on the agenda. So, every time you insert an object into
working memory the object is checked against the patterns defined in the
left-hand-side ("when"). If they match an activation is put on the
agenda (the right-hand-side - "then") for later execution (when you call
fireAllRules).
 
Cheers,
 
Mike


________________________________

        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of pramod george
        Sent: 08 July 2008 10:58
        To: [email protected]
        Subject: [rules-users] Rules 'firing' multiple times?
        
        

        Hi all.
        I have this question on drools rules and I'm not sure if this
        is the right thinking?
        I have a rule defined in a drl file:
        when         
            c: Emp_Crime_Record(DISPOSITION == "GUILTY");    
        then 
            System.out.println("CriminalRecordRule fired...");
        end
        
        Here, if the table "Emp_Crime_Record" is got 5 rows that satisfy
this condition ie:- DISPOSITION == "GUILTY", then does this rule get
fired
        5 times? Ie:- the sop gets printed 5 times?
        
        For this, if there are a million records that satisfy this
condition - then the firing happens a million times?
        
        I would be greatful if this can be clarified?
        Thanks a million!  :)
        
        -Promod
        



_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to