Skip to content

Reference Manual: Events

mvankeulen edited this page Sep 26, 2013 · 3 revisions

Events signal that something has happened. An event triggers all ECA rules associated with the event.

An event is also an object carrying attributes with information about the event. For example, the new_tweet event has an attribute text with the text of the twee message. In any expression inside the rule, you can access the attribute with .-notation. For example,

new_tweet.text

evaluates to the value the text attribute given that this expression occurs in a rule associated with the new_tweet event. All events have an attribute name with the name of the event (e.g., "new_tweet").

You can also create your own events from within a rule with the NewEvent action.

Event new_tweet

A new_tweet event is triggered upon receipt of an individual tweet.

Event-specific attributes:

  1. id : The tweet ID, an identifier that uniquely identifies every tweet.

  2. text : The text of the tweet message.

  3. time : The date and time of when the tweet was posted in seconds from ???WHEN???

  4. place : GPS coordinates of the place form where the tweet was sent; "None" if unavailable.

  5. user : The user who sent the tweet.

  6. json : The full dictionary of the tweet as received from the Twitter API.

Event initialize

The initialize event occurs when the rule engine starts hence before any other events. It can be used for initialization purposes. It has no attributes.

Event finalize

The finalize event occurs when the rule engine terminates hence after any other system-generated events (you can create user-defined events with NewEvent from a finalize rule which will trigger the associated rules after the finalize event). It can be used for finalization purposes. It has no attributes.