I am not 100% sure, but in my opinion an elegant way to do it would be to create a class that extends from DefaultAgendaEventListener and then override the "afterActivationFired" method.

If you are using that fact in another rule and you want it to be updated, you have to call "update($d)" or you can modify $d inside a modify block.