A compose agent is a stateful transformation event processing agent that joins two input event streams. It matches events from the left stream with events from the right stream and derives an output event from each matching pair. The operation resembles a relational join, but joins streams rather than tables. section 8.2.4 section 2.3.4
A compose agent processes events in several steps:
- Optionally filter events at the input terminals, then use a context to route them to the appropriate agent instance or instances. section 8.2.4
- Accumulate events in each instance. When a new event arrives on either input, pair it with previously received events from the other input. section 8.2.4
- Test each pair against a match condition. For every pair that satisfies it, derive an output event from the two inputs. section 8.2.4
The diagram shows the logical structure of a compose agent, including its two inputs, matching operation, and derivation step. section 8.2.4
Matching vehicle arrivals and departures
Cameras at either end of a highway section produce arrival and departure events. Each event contains a vehicle registration mark and an occurrence timestamp. A compose agent can match an arrival with a departure for the same vehicle, allowing the highway authority to see how long the vehicle spent on that section of road. section 8.2.4
Unlike an aggregate agent, which operates on successive events in one stream, a compose agent matches events across two streams. Matching and correlation also connect compose agents to pattern detection. section 8.2.4 section 8.5
