getNotes

getNotes(notes:      NotificationArray input;
         transients: Boolean;
         maxEntries: Integer);

The getNotes method of the System class populates the array specified in the notes parameter with transient instances of the current notification requests by all the processes in the system.

The parameters of the getNotes method are listed in the following table.

Parameter Specifies…
notes The notifications array that is to be populated with the notification instances.
transients Whether the notifications to be reported correspond to target transient objects corresponding to this node (true) or to target persistent objects corresponding to all the nodes in the system (false).
maxEntries The maximum number of notification instances to include in the array.

As this method creates transient instances of the Notification class, it is the responsibility of the method caller to purge the collection used by the method to delete these transient instances. The collection should be purged before the deletion of the notification array passed to the method in the notes parameter.

The following examples show the use of the getNotes method.

vars
    note              : Notification;
    notificationArray : NotificationArray;
begin
    create notificationArray transient;
    system.getNotes(notificationArray, true, 100);
        foreach note in notificationArray do
            //access the notification entry properties
            write note.target.String;
            // now check subscriber class is valid for the user
            if app.isValidObject(note.subscriber) then
                write note.subscriber.String;
            endif;
        endforeach;
epilog
    notificationArray.purge;
    delete notificationArray;
end;

vars
    notificationArray : NotificationArray;
begin
    create notificationArray transient;
    system.getNotes(notificationArray, true, 32000);
    write notificationArray.size.String & ' transient notifications';
    notificationArray.clear;
    system.getNotes(notificationArray, false, 32000);
    write notificationArray.size.String & ' persistent notifications';
epilog
    notificationArray.purge;
    delete notificationArray;
end;