This is due to a designed or accidental glitch in the LHS syntax.<br><br>An &quot;and&quot; CE may not contain an &quot;or&quot; CE as one of its operands; it<br>may only contain a <i>parenthesized </i>&quot;or&quot; (but all other CEs without<br>
the additional decoration). This means that you must write<br><br>  (or (and MyFact(id==1) <br>                MyFact(id==2)) <br>        (    # !<br>           (or MyFact(id==3) MyFact(id==4))<br>        )    # !<br>  )<br>
<br>The simplified version from Piotr&#39;s post is, of course, preferred.<br><br>Sadly, there is more than one discrepancy between the DRL syntax as presented in<br>the non-normative syntax diagrams shown in the Drools Expert manual and the<br>
actual syntax as implemented in the DRL.g file.<br><br>-W<br><br><br><div class="gmail_quote">2010/5/24 Giovanni Motta <span dir="ltr">&lt;<a href="mailto:mottagio@gmail.com">mottagio@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello, i had similar problems with or constructs, and decided to avoid them.<div>Drools expert manual says that or constructs are internally rewritten, i suppose this mechanism is not fine-tuned.</div><div>My 2 cents...</div>

<div><br></div><div><div class="gmail_quote">2010/5/24 Piotr Jedrychowski <span dir="ltr">&lt;<a href="mailto:pjedrychowski@proximetry.pl" target="_blank">pjedrychowski@proximetry.pl</a>&gt;</span><div><div></div><div class="h5">
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello.<br>
<br>
I have a problem with such a condition after &#39;when&#39;:<br>
(or (and MyFact(id==1) MyFact(id==2)) (or MyFact(id==3) MyFact(id==4)))<br>
<br>
For this condition I got this error:<br>
errors; [7,41]: [ERR 101] Line 7:41 no viable alternative at input &#39;or&#39;<br>
in rule &quot;Sensor-1-ON&quot;[7,64]: [ERR 102] Line 7:64 mismatched input<br>
&#39;MyFact&#39; expecting &#39;)&#39; in rule &quot;Sensor-1-ON&quot;[7,84]: [ERR 102] Line 7:84<br>
mismatched input &#39;)&#39; expecting &#39;then&#39; in rule &quot;Sensor-1-ON&quot;<br>
<br>
When I changed my condition to this:<br>
(or (and MyFact(id==1) MyFact(id==2)) MyFact(id==3) MyFact(id==4))<br>
everything is correct. Both conditions from logic point of view, are the<br>
same, but the first one can&#39;t be compiled. Why?<br>
<br>
Maybe someone had similar problem and could help me?<br>
<br>
I&#39;m using:<br>
* JBoss <a href="http://4.2.3.GA" target="_blank">4.2.3.GA</a><br>
* Drools 5.0<br>
<br>
Regards,<br>
Piotr<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>