3 Replies Latest reply on Aug 8, 2016 9:28 PM by Robatjazi

    How to get active notification with specific subscribers?

    Robatjazi

      Hi All,

       

      In PI AF Notification 2016, active alerts are actually event frames. How can I get event frames that are active and I subscribed for them via Notification Rules.

      Lets say a user login to system and wants to see all active alerts that subscribed to.

       

      Regards

        • Re: How to get active notification with specific subscribers?
          pmartin

          Hi Majid,

           

          Event Frames have a property called PrimaryReferencedElement.  This is an element associated with the Event Frame.  The Notification configuration is stored here under the NotificationRules property.  This is a collection of Notifications associated with this element.  The AFNotificationRule object has a subscriber property, which is a list of people subscribed to a particular Notification.

           

          Example:

          Say we have an AFEventFrame named ef.  You can use

          if( ef.PrimaryReferencedElement.NotificationRules[myNotificationName].Subscribers.Any( s => s.Name == "Majid" ) ){
              Console.WriteLine("Found you!");
          }