This is due to a designed or accidental glitch in the LHS syntax.<br><br>An "and" CE may not contain an "or" CE as one of its operands; it<br>may only contain a <i>parenthesized </i>"or" (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'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"><<a href="mailto:mottagio@gmail.com">mottagio@gmail.com</a>></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"><<a href="mailto:pjedrychowski@proximetry.pl" target="_blank">pjedrychowski@proximetry.pl</a>></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 'when':<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 'or'<br>
in rule "Sensor-1-ON"[7,64]: [ERR 102] Line 7:64 mismatched input<br>
'MyFact' expecting ')' in rule "Sensor-1-ON"[7,84]: [ERR 102] Line 7:84<br>
mismatched input ')' expecting 'then' in rule "Sensor-1-ON"<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't be compiled. Why?<br>
<br>
Maybe someone had similar problem and could help me?<br>
<br>
I'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>