Package com.inductiveautomation.eventstream


@NullMarked package com.inductiveautomation.eventstream

Shared model for Event Streams — the types exchanged between the gateway runtime, the Designer, and RPC callers.

An Event Stream carries an EventPayload (event data plus optional metadata) through a pipeline of stages (source, filter, encoder, transform, handlers). The stage names, metric keys, and built-in type ids live in EventStreamConstants; per-stage subpackages (config, encoder, stage, rpc, scripting) build on this model.

Transfer types. EventPayload itself never crosses the wire: it is a gateway-runtime type, handed to user code (transform and handler scripts index into it), and its data can be any object at all. What the Designer needs is not the payload but a description of it, so the gateway encodes the event first and ships EventPreview instead — serialized over RPC via that type's nested GsonAdapter.

EventPreview.Success carries the encoded data as text and the event's metadata as a JsonObject. It is a read-only Designer-facing snapshot that never reaches user code — its consumer (the AI grounding) walks the keys to render prompt text — so converting the tree to a map and back would be work with no reader. The gateway builds it once via

EventPayload.getMetadataAsJson() and the adapter passes it through untouched in both directions.

The rule of thumb for a new metadata-carrying transfer type: rebuild as plain Java objects if scripts will touch it, keep the JSON tree if only the platform will.