<br> Also, the only time rules may be fired automatically is when you add new rules to a rulebase that already has created sessions, but even this can be disabled by a rulebase configuration.<br><br> []s<br> Edson<br>
<br><div class="gmail_quote">2008/11/18 Maxim Veksler <span dir="ltr"><<a href="mailto:maxim.veksler@gmail.com">maxim.veksler@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><br><br><div class="gmail_quote"><div class="Ih2E3d">On Tue, Nov 18, 2008 at 12:17 AM, Jin Chai <span dir="ltr"><<a href="mailto:jin.chai@jdsu.com" target="_blank">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><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><div class="Ih2E3d"><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" target="_blank">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></div><br><br clear="all"><br>-- <br>Cheers, <br>Maxim Veksler<br><br>"Free as in Freedom" - Do u GNU ?<br>
</div>
<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>
<br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>