Forwarded from drools-dev.<br><br>Based upon the single rule you show it is difficult to determine whether the issue you report is caused elsewhere.<br><br>Some general comments however:-<br><ul><li>It is essential to include an "update(<font size="-1">$patient);" in your RHS if the rule engine is to see the change in Patient properties in other rules.</font></li>
</ul><font size="-1"></font><ul><li><font size="-1">How many instances of Patient to you have in WM? Rules will activate for each instance that match patterns.</font></li></ul><font size="-1"></font><br><div class="gmail_quote">
---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Nico ROEDERER</b> <span dir="ltr"><<a href="mailto:ino.nicolas@gmail.com">ino.nicolas@gmail.com</a>></span><br>Date: 1 March 2011 09:15<br>
Subject: Re: [rules-dev] eval problem<br>To: Rules Dev List <<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>><br><br><br>
<div text="#000000" bgcolor="#ffffff">
<font size="-1">(1) -> yes because when I print the value, the
value is correct ( = 2 ). Not the eval.<br>
(2) -> yes, true. My list is in alphabtic mode...<br>
(3) -> Every test I make made the wrong result <br>
</font><font size="-1"><br>
eval( $patient.getNbFactRisque() == 0)<br>
or </font><font size="-1"> $patient : PatientDto( nbFactRisque ==
0 </font><font size="-1">)</font> ...<br>
<small>---> Why does those test are true dispite nbFactRisque = 2
????</small><br>
<br>
<b><font size="-1">It works fine when I run x time drools (one call
for one rule) but it doesn't work when I run one time with a
List of rules.</font></b><br>
<br>
<small>Can you tell me the right mailing list for those problems ?</small><br>
<br>
<br>
Le 01/03/2011 10:03, Wolfgang Laun a écrit :
<div><div></div><div class="h5"><blockquote type="cite">Please do not use this list for simple questions - it
is reserved for discussion Drools development itself.<br>
<br>
(1) Did you inform the Drools engine about incrementing <font size="-1">nbFactRisque?<br>
(2) There is no such thing as "alphabetic mode" for rule
execution.<br>
(3) Why do you use eval when you can test the fact field?<br>
<br>
Indication: Drools Expert manual, three times per day ;-)<br>
-W<br>
</font><br>
<br>
<div class="gmail_quote">On 1 March 2011 09:17, Nico ROEDERER <span dir="ltr"><<a href="mailto:ino.nicolas@gmail.com" target="_blank">ino.nicolas@gmail.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;">
<div text="#000000" bgcolor="#ffffff"> <font size="-1">Hi,<br>
<br>
I've got an other problem with an eval function. <br>
I will try to discribe the path to the error.<br>
<br>
I've got a repository where some people can put rules with
.drl extension.<br>
My program is listing this repository and execute every
rule in this repository.<br>
<br>
At the begining, I've got a 'PatientDto' who have a
property :<br>
int nbFactRisque;<br>
(with getters and setters)<br>
<br>
Some rules increments this number.<br>
<br>
In the last rule (the rules are executed in alphabetic
mode) I'm testing this number like this :<br>
<br>
rule "RisqueNormal"<br>
when<br>
$patient : PatientDto()<br>
eval( $patient.getNbFactRisque() == 0)<br>
then <br>
$patient.addDonnees( Constants.CLE_RISQUEPATIENT,
Constants.RISQUE_NORMAL );<br>
System.out.println("RisqueNormal vérifié." +
$patient.getNbFactRisque() + "Facteurs.");<br>
end<br>
<br>
Here's my problem :<br>
The 'Then' traitement is always executed so the eval
always think that </font><font size="-1">$patient.getNbFactRisque()
is equal to 0.<br>
But the system.out.println() show me that </font><font size="-1"> $patient.getNbFactRisque() = 2 !<br>
<br>
</font><font size="-1">Here's the output : "RisqueNormal
vérifié.2Facteurs.". <br>
<br>
Perhaps I did something wrong ? Can someone help me ?<br>
Thank you.<br>
</font> </div>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br>
</blockquote>
</div>
<br>
<pre><fieldset></fieldset>
_______________________________________________
rules-dev mailing list
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
</blockquote>
</div></div></div>
<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></div><br>