<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body 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 :
<blockquote
cite="mid:AANLkTi=pHKUS6BkJ6_GjWj75DtH6iOGYfzUoEUcZRRG+@mail.gmail.com"
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 moz-do-not-send="true"
href="mailto:ino.nicolas@gmail.com">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 moz-do-not-send="true"
href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a moz-do-not-send="true"
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 wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
</blockquote>
</body>
</html>