We're updating the issue view to help you get more done. 

Lookup replacement should provide notification

Description

The ILookupService.replace(Lookup source, Lookup target) method replaces uses of the source lookup with the target.
The implementation for this bypasses the archetype service - any user that has registered an IArchetypeServiceListener for an archetype affected by the replacement won't receive a notification.
This has implications for caching.

E.g, suppose an act.customerAppointment refers to a lookup.appointmentReason with code "X".
If lookup.appointmentReason "X" is replaced with lookup.appointmentReason "Y", any listener for act.customerAppointment won't be notified of the change.

One drawback of performing notifications, is that it is potentially expensive operation. Each affected object would need to be loaded from the database in order for the notification to occur.
A workaround for this would be to extend IArchetypeServiceListener to provide a "batch" listener notification which simply notifies if a batch of objects of a particular archetype have been saved.
E.g:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 interface IArchetypeServiceListener { <snip> /** * Invoked after an object has been saved and the transaction committed. * * @param object the saved object */ void saved(IMObject object); <snip> /** * Invoked after a batch of objects of a particular archetype have been saved and the transaction committed. * * @param shortName the archetype short name */ void batchSaved(String shortName); }

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Affects versions

1.4

Priority

Minor