<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Don't put that in a eval, but directly in the second pattern
constraints, like this :<br>
<pre wrap="">rule "ValidMechanism"
        when
                $c : Capacity(doMin>20)
                $m : Mechanism(<b>doMin <= $c.doMin, </b>
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
</pre>
<br>
<br>
Le 13/07/2011 14:34, FrankVhh a écrit :
<blockquote cite="mid:1310560486949-3165771.post@n3.nabble.com"
type="cite">
<pre wrap="">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:
</pre>
<blockquote type="cite">
<pre wrap="">
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.
</pre>
</blockquote>
<pre wrap="">
--
View this message in context: <a class="moz-txt-link-freetext" href="http://drools.46999.n3.nabble.com/Rule-error-tp3162619p3165771.html">http://drools.46999.n3.nabble.com/Rule-error-tp3162619p3165771.html</a>
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<!-- @author Hadrien HUGOT -->
<!-- Modèle signature thunderbird et autres -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CARTE DE VISITE</title>
<span style="font-size: 13.5pt; font-family:
"Arial","sans-serif"; color: rgb(21, 24,
90);">Vincent LEGENDRE</span><br>
<i><span style="font-size: 8.5pt; font-family:
"Arial","sans-serif"; color: rgb(21, 24,
90);">Consultant Sénior</span></i><br>
<span style="font-size: 4.5pt;"> <br>
</span>
<span style="font-size: 9pt; font-family:
"Arial","sans-serif"; color: rgb(21, 24,
90);">EURODECISION<o:p></o:p></span><br>
<span style="font-size: 9pt; font-family:
"Arial","sans-serif"; color: rgb(21, 24,
90);">9A rue de la Porte de Buc 78000 VERSAILLES<br>
Tél. : +33 (0)1 39 07 12 40<br>
Direct : +33 (0)1 39 07 26 16<br>
<a href="www.eurodecision.com">www.eurodecision.com</a></span><br>
<a href="http://www.eurodecision.com/"><span style="font-size:
12pt; font-family: "Times New
Roman","serif"; color: windowtext;
text-decoration: none;"> <img
src="cid:part1.07050703.09070106@eurodecision.com"
alt="EURODECISION" border="no"></span></a><a
href="http://www.eurodecision.com/"><span style="font-size:
12pt; font-family: "Times New
Roman","serif"; color: windowtext;
text-decoration: none;"> </span></a>
</div>
</body>
</html>