How, exactly, do you set the globals and how do you create the PatientDTO fact?

If the temperature is higher than temperatureCritique >=  temperatureElevee, both rules will fire.

-W

On 10 February 2011 16:00, ino.nicolas <ino.nicolas@gmail.com> wrote:

Hi. I've got a trouble in a drl file.
Here's my file :

#created on: 9 févr. 2011
package regles

# import
import com.compagny.rules.metier.dto.PatientDto;

# global variables
global Integer surPoids;
global Integer diffTaille;
global Integer temperatureElevee;
global Integer temperatureCritique;
global Integer tropGrand;

rule "1- aTraiterUrgent"
       when
               $patient : PatientDto()
               eval( $patient.getDoubleValue("temperature") > temperatureCritique )
       then
               $patient.addCommentaire( " Le patient " + $patient.getNomPatient() + " est
ŕ traiter d'URGENCE. " );
end

rule "2- estFievreux"
       when
               $patient : PatientDto()
               eval( $patient.getDoubleValue("temperature") >
temperatureElevee.doubleValue() )
       then
               $patient.addCommentaire( $patient.getDoubleValue("temperature") +
                       " - Le patient " + $patient.getNomPatient() + " est fievreux. " );
end


The both rules are nearly the same. Except the comparator (
temperatureCritique and temperatureElevee).
My problem :
- If I put the '.doubleValue()' to the both rule, the second rule will never
be launched.
- If I don't put the '.doubleValue()' in the first and the second rule, the
second rule will never be launched.
- If I put the '.doubleValue()' in one of the two rules (never mind if it's
in the first or second one), both of the rules are launched.

I don't know what I did wrong...
Could you please help me ?

--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Conversion-Error-in-DRL-file-tp2466448p2466448.html
Sent from the Drools - Dev mailing list archive at Nabble.com.

_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev