<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=024205710-08072008><FONT face=Arial
color=#0000ff size=2>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=024205710-08072008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=024205710-08072008><FONT face=Arial
color=#0000ff size=2>Given the rule you show it doesn't matter how many records
you have on a table UNLESS they are inserted into working memory.
</FONT></SPAN><SPAN class=024205710-08072008><FONT face=Arial color=#0000ff
size=2>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?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=024205710-08072008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=024205710-08072008><FONT face=Arial
color=#0000ff size=2>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).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=024205710-08072008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=024205710-08072008><FONT face=Arial
color=#0000ff size=2>Cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=024205710-08072008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=024205710-08072008><FONT face=Arial
color=#0000ff size=2>Mike</FONT></SPAN></DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>pramod
george<BR><B>Sent:</B> 08 July 2008 10:58<BR><B>To:</B>
rules-users@lists.jboss.org<BR><B>Subject:</B> [rules-users] Rules 'firing'
multiple times?<BR></FONT><BR></DIV>
<DIV></DIV>
<P>Hi all.<BR>I have this question on drools rules and I'm not sure if
this<BR>is the right thinking?<BR>I have a rule defined in a drl
file:<BR>when <BR> c:
Emp_Crime_Record(DISPOSITION == "GUILTY"); <BR>then <BR>
System.out.println("CriminalRecordRule fired...");<BR>end<BR><BR>Here,
if the table "Emp_Crime_Record" is got 5 rows that satisfy this condition ie:-
DISPOSITION == "GUILTY", then does this rule get fired<BR>5 times? Ie:- the
sop gets printed 5 times?<BR><BR>For this, if there are a million records that
satisfy this condition - then the firing happens a million times?<BR><BR>I
would be greatful if this can be clarified?<BR>Thanks a million!
:)<BR><BR>-Promod<BR></P><BR><BR></BLOCKQUOTE></BODY></HTML>