Event Framework | return |
The ActiveMath Event Framework is a mechanism for a powerful and flexible, yet rather loose integration of components. Typically, components need just a quick notification when events of interest occur in another service or component.
An example for event "publication" is the following: when the learner is finished working on an exercise, the exercise subsystem issues an event. This event carries information describing the learner, the identifier of the exercise, the success rate, the time stamp of the event, etc. Listeners to such an event can be the learner model as well as the suggestor of the tutorial component.
In contrast to a full-fledged messaging model, events are not sent from a specific sender to a specific recipient but remain anonymous: when publishing an event, the component is usually not aware who is listening to the events (only the module managing the subscriptions is). Also, usually the listener does not care which component or module created the event, it only knows where to subscribe to the events it is interested in.
Each event message object consists of attributes. The attributes common to all ActiveMath events are:
- a type, indicating what happened (eg, "user X has logged in", "new content available").
- a timestamp, indicating when it happened: indicates the wall-clock time of the event source when the event took place.
- a source, indicating where happened. Typically the name of the component that produced the event.
Event Tags
It is often desirable to group event types across several dimensions. However, events don't fit well into a rigid type hierarchy (e.g. is "user logged in" an application event? An user event? An interaction event?).
Therefore, ActiveMath uses event tags. Tags are labels for event types. Each event type can be associated to zero or more tags. Tag definitions can be nested, that is, a tag can inherit from another one. Multiple inheritance is allowed.
Tags can add attributes to an event. For example, the "user" event tag adds the attribute userId to an event. Tags defined without attributes (such as "application") just serve as marker tags. The following attributes are found in event tags, among others: user event tag (identifier of the user that caused this event, empty if user is anonymous); session event tag; item event tag (the identifier of the item, interaction and application event tag.