Try parenthesizing the right hand side but note that you may have to use getters to access the fields
   $o:Order($o.q > ($o.getB().getMaxQ() ) )

It's possible that using dialect "mvel" might be a way to avoid using the getX() instead of x.

-W


On 31 December 2010 17:30, Michael Whidden <mwhidden@thebluew.com> wrote:
At Mr. Legendre's suggestion, I removed the $o from my constraints, but
with the same result: (b.maxQ < q) works, but (q > b.maxQ) fails. I get
the error:
"Unable to create restriction '[QualifiedIndentifierRestr: < b.maxQ ]'
for field 'quantity' in the rule 'MaxQty'"



On 12/30/2010 2:32 PM, Michael Whidden wrote:
> I notice an unexpected behavior when creating a technical DRL in Guvnor.
>
> If I have a fact with a sub-fact, then binary operators don't seem to be
> commutative.
>
> Eg.,
>
> declare Broker
> maxQ: Integer
>
> declare Order
> q: Integer
> b: Broker
>
> The rule
> $o:Order($o.b.maxQ < $o.q)
> validates fine, but
> $o:Order($o.q > $o.b.maxQ)
> returns an error "Unable to create restriction
> '[QualifiedIndentifierRestr: > $o.broker.maxQ ]' for field '$o.q' in the
> rule"
>
> I'm new, so I want to make sure I'm not missing something obvious here...

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users