It seems that this is more of a technical problem on the Java side: how to register the fact that a certain property of an element has changed. You&#39;ll need somthing like a &quot;clone&quot; method. <br><br>The old version of Person need and should not remain in Working Memory, but a simple wrapper fact referencing to the cloned Person object (not a fact!) would be required. Then you might do<br>
<br>   Person( $adress: adress )<br>   Wrapper( $person: person, eval( $adress != $person.getAddress() ) )<br><br>-W<br><br><br><br><br><br><br><div class="gmail_quote">On 9 November 2011 09:57, kapokfly <span dir="ltr">&lt;<a href="mailto:ivan.jiang.ww@foxmail.com">ivan.jiang.ww@foxmail.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;">Thanks, when I am saying person address is changed, our app only concerns<br>
about its initial value and its final value, any change in the middle, we<br>
don&#39;t care.<br>
<br>
Examples:<br>
   person.address.address1 starts with &#39;my addr1&#39;<br>
<br>
   later a couple of changes were made, say its final value is &#39;my addr1&#39;,<br>
we treat it as no change and no middle rules should be fired.<br>
<br>
Even for the 2 objects approach, how I can write the rules to get the old<br>
and new object matched correctly?<br>
<br>
They are both Person instances without any identity to tell which one is the<br>
old which one is the new one, unless I enable some kinds of map/or list in<br>
the rule and one structure to host only new objects and the other one hosts<br>
only the old values?<br>
<font color="#888888"><br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-write-Drools-rule-basing-on-a-changed-property-tp3492926p3492979.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-write-Drools-rule-basing-on-a-changed-property-tp3492926p3492979.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</font></blockquote></div><br>