liveBook · Manning

Event value

As explained in Event Processing in Action

The portion of an event representation that carries event-specific data apart from shared header information.

An event value, or payload, carries data describing a specific occurrence. It is distinct from the header, which carries generic metadata such as the event type and occurrence time. Like a file’s contents compared with its name and access time, the payload contains the information of interest while the header describes it. section 3.1.1 section 3.3

An event type dictates which attributes may appear in its payload. An event instance always has a header, but need not have a payload. It may also contain free-format open content, which is not constrained by the event type. section 3.1.1

A delivery bid payload

A Delivery Bid carries a requestId, driver, store, committedPickupTime, and optional ranking. The requestId is a common attribute shared with other event types; driver and store refer to entities in the application’s global state. section 3.3.4

Table 3.3. Payload attributes for the Delivery Bid event type

Attribute name

Data type

Occurrence

Semantic role

requestId Integer required Common attribute
driver String required Reference to driver entity
store String required Reference to store entity
committedPickupTime DateTime required  
ranking Integer optional  

The attribute table shows each Delivery Bid field’s data type, whether it is required, and any semantic role. section 3.3.4

Payload values can also be added as an event is processed. For a Delivery Request, the flower store supplies the initial required attributes; the application enriches the event with the store’s minimum driver ranking and neighborhood. A shared requestId can match events concerning the same delivery. section 3.5.2

Platforms differ in the structures they support. A flat event type has one occurrence of each attribute, all with simple data types; this makes attributes easy to access but does not naturally represent variable or complicated structures. Some platforms support structures, repeating or optional attributes, and open content; a complicated event can also be preprocessed into a flat type. section 3.6.1

Event type definitions can be entered in graphical tools or expressed in files. In one XML-based approach, each payload property has a name and an XPath expression locating its value in the event document. Another approach defines the payload directly as an XML Schema element. section 3.6.2

Listing 3.1. DeliveryRequest event type defined using ruleCore
<EventDef eventType="DeliveryRequest"> <Description>Event: DeliveryRequest</Description> <Properties> ... <Property name="requestId"> <base:XPath>string(base:EventBody/user:requestId)</base:XPath> </Property> <Property name="store"> <base:XPath>string(base:EventBody/user:store)</base:XPath> </Property> <Property name="addresseeLocation"> <base:XPath>string(base:EventBody/user:AddresseeLocation) </base:XPath> </Property> <Property name="requiredPickupTime"> <base:XPath>string(base:EventBody/user:requiredPickupTime) </base:XPath> </Property> <Property name="requiredDeliveryTime"> <base:XPath>string(base:EventBody/user:requiredDeliveryTime) </base:XPath> <Property name="minimumRanking"> <base:XPath>string(base:EventBody/user:minimumRanking) </base:XPath> </Property> </Properties> </EventDef>

The DeliveryRequest definition pairs payload property names with XPath expressions for locating values. section 3.6.2

How Event Processing in Action covers it

How deep it goes
Explains payload attributes and semantic roles, then compares flat and complex structures and platform-specific definitions.
Examples
Uses Delivery Bid attributes and Delivery Request enrichment to illustrate payload fields and their roles.
What you can do after
Evaluate event payload definitions by inspecting attribute types, requiredness, semantic roles, and structural complexity.
How it connects
Connects event types and headers to open content, event enrichment, and event correlation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Event Processing in Action. The section links point to the parts of the book it draws on.