-
Notifications
You must be signed in to change notification settings - Fork 4
Reference Manual: Events
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.
A new_tweet event is triggered upon receipt of an individual tweet.
Event-specific attributes:
-
id : The tweet ID, an identifier that uniquely identifies every tweet.
-
text : The text of the tweet message.
-
time : The date and time of when the tweet was posted in seconds from ???WHEN???
-
place : GPS coordinates of the place form where the tweet was sent; "None" if unavailable.
-
user : The user who sent the tweet.
-
json : The full dictionary of the tweet as received from the Twitter API.
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.
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.