EventRunningScope
Receiver passed to every dev.catbit.mosaic.client.ui.sdui.foundation.events.EventRunner.runEvent call — one fresh instance per event execution, built by EventManager.runEvent right before dispatching to the matching EventRunner.
It carries this event's own identity (triggerOwner) and the payload it received from whatever fired it (incomingData), and exposes every collaborator a runner needs: continuing the chain by firing one of this event's own outgoing triggers (onTrigger), running an arbitrary EventSchema outside trigger matching (runEventInline/runEventsInline), publishing on the screen's broadcast channel (broadcastData), editing/reading the live tile tree (tilesEditor, tilesEventDispatcher, tilesOverlaysEditor, tilesValueProducer), reading/writing screen-scoped in-memory data (screenDataHolder), reaching further screen-level behaviors (screenBehaviorsHolder), and resolving arbitrary dependencies from the app's Koin scope (get/getOrNull/getAll).
Constructors
Properties
the payload this event received from whatever triggered it — the previous event's outgoing data via onTrigger, or null when nothing was passed (e.g. this event's own trigger fired directly off a tile interaction with no payload).
further screen-level behaviors this event may need, beyond the tile tree and data holders exposed directly above.
screen-scoped in-memory data storage (plain, segmented, navigation) — backs screenPlainData()/screenSegmentedData()/screenNavigationData() reads and writes.
surface for mutating the live tile tree by id (add/remove/replace/update tiles) — backs events like AddTiles, RemoveTiles, UpdateTiles.
surface for routing local TileEvent/TileGroupEvent instances and for looking up/patching EventSchemas already registered on the tree by id — backs TriggerEvent, UpdateEvents.
surface for adding/dismissing id-addressed overlays (bottom sheet, modal bottom sheet, dialog) — backs DisplayBottomSheet, DismissDialog, and their siblings.
surface for reading a value a specific tile currently produces, by tile id and key — backs the Tile data source used by GetData/EvaluateData.
the EventSchema currently executing — its own events list is what onTrigger filters against.
Functions
Casts this value to Map<String, AnySerializable?>, or returns null if it isn't a map — the common shape incomingData takes when an upstream event produced a JSON object (e.g. a parsed network response body, or a GetData result assembled from several readings).
Publishes data on this screen's own broadcast channel, via screenBehaviorsHolder — the mechanism behind ScrollColumnTile/ScrollRowTile/ScrollPagerTile and the overlay open/close/dismiss commands (DisplayNavigationDrawer, DisplaySnackbar, and their dismiss/close counterparts), all of which are fire-and-forget commands addressed to a tile id or to "whatever is listening on this screen" rather than a direct tile-tree mutation.
Resolves an instance of T from the app's Koin scope — the way a runner reaches any framework-provided singleton (NetworkParametersHolder, DataMailer, CancellableEventsHolder, use cases, etc.) or any dependency registered through MosaicDependencyInjectionConfig.additionalKoinModule.
Same as get, but returns null instead of throwing when no binding is registered for T — useful for an optional collaborator a custom event may or may not have wired up.
Non-reified overload of getOrNull.
Logs throwable at error level via the app's MosaicLogger, prefixed with tag — the standard way every built-in EventRunner records a failure before firing its own onFailure trigger.
Runs whichever of triggerOwner's own events declare a trigger structurally equal to eventTrigger — the whole mechanism behind event chaining. Filtering is a plain equality check (data class equality, no listener registry); when no child matches, this call is a no-op beyond the debug log it always emits first.
Processes data — EventRunningScope.incomingData, already validated non-null by ProcessDataEventRunner before this is called.
Executes event's logic, ending by calling EventRunningScope.onTrigger (directly or, for a runner whose real work can fail in several distinct ways, from inside a runSafely/try-catch onError branch) with whichever outcome trigger applies — onSuccess()/onFailure() at minimum, plus whatever narrower triggers (onStart(), status-specific ones, cancellation, etc.) this event's own catalog entry declares.
Runs eventSchema immediately, bypassing trigger matching entirely — eventSchema does not need its own trigger to match anything declared on triggerOwner.
Runs every entry in eventsSchema in order, each via the same unconditional path as runEventInline — no trigger filtering, every entry runs regardless of the others' outcome.