[rules-users] How to write Drools rule basing on a changed property?

Wolfgang Laun wolfgang.laun at gmail.com
Wed Nov 9 03:46:24 EST 2011


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.

Or you follow your "ideally-we-should-have-2" idea.

-W



On 9 November 2011 09:29, kapokfly <ivan.jiang.ww at foxmail.com> wrote:

> Requirement:
>
> 1)
>     Rule
>     When
>         Person.address.address1 is changed
>     THEN
>
> 2) Ideally we should have 2 objects, 1 for the old person instance, the
> other for the new person instance so contextually the LHS equals to
> oldPerson.address.address1 != newPerson.address.address1.
>
> A properties change listener might not be the best solution as it might
> span
> multiple calls and the property change could be done on the web layer which
> is out of the JBoss Drools knowledge session.
>
> Ivan
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-write-Drools-rule-basing-on-a-changed-property-tp3492926p3492926.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111109/cd359a72/attachment.html 


More information about the rules-users mailing list