1 Reply Latest reply on Jan 10, 2011 9:45 PM by Mike Zboray

    How can the ID of a closed instance be retrieve from the ANInstanceEvent handler arg when the ANInstanceEvent.Action is "NotificationEndedNew"?

    singhace

      The ANNotificationList.InstanceEvent() event handler returns an ANInstanceEvent arg, which contains an ANInstanceEvent.ID that can be used to retrieve an ANInstance object that has the full information on instance, including whether the instance is active or not.  However,  the ANInstanceEvent.Action has a state called NotificationEndedNew, which I believe occurs when a new condition has fired creating a new instance,ending the previously active instance.  Is that correct?

       

      If so, does the ANInstanceEvent.ID correspond to the new instance that just started or the one that ended?

       

      If it corresponds to the one that just started then how can I retrieve the ID of the instance that just ended?  Can I safely subtract 1 from the ANInstanceEvent.ID or are there corner cases where that assumption fails?

       

       Thanks,

       

      Andy

        • Re: How can the ID of a closed instance be retrieve from the ANInstanceEvent handler arg when the ANInstanceEvent.Action is "NotificationEndedNew"?
          Mike Zboray

          Andy,

           

          I understand you have gotten an answer to your question already from our developers, but for anyone else:

           

          1) Yes, the NotificationEndedNew action occurs when an instance ended because a new instance was created.

           

          2) Yes, the instance ID associated with the NotificationEndedNew action is the newly created instance.

           

          3) As of the current version (1.1.1200.35) and the soon to be released version of Notifications, the instances IDs are sequential, so you can subtract 1 to get the recently closed instance ID in this case. Obviously, if there is no previous instance this will not work (e.g. the first NewNotification event action on a notification).

           

          I believe we will update the documentation to make it clearer that NotificationEndedNew is associated with a new instance, not the ended instance.

           

          Mike