[rules-users] Detecting what fact/event properties have changed.

Swindells, Thomas TSwindells at nds.com
Fri Aug 19 08:11:45 EDT 2011


Drools doesn't know what has changed, the changes are all done in java code and it only knows something has been done to them when you call update, not what has been done (it could be nothing).

There are three ways you could achieve this affect:
1. Keep an original copy of the data, when you get told of an update compare the original with the new ones (you can use something like Springs BeanWrapper to help you get access to the fields in a type unaware manner.
2. Make your classes produce PropertyChangeEvents to tell you what has changed.
3. Use Aspect Orientate programming to add an aspect on all the setters telling you when they have been called and what has changed.

Thomas

> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org [mailto:rules-users-
> bounces at lists.jboss.org] On Behalf Of rp2
> Sent: 19 August 2011 12:37
> To: rules-users at lists.jboss.org
> Subject: [rules-users] Detecting what fact/event properties have changed.
>
> Currently drools supports listening to events when objects are inserted,
> updated or retracted. I would like to get information about a what properties
> have changed when the object was updated. Is there a way to do that?
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Detecting-
> what-fact-event-properties-have-changed-tp3267788p3267788.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


**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster at nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************




More information about the rules-users mailing list