Try parenthesizing the right hand side but note that you may have to use getters to access the fields<br>   $o:Order($o.q &gt; ($o.getB().getMaxQ() ) )<br><br>It&#39;s possible that using dialect &quot;mvel&quot; might be a way to avoid using the getX() instead of x.<br>
<br>-W<br><br><br><div class="gmail_quote">On 31 December 2010 17:30, Michael Whidden <span dir="ltr">&lt;<a href="mailto:mwhidden@thebluew.com">mwhidden@thebluew.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At Mr. Legendre&#39;s suggestion, I removed the $o from my constraints, but<br>
with the same result: (b.maxQ &lt; q) works, but (q &gt; b.maxQ) fails. I get<br>
the error:<br>
&quot;Unable to create restriction &#39;[QualifiedIndentifierRestr: &lt; b.maxQ ]&#39;<br>
for field &#39;quantity&#39; in the rule &#39;MaxQty&#39;&quot;<br>
<br>
<br>
<br>
On 12/30/2010 2:32 PM, Michael Whidden wrote:<br>
&gt; I notice an unexpected behavior when creating a technical DRL in Guvnor.<br>
&gt;<br>
&gt; If I have a fact with a sub-fact, then binary operators don&#39;t seem to be<br>
&gt; commutative.<br>
&gt;<br>
&gt; Eg.,<br>
&gt;<br>
&gt; declare Broker<br>
&gt; maxQ: Integer<br>
&gt;<br>
&gt; declare Order<br>
&gt; q: Integer<br>
&gt; b: Broker<br>
&gt;<br>
&gt; The rule<br>
&gt; $o:Order($o.b.maxQ &lt; $o.q)<br>
&gt; validates fine, but<br>
&gt; $o:Order($o.q &gt; $o.b.maxQ)<br>
&gt; returns an error &quot;Unable to create restriction<br>
&gt; &#39;[QualifiedIndentifierRestr: &gt; $o.broker.maxQ ]&#39; for field &#39;$o.q&#39; in the<br>
&gt; rule&quot;<br>
&gt;<br>
&gt; I&#39;m new, so I want to make sure I&#39;m not missing something obvious here...<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>