Chapter 3. Defining the events
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
Event Processing in Action ebook for free