<br>&nbsp;&nbsp; Chris,<br><br>&nbsp;&nbsp; There is quite a few messages in the list archives about the &quot;issues&quot; of using nested objects. <br>&nbsp;&nbsp; Best way is always to work with a &quot;relational model&quot; and assert all your objects to the working memory. One example would be:
<br><br>rule R1<br>when<br>&nbsp;&nbsp;&nbsp; $o : Order( requestStatus == RequestStatus.ACCEPT )<br>&nbsp;&nbsp;&nbsp; Message( state == MessageState.RELEASING, order == $o )<br>then<br>&nbsp;&nbsp;&nbsp; // do something<br>end<br><br>&nbsp;&nbsp;&nbsp; Having said that, if you don&#39;t think it is justifiable to assert all objects into working memory because of just a few rules, you can also use the &quot;from&quot; CE:
<br><br>rule R2<br>when<br>&nbsp;&nbsp;&nbsp; $m : Message( state == MessageState.RELEASING )<br>&nbsp;&nbsp;&nbsp; Order( requestStatus == RequestStatus.ACCEPT ) from $m.getOrder()<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp; // do something<br>end<br><br>&nbsp;&nbsp;&nbsp; Finally, version 4.0
 final will allow you to write the rule the way you wrote:<br><br>rule R3<br>
when<br>
&nbsp;&nbsp;&nbsp; $m : Message( state == MessageState.RELEASING, order.requestStatus == RequestStatus.ACCEPT ) <br>
then<br>
&nbsp;&nbsp;&nbsp;&nbsp; // do something<br>
end<br><br>&nbsp;&nbsp; But it is important to note that the above will automatically generate an embedded eval() for you, that is exactly the same as doing:<br><br>rule R4<br>

when<br>

&nbsp;&nbsp;&nbsp; $m : Message( state == MessageState.RELEASING, eval( order.getRequestStatus() == RequestStatus.ACCEPT ) ) <br>

then<br>

&nbsp;&nbsp;&nbsp;&nbsp; // do something<br>

end<br>
<br>&nbsp;&nbsp; And eval result needs to be constant over time.<br><br>&nbsp;&nbsp; BTW, syntaxes used in R1, R2 and R4 are already supported in MR2/trunk. Syntax used in R3 above will be available in Drools 4.0 final release.<br><br>&nbsp;&nbsp; []s
<br>&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/6/6, Chris Mathrusse &lt;<a href="mailto:christopher.mathrusse@sybase.com">christopher.mathrusse@sybase.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&#39;m new to the rules syntax and a bit frustrated with trying to learn it. I&#39;ve<br>reviewed the docs but keep running into the same issue. I have a parent object,<br>Message, that contains an Order. An Order has a status that I want to test. So
<br>looking at the documentation and taking my best guess I&#39;ve created a rule as<br>follows:<br><br>rule &quot;Order not Accepted&quot;<br>when<br>&nbsp;&nbsp;$m : Message( state == MessageState.RELEASING, order.requestStatus ==
<br>RequestStatus.ACCEPT )<br>then<br>&nbsp;&nbsp;...<br>end<br><br>The problem is that when I start my application I get a compilation error.<br><br>Caused by:<br>org.drools.rule.InvalidRulePackage: [54,54]: unknown:54:54 mismatched token:
<br>[@423,1899:1899=&#39;.&#39;,&lt;69&gt;,54:54]; expecting type RIGHT_PAREN[54,94]:<br>unknown:54:94 mismatched token: [@433,1939:1939=&#39;)&#39;,&lt;37&gt;,54:94]; expecting type<br>LEFT_PAREN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at org.drools.rule.Package.checkValidity
(Package.java:368)<br><br><br>So what am I missing? I know it has to be something simple with my understanding<br>of the syntax.<br><br>Thanks for the help...<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>