Events are:

  • Noun
  • Verb

Verb is operation:

  • Import (question)
  • Create
  • Retrieve (question)
  • Update
  • Delete
  • Move
  • Archive
  • Merge (question)
  • User request (e.g. user searches for sessions and wants to launch some process on the results)

Noun is event target:

  • Identified by some criteria: ID and data type with hierarchy,1

     data types, etc. 

  • Actor data: user who made the event happen, for example, maybe other info about the event context. These could be in a map of attributes on the event, event acceptance can be calculated based on matching one or more attributes.

Each event will have a payload. How are these defined?

Many "events" aren't discrete points in time, so events also require status: started, completed, failed, etc. Unlike workflows, these aren't persisted as a unique timeline. We may need some way to associate events across an entire operation, but we can revisit later.

Definition of the noun will depend on the particular operation and context and would be defined in the event itself.

Event responders would be the way to wire to a data event. The basic event responder interface would indicate whether an event should be accepted and something about the event payload. Different base implementations for, e.g., handling events by data type, by other attributes.

This really is IFTTT.

An API to get sample events.

Ref Notes

The data type hierarchy is the full stack of inheritance. For example, an MR session is:

  • xnat:mrSessionData
  • xnat:imageSessionData
  • xnat:subjectAssessorData
  • xnat:experimentData

You could say you want an xnat:mrSessionData or an xnat:experimentData and the MR session would match either one.

1 Comment

  1. Rick Herrick AUTHOR

    I attached with skeleton event and event handler classes that would fit into the xdat library.

    The JSONB database attribute library is hibernate-native-json from Marvin Froeder. The Measurements class in the XNAT DICOM segmentation demo uses this for its measurements property.