[rules-dev] Conversion Error in DRL file

Wolfgang Laun wolfgang.laun at gmail.com
Thu Feb 10 13:38:38 EST 2011


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 at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110210/77ca6083/attachment.html 


More information about the rules-dev mailing list