<br>&nbsp;&nbsp; Can you please open a JIRA with your test case?<br><br>&nbsp;&nbsp; Thanks,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2008/3/17, Aaron Dixon &lt;<a href="mailto:atdixon@gmail.com">atdixon@gmail.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;">
Hello, Mike,<br> <br> The behavior is identical whether I update the sub-object or not --<br> the &quot;good&quot; rule always works as long as I update the root person<br> object AND the &quot;bad&quot; rule will not work even if I explicitly update<br>
 the sub-object as you&#39;ve suggested.<br> <br> This leads me to interpret the engine behavior as:<br> <br> 1) An update() to a root object is enough to communicate to the rules<br> engine that the entire object graph has (potentially) changed<br>
 2) The engine will properly reason over sub-objects only if you use<br> the From conditional element (but not if you use MVEL sub-property<br> expressions)<br> <br> So if (1) is the intended behavior of the engine, then my question is<br>
 still this... is (2) a necessary constraint? Shouldn&#39;t the engine be<br> able to reason over MVEL sub-property expressions without requiring<br> the From conditional element? If so, it makes for a more direct syntax<br>
 to allow MVEL sub-property expressions in the LHS, doesn&#39;t it?<br> <br> Thanks in advance for any help on this!<br> <br><br> Aaron<br> <br><br> <br> On Mon, Mar 17, 2008 at 4:08 AM, Anstis, Michael (M.) &lt;<a href="mailto:manstis1@ford.com">manstis1@ford.com</a>&gt; wrote:<br>
 &gt; IMO, you have not informed the engine\RETE network that details have changed<br> &gt;&nbsp;&nbsp;in your first example.<br> &gt;<br> &gt;&nbsp;&nbsp;This would probably be a better example:-<br> &gt;<br> &gt;<br> &gt;&nbsp;&nbsp;rule &quot;30 is the new 20&quot;<br>
 &gt;&nbsp;&nbsp;when<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; person : Person( $d : details.age == 30 )<br> &gt;<br> &gt; then<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; person.getDetails().setAge(20);<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println( &quot;Now 20 : &quot; + person );<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update( person );<br>
 &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update( $d );<br> &gt;&nbsp;&nbsp;end<br> &gt;<br> &gt;&nbsp;&nbsp;The From works because it gets external data rather than using that already<br> &gt;&nbsp;&nbsp;in the engine\RETE network.<br> &gt;<br> &gt;&nbsp;&nbsp;IMO, I think the rules are working correctly; it&#39;s just a misunderstanding<br>
 &gt;&nbsp;&nbsp;of how the engine\RETE network function.<br> &gt;<br> &gt;&nbsp;&nbsp;I hope this helps.<br> &gt;<br> &gt;&nbsp;&nbsp;Thanks,<br> &gt;<br> &gt;&nbsp;&nbsp;Mike<br> &gt;<br> &gt;<br> &gt;<br> &gt;&nbsp;&nbsp;-----Original Message-----<br> &gt;&nbsp;&nbsp;From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
 &gt;&nbsp;&nbsp;[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] On Behalf Of Aaron Dixon<br> &gt;&nbsp;&nbsp;Sent: 14 March 2008 20:51<br> &gt;&nbsp;&nbsp;To: Rules Users List<br> &gt;&nbsp;&nbsp;Subject: [rules-users] Can only reason over sub-objects if you use the<br>
 &gt;&nbsp;&nbsp;FromConditional Element<br> &gt;<br> &gt;&nbsp;&nbsp;It appears that you MUST use the From Condition Element to reason over<br> &gt;&nbsp;&nbsp;sub-objects.<br> &gt;<br> &gt;&nbsp;&nbsp;I have a Person class. Person::getDetails() returns a Details<br>
 &gt;&nbsp;&nbsp;instance, which has the name and age of the person. (This is a<br> &gt;&nbsp;&nbsp;contrived example to demonstrate the issue.)<br> &gt;<br> &gt;&nbsp;&nbsp;My rules are:<br> &gt;<br> &gt;&nbsp;&nbsp;rule &quot;30 is the new 20&quot;<br> &gt;&nbsp;&nbsp;when<br>
 &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; person : Person( details.age == 30 )<br> &gt;&nbsp;&nbsp;then<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; person.getDetails().setAge(20);<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println( &quot;Now 20 : &quot; + person );<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update( person );<br>
 &gt;&nbsp;&nbsp;end<br> &gt;<br> &gt;&nbsp;&nbsp;rule &quot;Older than 20 - Good&quot;<br> &gt;&nbsp;&nbsp;salience -100<br> &gt;&nbsp;&nbsp;when<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; person : Person( )<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Details( age &gt; 20 ) from person.details<br> &gt;&nbsp;&nbsp;then<br>
 &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println( &quot;Older than 20 (good) : &quot; + person );<br> &gt;&nbsp;&nbsp;end<br> &gt;<br> &gt;&nbsp;&nbsp;rule &quot;Older than 20 - Bad&quot;<br> &gt;&nbsp;&nbsp;salience -100<br> &gt;&nbsp;&nbsp;when<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; person : Person( details.age &gt; 20 )<br>
 &gt;&nbsp;&nbsp;then<br> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println( &quot;Older than 20 (bad) : &quot; + person );<br> &gt;&nbsp;&nbsp;end<br> &gt;<br> &gt;&nbsp;&nbsp;I assert Abe, Bob, Cat, Don, and Eve with ages of 10, 20, 30, 40, and<br> &gt;&nbsp;&nbsp;50, respectively. The output is as follows.<br>
 &gt;<br> &gt;&nbsp;&nbsp;Now 20 : Person(Details(Cat,20))<br> &gt;&nbsp;&nbsp;Older than 20 (good) : Person(Details(Eve,50))<br> &gt;&nbsp;&nbsp;Older than 20 (bad) : Person(Details(Eve,50))<br> &gt;&nbsp;&nbsp;Older than 20 (good) : Person(Details(Don,40))<br>
 &gt;&nbsp;&nbsp;Older than 20 (bad) : Person(Details(Don,40))<br> &gt;&nbsp;&nbsp;Older than 20 (bad) : Person(Details(Cat,20))<br> &gt;<br> &gt;<br> &gt;&nbsp;&nbsp;You can see that the &quot;Bad&quot; rule is more concise but it does not use<br> &gt;&nbsp;&nbsp;the From Conditional Element and therefore it doesn&#39;t work properly<br>
 &gt;&nbsp;&nbsp;(Cat is determined to be older than 20 when she is not.)<br> &gt;<br> &gt;&nbsp;&nbsp;Why does Drools allow the &quot;Bad&quot; rule to be written and compiled when<br> &gt;&nbsp;&nbsp;it does not behave properly?<br> &gt;<br> &gt;&nbsp;&nbsp;Thanks,<br>
 &gt;&nbsp;&nbsp;Aaron<br> &gt;&nbsp;&nbsp;_______________________________________________<br> &gt;&nbsp;&nbsp;rules-users mailing list<br> &gt;&nbsp;&nbsp;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br> &gt;&nbsp;&nbsp;<a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
 &gt;<br> &gt; _______________________________________________<br> &gt;&nbsp;&nbsp;rules-users mailing list<br> &gt;&nbsp;&nbsp;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br> &gt;&nbsp;&nbsp;<a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
 &gt;<br> &gt;<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;JBoss Drools Core Development<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>