<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Nov 18, 2008 at 12:17 AM, Jin Chai <span dir="ltr"><<a href="mailto:jin.chai@jdsu.com">jin.chai@jdsu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I have the following code, which is not working as I expected.<br>
<br>
rule "New AlertFacade"<br>
salience 1140<br>
when<br>
$af : AlertFacade();<br>
then<br>
System.out.println($af.getProperties());<br>
end<br>
<br>
<br>
In the java code:<br>
while (!isFireAllRules)<br>
{<br>
session.insert(alertFacade);<br>
....<br>
}<br>
session.fireAllRules();<br>
<br>
<br>
But I am seeing the rule "New AlertFacade" is fired everytime I inserted the<br>
fact. Shouldn't it wait until fireAllRules() be called? Am I missing something<br>
here?<br>
</blockquote><div><br>The "when' is evaluated as Drools builds its RETE network, which happens
as soon as you insert() the fact. This is called the LHS.<br>
The "then" should happen only after you issue "fireallrules()". This is also called the RHS of the rule.<br>
<br>
If you see the system.out prints before you call fireallrules check
that your not using some eval in another rule in the LHS that might
cause the system.out calls.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Thanks,<br>
Jin<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Cheers, <br>Maxim Veksler<br><br>"Free as in Freedom" - Do u GNU ?<br>
</div>