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
The DeliveryRequest definition pairs payload property names with XPath expressions for locating values. section 3.6.2
