<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thank you for help!<br>
<br>
Regards,<br>
Piotr<br>
<br>
<br>
<br>
<br>
<br>
On 2010-05-24 17:43, Wolfgang Laun wrote:
<blockquote
 cite="mid:AANLkTikKV7uuXQ-5llVxeQ_3M48PDwSc33aHvKl_q0JJ@mail.gmail.com"
 type="cite">
  <meta http-equiv="Content-Type"
 content="text/html; charset=ISO-8859-1">
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>
&nbsp; (or (and MyFact(id==1) <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyFact(id==2)) <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&nbsp;&nbsp;&nbsp; # !<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (or MyFact(id==3) MyFact(id==4))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )&nbsp;&nbsp;&nbsp; # !<br>
&nbsp; )<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">&lt;<a
 moz-do-not-send="true" 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 moz-do-not-send="true"
 href="mailto:pjedrychowski@proximetry.pl" target="_blank">pjedrychowski@proximetry.pl</a>&gt;</span>
    <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 moz-do-not-send="true" 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 moz-do-not-send="true"
 href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
      <a moz-do-not-send="true"
 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 moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
    <a moz-do-not-send="true"
 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>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
</body>
</html>