[rules-users] Rule error

FrankVhh frank.vanhoenshoven at agserv.eu
Wed Jul 13 08:34:46 EDT 2011


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.




More information about the rules-users mailing list