<br>&nbsp;&nbsp;&nbsp; Rahul,<br><br>&nbsp;&nbsp;&nbsp; Sorry, seems there is an error in the docs. You can only use the up-front binding notation when you use infix OR, not the prefixed OR:<br><br>$binding : ( A(...) or A(...) ) // this is valid<br>$binding : (or A(...) A(...) ) // this is not
<br><br>&nbsp;&nbsp;&nbsp; Maybe we need to start supporting prefix notation for this too, but I really don&#39;t like this up-front binding notation. This is handled as a special case in the grammar, where you can&#39;t nest other CEs, etc... in other words, it is not orthogonal. It was good when we didn&#39;t supported nesting, but now that we do support, it makes things dangerous. Example: this is not valid:
<br><br>$x : ( X(...) or ( X(...) and Y(...) ) ) // obviously, not valid<br><br>&nbsp;&nbsp;&nbsp; But if you remove the binding or move the binding inside, it is valid:<br><br>( X(...) or ( X(...) and Y(...) ) ) // valid<br>( 
$x : X(...) or ( 
$x : X(...) and Y(...) ) ) // valid<br>
<br>&nbsp;&nbsp;&nbsp; Problem is that Mark does like that up-front notation, and he is the boss... ;)<br>&nbsp;&nbsp;&nbsp; Anyway, I would like to hear your opinion about it (and possibly other users too), if you prefer this up-front notation even being handled as a special case, or the multi-binding is ok for you.
<br><br>&nbsp;&nbsp; Meanwhile, the workaround is either use the multi-bind as you are using or the infix OR as I showed above.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/10/23, Rahul Phadnis &lt;<a href="mailto:rahul.phadnis@yahoo.com">
rahul.phadnis@yahoo.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I am using Jboss Rules 4.0.2 version.<br><br>I am trying to using or with binding. However the
<br>following doesn&#39;t work<br>rule &quot;RulesTest&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;# the if part<br>&nbsp;&nbsp;&nbsp;&nbsp;activation-group&nbsp;&nbsp;&quot;ActivationGroup1&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;salience 50<br>&nbsp;&nbsp;&nbsp;&nbsp;when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$eventType: EventType(id ==<br>Constants.EVENT_DEVCOM_ID
)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result : Result()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$param&nbsp;&nbsp;: Parameter($thresh:threshold)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# difference exceeds threshold value and<br>it is still day time<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context: (or DevContext(difference &gt; $thresh,
<br>dayTime == true)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DevContext(difference &gt; $thresh, sleepy<br>== false, dayTime == false) )<br><br>&nbsp;&nbsp;&nbsp;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# do something here<br><br>end<br><br>I get rule compilation errors:
<br>SEVERE: CheckedDroolsException<br>org.drools.CheckedDroolsException: There were errors<br>in the rule source: [320,18]: unknown:320:18<br>mismatched token:<br>[@1949,12142:12143=&#39;or&#39;,&lt;34&gt;,320:18]; expecting type
<br>ID[321,15]: unknown:321:15 mismatched token:<br>[@1967,12215:12227=&#39;DevContext&#39;,&lt;7&gt;,321:15]; expecting<br>type RIGHT_PAREN[321,86]: unknown:321:86 mismatched<br>token: [@1990,12286:12286=&#39;)&#39;,&lt;12&gt;,321:86]; expecting
<br>type THEN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at<br>org.drools.compiler.RuleBaseLoader.makeRuleBase(RuleBaseLoader.java:6<br><br>Is this a known bug ?<br><br>I can work around by using the alternate syntax<br>suggested in the documentation which is:
<br><br>or $context : DevContext(difference &gt; $thresh, dayTime<br>== true)<br>&nbsp;&nbsp; $context : DevComContext(difference &gt; $thresh,<br>sleepy == false, dayTime == false) )<br><br>Rahul.<br><br><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">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ 
<a href="http://www.jboss.com">www.jboss.com</a>