[rules-dev] eval problem

Nico ROEDERER ino.nicolas at gmail.com
Tue Mar 1 04:52:45 EST 2011


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 
> <mailto:rules-users at lists.jboss.org>
>
>
> On 1 March 2011 10:15, Nico ROEDERER <ino.nicolas at gmail.com 
> <mailto: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 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/e5242912/attachment.html 


More information about the rules-dev mailing list