6 Replies Latest reply on Oct 18, 2017 1:54 PM by Jagan

    Notification deleted without deleting linked analysis


      In old notification system that I am using, I had created Notification in below manner. No problem if I delete the created notification in PSE. However there is a problem when I delete Notification alone using SDK. More details
      below. Notifications version is: PSE -> File->Server properties->Plug-Ins version against Delivery channel Email is 1.2.1205.10


      notification1 = new AFNotification(...);

      AFAnalysis rootAnalysis1 = new AFAnalysis(database, "notification1::Analysis");

      notification1.Analysis = rootAnalysis1;

      // Then analysis condition has been set here


      When above notification was created I can see that the used PI point count has been increased 5. If I delete the above notification in PSE, while checking in, I can see that both notification and analysis get deleted and the used PI point used count got decreased 5. For a different similar notification of the above type, I did deletion using SDK using


      AFAnalysis analysis3 =  notification3.Analysis;

      analysis3.delete()     // Both analysis and notification are deleted



      Also in this case used PI point count was reduced by 5.


      However, the problem is, before using above code, I have used below code to delete 100+ notifications of the same type


      AFAnalysis analysis2 =  notification2.Analysis;

      notification2.delete(); // NOTE: Analysis is not deleted by mistake



      In this case the PI point count is not reduced at all and then I tried to look for analysis "notification2::Analysis" using AFAnalysis.FindAnalyses() and it's not found. Any one has inputs on how I can now delete this "notification2::Analysis" analysis? and also how to free those 5 PI points used by each analysis/notification?


      Thanks in advance,


        • Re: Notification deleted without deleting linked analysis
          Eugene Lee

          Hi Jagannatha,


          According to this, the analysis assigned to the notification is owned by the notification and maintains a compositional relationship to the notification. This means that when either the analysis or notification are checked out, both are checked out together. When either are applied or checked in to the server, both are applied or checked in together.


          To adjust your point count for licensing purposes,

          • At startup of PI AFLink, PI AFLink informs PI Base Subsystem whether or not point adjustment should occur.
          • PI AFLink reports the number of notifications on the AF Server to PI Base Subsystem (every 10 minutes).
          • PI Base Subsystem modifies the point count (every 5 seconds): Point Count = Total Points - Notification Points + Notification Count
          • PI Base Subsystem reports the point count to PI License Manager (every 2 minutes)
          • If connection to the PI AF Server is lost, the Notification count is persisted for up to 7 days. After that grace period, the PI Server reverts to counting all tags.


          Conditions for point adjustment

          • AFLink connects to an AF Server that stores notifications configuration
          • AF Server version is 2.3 or greater
          • The Configuration database exists on that AF Server
          • The OSISOFT\\PIANO element exists in the Configuration database
          • The HistoryServerName attribute exists and the attribute value matches the name of the collective or PI Server from which AFLink is connecting (not case sensitive)
          1 of 1 people found this helpful
            • Re: Notification deleted without deleting linked analysis

              Thanks Eugene for response. Now it's clear that analysis that was linked to Notification would have been deleted when I deleted just the Notification alone. However, I still think that the PI Point used by those are not yet freed. For 100 notifications, I am expecting that point count to be reduced by atleast 700.

              Tech support,

              Could you please try out my two cases i.e. A. Deleting Notification and also linked analysis explicity B.Just deleting Notification

              and see if you could replicate the problem that in the case of A the used PI point comes down immediately but in case of B why it's not and when and what need to be done for used PI point count to come in case of B.

                • Re: Notification deleted without deleting linked analysis
                  Mike Zboray

                  I'm not quite sure what's going on here but something to keep in mind is that history tag deletion is handled by the Notifications Service, if configured to do so. The Notifications Service detects when a Notification is deleted from AF and then tells the history PI Data Archive to delete the tags. The only difference between what you are doing and what PSE does is that, PSE uses the ANSDK to stop the notifications first. However I don't see why that would have any effect because the service will stop them anyway. It might be more useful to look for errors in the notifications service log. If you increase the logging level to detail (which requires a restart), you can see each one of the tag deletions.

                  1 of 1 people found this helpful
              • Re: Notification deleted without deleting linked analysis

                Hi Jagan,


                This isn't related to your original query, but is there a particular reason you're using Notifications 1.x still?  Notifications 2017 is out and has a lot of performance improvements over 2012. 

                • Re: Notification deleted without deleting linked analysis

                  Got change to discuss this further with Robert Wai at London conference today. Thanks Robert Wai for your time. Tried to reproduce the problem but couldn't do it.  Now to proceed further, I have to reproduce this myself again and come back with more details.