[rules-dev] eval problem

Wolfgang Laun wolfgang.laun at gmail.com
Tue Mar 1 05:07:46 EST 2011


The correct way is

   modify( $patient ){
     incNbFactRisque()
   }

-W


On 1 March 2011 10:52, Nico ROEDERER <ino.nicolas at gmail.com> wrote:

>  Here's one exemple of incrementation :
> IN drl file :
> rule "FacteurRisqueHomme"
>     when
>         $patient : PatientDto()
>         eval( $patient.getValue( Constants.RULE_KEY_SEXE ).equals(
> Constants.SEXE_HOMME )
>             && $patient.getDoubleValue( Constants.RULE_KEY_AGE ) >
> $patient.getDoubleProperties("valeur.age.homme")  )
>     then
>         *$patient.incNbFactRisque();*
>         System.out.println("FacteurRisqueHomme vérifié");
> end
>
> In PatientDto :
>    /**
>     * Permet l'incrémentation du nombre de risque (depuis une règle drools)
>     */
>    public void incNbFactRisque() {
>        nbFactRisque++;
>    }
>
>
>
> Le 01/03/2011 10:47, Wolfgang Laun a écrit :
>
> The correct list is rules-users at lists.jboss.org
>
>
> On 1 March 2011 10:15, Nico ROEDERER <ino.nicolas at gmail.com> wrote:
>
>>  (1) -> yes because when I print the value, the value is correct ( = 2 ).
>> Not the eval.
>>
>
> Show us the rule where you increment.
>
>
>>  (2) -> yes, true. My list is in alphabtic mode...
>>
>
> This does not matter for the order those rules will fire.
>
>
>
>>  (3) -> Every test I make made the wrong result
>>
>
> Obvious - the problem is somewhere else, not in the test.
>
> -W
>
>
>
> _______________________________________________
> rules-dev mailing listrules-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-dev
>
>
> _______________________________________________
> 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/20110301/b6cbbe39/attachment.html 


More information about the rules-dev mailing list