Don't put that in a eval, but directly in the second pattern
constraints, like this :
rule "ValidMechanism"
when
$c : Capacity(doMin>20)
$m : Mechanism(*doMin<= $c.doMin,*
DMOMax<=30, doMax>50&& doMin<40&& maxPower>180&&
minPower>=100&& bidPower>100&& <200)
then
System.out.println("Capacity n°"+$c.getIdCapacity()+" eligible to the
mechanism n°"+$m.getIdMechanism()+" for rule 1" );
end
Le 13/07/2011 14:34, FrankVhh a écrit :
Hi,
It depends upon which version of drools you are using, but if it is a
version pre 5.2.0, than your last line should be:
eval($c.getDoMin()>=$m.getDoMin())
If you are using 5.2.0, the parser allow a bit more freedom, allthough I am
not sure about this very case. You surely will have to omit the ; at the end
of your condition.
Regards,
Frank
michou89 wrote:
> rule "ValidMechanism"
> when
> $c : Capacity(doMin>20)
> $m : Mechanism(DMOMax<=30, doMax>50&& doMin<40&&
maxPower>180&&
> minPower>=100&& bidPower>100&& <200)
> $c.getDoMin()>=$m.getDoMin();
> then
> System.out.println("Capacity n°"+$c.getIdCapacity()+" eligible to
the
> mechanism n°"+$m.getIdMechanism()+" for rule 1" );
> end
>
>
> My error : org.drools.rule.InvalidRulePackage: [40,15]: unknown:40:15
> mismatched token: [@100,813:814='>=',<78>,40:15]; expecting type
THEN
> (this is the last line before the "then")
>
>
> I don't understand why I can't compare 2 values.
>
--
View this message in context:
http://drools.46999.n3.nabble.com/Rule-error-tp3162619p3165771.html
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Vincent LEGENDRE
/Consultant Sénior/
EURODECISION
9A rue de la Porte de Buc 78000 VERSAILLES
Tél. : +33 (0)1 39 07 12 40
Direct : +33 (0)1 39 07 26 16
www.eurodecision.com
EURODECISION <
http://www.eurodecision.com/><http://www.eurodecision.com/>