23. Notifications

The notification mechanism is partly built into the Perspectives Distributed Runtime, partly modelled in model:System.

  -- Use this as an aspect in contexts that should store their own notifications.
  -- PDRDEPENDENCY
  case ContextWithNotification
    -- PDRDEPENDENCY
    context Notifications (relational)
      -- PDRDEPENDENCY
      property Message (String)
    user NotifiedUser
      perspective on Notifications
        only (Remove, Delete, RemoveContext, DeleteContext)
        props (Message) verbs (Consult)
        action DeleteNotifications
          delete role Notifications

Add ContextWithNotification as an Aspect to a context that you model to receive notifications. Then add the aspect role Notifications and give the user who must be notified the aspect role NotifiedUser.

The notifications can be inspected in the context itself. But when a notification is generated, it will appear as a notification on screen, using the operating system notification mechanism.


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