3 Replies Latest reply on Dec 19, 2012 3:49 PM by RJKSolutions

    FindEventFrames(..., cookie, out nextCookie)

      I want to stream in Event Frames to an application based on some criteria (Templates, Category, ...) but after an initial search I only want to know about new changes within my search criteria.  Much in the same manner FindChangedItems works based on Element Hierarchy.


      Imagine I have a "Shift" event frame, which gets generated according to a shift pattern definition.  Well I don't want the shift pattern logic within an application, I want to know when a new shift has occurred via the generation of an Event Frame within a time period, lets say within the last day.  I'm using Rx to create my own EventFramesObservable which is just polling for changes using FindEventFrames and will have some logic to sort out what is "new" since the last check.  For something like a shift it is a trivial task to see one EF has ended and a new EF for the next shift has been created.  What I want to do next is look at child Event Frames generated during a shift (again fairly straightforward) but I also want to see changes to already generated EFs.  For example, imagine an EF was generated for maintenance and was marked as "emergency maintenance".  A few hours later during the shift the EF was re-classified as "planned maintenance" (via an Enum Attribute of the EF) and the time window was reduced because the auto-creation was inaccurate.  I would pick up this change by loading all EFs within my search criteria, but it will pull in everything again.  I only want to know if anything has changed since I last searched.


      Make sense?

        • Re: FindEventFrames(..., cookie, out nextCookie)

          And, what are you doing with the "changed" information - i.e. emergency changed to planned.

            • Re: FindEventFrames(..., cookie, out nextCookie)



              AFDatabase.FindChangedItems(AFIdentity.EventFrame ...) should work to retrieve a list of EF changed or added since the previous call to FindChangedItems(), but it will not take into account your other search criteria.


              You could signup for events on the EFs that your application holds in memory, then calling AFDatabase.Refresh() (which calls AFDatabase.FindChangedItems() under the hood).




              AF Dev

                • Re: FindEventFrames(..., cookie, out nextCookie)

                  Thanks Paul.  Completely missed the EventFrames Identity, I wrongly assumed they fell under the Element Identity much like an Event Frame's Template that comes from an Element Template.  This should actually be more efficient than calling FindEventFrames all the time, I'll see what testing brings.


                  Gopal, maintenance was just an example.  In fact what I am looking for are changes to auto-generated Event Frames in general to highlight changes that may require tuning to the logic for generating the Event Frames in the first place.  It may be the case that Event Frame generation can be tuned according to conditions within a 'master' Event Frame, like a shift.