Overview

Chapter 3. Defining the events

```html

The chapter introduces the idea that event processing begins with carefully defining what an event is and, more specifically, what kinds of event objects an application will handle. It distinguishes between an event occurrence in the real world and the event object used in software to represent it, then argues that event types provide the reusable blueprint for those objects. Rather than defining events one by one, designers define a shared structure for a whole class of similar events, allowing systems to process them consistently while still accommodating untyped sources through typing or translation.

At a high level, an event is described as having a header, a payload, and sometimes open content. The header carries meta-information such as event type, occurrence time, detection time, source, identity, certainty, and annotation, while the payload contains the domain-specific data that describes what happened. The chapter explains which header attributes are required, optional, or forbidden, how temporal granularity affects timestamp precision, and how payload attributes can be simple or complex, including spatial location values and references to external entities. It also introduces semantic roles for payload attributes, especially entity references and common attributes that let multiple event types share meaning and support correlation across related event instances.

The chapter also explains that event types can be related to one another through membership, specialization, generalization, and retraction. Using the Fast Flower Delivery example, it shows how a small set of raw event types can model a delivery workflow with shared headers, correlated payload attributes, and a mixture of producer-supplied and system-generated values. Finally, it steps back to discuss practical implementation issues across platforms, such as differences in payload complexity, attribute data types, and predefined headers, and surveys ways event types are represented in tools, XML-based schemas, and industry standards. The overall message is that clear event definitions are foundational for reliable, portable event processing designs.

```
Logical structure of an event instance, showing its three constituent parts
The event type definition element consists of attributes that describe the contents of the event header and payload, and a list of relationships between this event type and other event types.
A traffic monitoring example showing three different location data types (point, line, and area) used by different intelligent transport applications
The Delivery Request event type, shown in the WebSphere Business Events Design Data tool. You can see the payload attributes at the right of the picture.
Listing 3.2. The DeliveryRequest event type defined using XML Schema

FAQ

What is an event type in Event Processing in Action, Chapter 3?An event type is a specification for a set of event objects that share the same semantic intent and structure. Every event object is treated as an instance of an event type.
What are the three main parts of an event instance?An event instance consists of a header, a payload, and optional open content. The header stores metadata, the payload stores event-specific data, and open content can hold free-format information.
What information is usually stored in the event header?The event header contains meta-information such as event type identifier, occurrence time, detection time, event source, event identity, and sometimes event annotation or event certainty.
What is the difference between occurrence time and detection time?Occurrence time records when the event happened in the external world, while detection time records when the event became known to the event processing system. They may differ depending on when the event is observed or submitted.
What are payload attributes?Payload attributes are the event-specific data fields that describe what actually happened. Each payload attribute has a name and a data type, and may be required, optional, or repeated depending on the event type definition.
What is a common attribute?A common attribute is a payload attribute whose meaning is shared across multiple event types in the same application domain. Attributes with the same name are considered semantically equivalent and can be used to correlate related events.
What is an entity reference attribute?An entity reference is an event attribute whose value refers to a specific external entity, such as a driver or store. It can be used to look up additional information or to partition event processing by entity.
What does the open content indicator tell you?The open content indicator specifies whether free-format open content is required, optional, or not allowed in an event instance. It controls whether the event may include information beyond the defined payload attributes.
What kinds of relationships can exist between event types?Chapter 3 describes four relationships: membership, generalization, specialization, and retraction. These relationships express how event types are related semantically, including composite membership and logical reversal.
How are event types represented in real event processing platforms?Real platforms vary widely: some use flat structures, some support optional or repeating attributes, and some use XML or schema-based definitions. The chapter explains that there is no single standard, so event types are often mapped to the native representation of the platform being used.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Event Processing in Action Event Processing in Action ebook for free