The ugly way we used to figure out triggeringItem
before there was a triggeringItem
implicit variable and Member of
Rule triggers was as follows:
- save all the members of the Group to persistence
- trigger the Rule on updates to the Group
- set up a Rule latch so only one instance runs at a time (optional)
- sleep for long enough for Persistence to write the new state to the DB
val triggeringItem = MyGroup.members.sortBy[ i | i.lastUpdate ].last
or something like that, it’s been years since I’ve seen it
And indeed, the Rule would trigger n-1 times where n is the number of members of the Group.