The agent that is responsible for the address change must take care to provide information about what it does. This could be done by creating an UpdateEvent fact referencing the Person fact and indicating the attribute (address). Or a listener reacts to the change and insert the UpdateEvent fact.<br>
<br>Or you follow your &quot;ideally-we-should-have-2&quot; idea. <br><br>-W<br><br><br><br><div class="gmail_quote">On 9 November 2011 09:29, 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;">Requirement:<br>
<br>
1)<br>
     Rule<br>
     When<br>
         Person.address.address1 is changed<br>
     THEN<br>
<br>
2) Ideally we should have 2 objects, 1 for the old person instance, the<br>
other for the new person instance so contextually the LHS equals to<br>
oldPerson.address.address1 != newPerson.address.address1.<br>
<br>
A properties change listener might not be the best solution as it might span<br>
multiple calls and the property change could be done on the web layer which<br>
is out of the JBoss Drools knowledge session.<br>
<br>
Ivan<br>
<font color="#888888"><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-tp3492926p3492926.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-write-Drools-rule-basing-on-a-changed-property-tp3492926p3492926.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>