<!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">Here's one exemple of incrementation :<br>
IN drl file :<br>
rule "FacteurRisqueHomme"<br>
when<br>
$patient : PatientDto()<br>
eval( $patient.getValue( Constants.RULE_KEY_SEXE ).equals(
Constants.SEXE_HOMME )<br>
&& $patient.getDoubleValue(
Constants.RULE_KEY_AGE ) >
$patient.getDoubleProperties("valeur.age.homme") )<br>
then <br>
<b>$patient.incNbFactRisque();</b><br>
System.out.println("FacteurRisqueHomme vérifié");<br>
end<br>
<br>
In PatientDto :<br>
/**<br>
* Permet l'incrémentation du nombre de risque (depuis une
règle drools)<br>
*/<br>
public void incNbFactRisque() {<br>
nbFactRisque++;<br>
}<br>
<br>
</font><br>
<br>
Le 01/03/2011 10:47, Wolfgang Laun a écrit :
<blockquote
cite="mid:AANLkTi=FsnciLcd15W7aYewxeO+1yFGvT8sFok=2kSCF@mail.gmail.com"
type="cite">The correct list is <a moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<br>
<br>
<div class="gmail_quote">On 1 March 2011 10:15, 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">(1)
-> yes because when I print the value, the value is
correct ( = 2 ). Not the eval.<br>
</font></div>
</blockquote>
<div><br>
Show us the rule where you increment.<br>
</div>
<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"> (2)
-> yes, true. My list is in alphabtic mode...<br>
</font></div>
</blockquote>
<div><br>
This does not matter for the order those rules will fire.<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;">
<div text="#000000" bgcolor="#ffffff"><font size="-1"> (3)
-> Every test I make made the wrong result <br>
</font></div>
</blockquote>
<div><br>
Obvious - the problem is somewhere else, not in the test.<br>
<br>
-W<br>
<br>
</div>
</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>