[id='cep-events-con_{context}']

= Events in complex event processing

In {PRODUCT}, an event is a record of a significant change of state in the application domain at a point in time. Depending on how the domain is modeled, the change of state may be represented by a single event, multiple atomic events, or hierarchies of correlated events. From a complex event processing (CEP) perspective, an event is a type of fact or object that occurs at a specific point in time, and a business rule is a definition of how to react to the data from that fact or object. For example, in a stock broker application, a change in security prices, a change in ownership from seller to buyer, or a change in an account holder's balance are all considered to be events because a change has occurred in the state of the application domain at a given time.

Events have the following key characteristics:

* *Are immutable:* An event is a record of change that has occurred at some time in the past and cannot be changed.
+
[NOTE]
====
The {RULE_ENGINE} does not enforce immutability on the Java objects that represent events. This behavior makes event data enrichment possible. Your application should be able to populate unpopulated event attributes, and these attributes are used by the {RULE_ENGINE} to enrich the event with inferred data. However, you should not change event attributes that have already been populated.
====

* *Have strong temporal constraints:* Rules involving events usually require the correlation of multiple events that occur at different points in time relative to each other.
* *Have managed life cycles:* Because events are immutable and have temporal constraints, they are usually only relevant for a specified period of time. This means that the {RULE_ENGINE} can automatically manage the life cycle of events.
* *Can use sliding windows:* You can define sliding windows of time or length with events. A sliding time window is a specified period of time during which events can be processed. A sliding length window is a specified number of events that can be processed.
