23.1. Notification in the system context

Notifying by adding a role to a context is somewhat of an antipattern when you want to notify the user on exit of a context. Consider what happens: your on exit action is run, it adds a Notifications role instance to the context – which is then instantly removed with all of its roles!

The graphical client, however, relies on displaying the Notifications instances in a context. Clearly, this should not work and it does not. To clarify the mechanism further, it is not even shown transiently using the operating system notification system; this, too, is only triggered when a new Notifications role instance is detected.

In such cases you can resort to

  • either notify in the embedding context, where the contextrole pointing to the context is removed (create an on exit there);

  • or notify in the system context.

The former requires you to add the ContextWithNotification Aspect to your embedding context. To achieve the latter, you don’t use Aspects at all. The system context is the default where Notifications are stored when they are no


1. If no authoring role is provided by the API caller, we take it to be the System User.