I can reproduce the error and I'll create a JIRA.<br><br>There are several things I can suggest as a workaround.<br><br>(1) Try using global Double for the temperature limits.<br><br>(2) Better: Use a single Parameter fact with double fields for temperatureElevee and temperatureCritique:<br>
<br> rule "1- aTraiterUrgent"<br>
when<br> Parameter( $te: temperatureElevee )<br> $patient : PatientDto( eval( $patient.getDoubleValue("temperature")
> $te ) )<br><br>(2++) You might also provide a getter double getTemperature for PatientDto.<br><br> rule "1- aTraiterUrgent"<br>
when<br>
Parameter( $te: temperatureElevee)<br>
$patient : PatientDto( termperature
> $te )<br><br>-W<br><br><br><div class="gmail_quote">On 11 February 2011 09:21, Nico ROEDERER <span dir="ltr"><<a 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">Yeah, </font>temperatureCritique is greater than
temperatureElevee<br>
<br>
Here's my PatientDto constructor :<br>
("temperature" is one of the "caracteristique" of the HashMap...)<br>
public PatientDto( long pNum, String pNom, HashMap<String,
String> pMap ) {<br>
setNumPatient( pNum );<br>
setNomPatient( pNom );<br>
setCaracteristique( pMap );<br>
}<br>
<br>
In a properties file :<br>
valeur.verifTemperature.elevee = 37<br>
valeur.verifTemperature.critique = 40<br>
<br>
In my 'RunRules.java' :<br>
vSession.setGlobal( "temperatureElevee", Integer.parseInt( <br>
vProp.getProperty(
"valeur.verifTemperature.elevee" ) ) );<br>
vSession.setGlobal( "temperatureCritique", Integer.parseInt( <br>
vProp.getProperty(
"valeur.verifTemperature.critique" ) ) );<br>
<font size="-1"><br>
(</font> vProp.getProperty( "valeur.verifTemperature.elevee" )
return 37 and vProp.getProperty( "valeur.verifTemperature.critique"
) return 40)<br>
<br>
I don't know what's wrong....<br>
<br>
Thanks for the help.<br>
<br>
<br>
Le 10/02/2011 19:38, Wolfgang Laun a écrit :
<div><div></div><div class="h5"><blockquote type="cite">How, exactly, do you set the globals and how do you
create the PatientDTO fact?<br>
<br>
If the temperature is higher than temperatureCritique >=
temperatureElevee, both rules will fire.<br>
<br>
-W<br>
<br>
<div class="gmail_quote">
On 10 February 2011 16:00, ino.nicolas <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;">
<br>
Hi. I've got a trouble in a drl file.<br>
Here's my file :<br>
<br>
#created on: 9 févr. 2011<br>
package regles<br>
<br>
# import<br>
import com.compagny.rules.metier.dto.PatientDto;<br>
<br>
# global variables<br>
global Integer surPoids;<br>
global Integer diffTaille;<br>
global Integer temperatureElevee;<br>
global Integer temperatureCritique;<br>
global Integer tropGrand;<br>
<br>
rule "1- aTraiterUrgent"<br>
when<br>
$patient : PatientDto()<br>
eval( $patient.getDoubleValue("temperature")
> temperatureCritique )<br>
then<br>
$patient.addCommentaire( " Le patient " +
$patient.getNomPatient() + " est<br>
à traiter d'URGENCE. " );<br>
end<br>
<br>
rule "2- estFievreux"<br>
when<br>
$patient : PatientDto()<br>
eval( $patient.getDoubleValue("temperature")
><br>
temperatureElevee.doubleValue() )<br>
then<br>
$patient.addCommentaire(
$patient.getDoubleValue("temperature") +<br>
" - Le patient " +
$patient.getNomPatient() + " est fievreux. " );<br>
end<br>
<br>
<br>
The both rules are nearly the same. Except the comparator (<br>
temperatureCritique and temperatureElevee).<br>
My problem :<br>
- If I put the '.doubleValue()' to the both rule, the second
rule will never<br>
be launched.<br>
- If I don't put the '.doubleValue()' in the first and the
second rule, the<br>
second rule will never be launched.<br>
- If I put the '.doubleValue()' in one of the two rules (never
mind if it's<br>
in the first or second one), both of the rules are launched.<br>
<br>
I don't know what I did wrong...<br>
Could you please help me ?<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Conversion-Error-in-DRL-file-tp2466448p2466448.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Conversion-Error-in-DRL-file-tp2466448p2466448.html</a><br>
Sent from the Drools - Dev mailing list archive at
Nabble.com.<br>
<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>
</font></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></blockquote></div><br>