• Extension manager events

    By Alexis Vernier 3 years ago

    I don't get consistent results when updating a document. When updating a doc via the notes client I get a EM_NSFNOTECREATE event but when I update a doc via an agent I sometimes get a EM_NSFNOTEUPDATEXTENDED.

    When I delete a doc I also get a EM_NSFNOTEUPDATEXTENDED instead of EM_NSFNOTEDELETE.

    When I update a several documents via an agent I don't get the same number of EM_NSFNOTEUPDATEXTENDED as updated docs.

    I created a very simple test class with the following:

    public void run(RunWhen runWhen, String[] args, IProgressMonitor monitor)
                throws NotesException {
            if (runWhen.getUnit() != RunUnit.triggered) {
                return;
            }

            IExtensionManagerEvent event = runWhen.getExtensionManagerEvent();
            int eventId = event.getEventId();
            logMessage("ID: " + eventId);
        }

    Did I misunderstood the use of the events ?

    • We'll need to investigate further

      By Paul Fiore 2 years ago

      A couple of posts in regards to triggered events.  We'll need to investigate further.

    • Interim Update

      By Paul Fiore 2 years ago

      The Extension Manager will make the call back for any registered events.  This is true even with nested calls.  In the case of updating a document there is a code path that creates a temporary document which is what is triggering the EM_NSFNOTECREATE event you're seeing in this case.

      On deleted documents, once again depending on code paths and setup, a delete call may actually be going through the NSFNOTEUPDATEXTENDED callback with a flag set for UPDATE_DELETED.  If you look at the C API reference you will not that it states: "NSFNoteDelete specifies this flag when it calls NSFNoteUpdate in the process of writing the deletion stub to the disk."

      I'm still looking into the number of EM_NSFNOTEUPDATEXTENDED notifications as updated docs and will post an update when I have more information.