Channels and Events : Types of Events

Types of Events
BusinessEvents processes three kinds of events:
Simple Event  A representation of a single activity (usually a business activity) that occurred at a single point in time. The SOAPEvent event type inherits from SimpleEvent.
Time Event  A timer. Time events can be configured to repeat at intervals, or they can be scheduled using a function in a rule or rule function.
Advisory Event  A notice generated by BusinessEvents to report an activity in the engine, for example, an exception.
BusinessEvents creates instances of simple events and time events based on user-configured event definitions. The following sections provide more detail on each type of event.
Inheritance  You can use inheritance when defining simple events.
Attributes  In addition to user defined properties, events have built-in attributes for use in rules and rule functions. For example, simple events have these attributes: @id, @extId, @ttl, and @payload. Concepts and scorecards also have built-in attributes. See TIBCO BusinessEvents Developer’s Guide for details.
Simple Events
A simple event definition is a set of properties related to a given activity. It includes information for evaluation by rules, meta-data that provides context, and a separate payload -- a set of data relevant to the activity.
For example, suppose you are interested in monitoring the creation of new employee records. You might create a simple event definition that includes important fields from the employee record, perhaps the social security number, department, and salary. You could then write a rule to create an instance of this simple event each time a new employee record is created.
A simple event is an instance of a simple event definition. It is a record of a single activity that occurred at a single point in time.
Just as you cannot change the fact that a given activity occurred, once an event is asserted into the Rete network, you can no longer change it. (Before assertion you can use an event preprocessor to enrich the event, however.) Simple events expire when their time to live has elapsed, unless BusinessEvents has instructions to consume them prior to that time.
Example 1: A temperature sensor records a reading that is above a predefined limit. The payload might include the temperature-sensor ID, the reading, and the date and time. This simple event might trigger a complex event that would immediately notify a manager.
Example 2: A customer purchases four airline tickets from San Francisco, California to San Jose, Costa Rica. The payload might include the date and time of purchase, the date and time of the flight, the purchase price, the credit card number, the flight number, the names of the four passengers, and the seat assignments. This simple event alone may include no exceptions. However, it is possible that when examined within the context of other related events, an exception may arise. For example, one or more of the passengers may have booked tickets on another flight during the same time period.
Time Events
A time event is an event definition that triggers the creation of event instances based on time. There are two ways to configure a time event:
Rule based  A rule schedules the creation of a time-event instance at a given time.
Time-interval based (Repeat Every)  BusinessEvents creates a time-event instance at regular intervals.
Advisory Events
Advisory events are asserted into the Rete network automatically when certain conditions, for example, exceptions, occur. Add the AdvisoryEvent event type to rules to be notified of such conditions. An advisory event expires after the completion of the first RTC cycle (that is, the time to live code is set internally to zero). The types of advisory events are described next.
Exception  The BusinessEvents engine automatically asserts an advisory event when it catches an exception that originates in user code but that is not caught with the catch command of the BusinessEvents Exception type. (For information on working with exceptions, see Exception Handling in TIBCO BusinessEvents Developer’s Guide.)
BusinessEvents-ActiveMatrix BusinessWorks Integration  Advisory events are also used in the container mode BusinessEvents-ActiveMatrix BusinessWorks integration feature invokeProcess() function. Such events are asserted when the ActiveMatrix BusinessWorks process fails or times out (or is cancelled).
Engine Activated Advisory Event  An advisory event is asserted when an engine has finished starting up and executing startup functions (if any).