AbstractAbstractEnrichEnrich (append columns to) the query result rows. Implementations should return a row array of the same length and order, mutating/cloning each row to add their derived column(s). On any unrecoverable condition they may throw — RunQuery's guard will log and fall back to the original rows.
the enricher-specific config from RunQueryEnrichment.Config
OptionalcontextUser?: UserInfothe request user — required server-side for isolation/audit
Optionalprovider?: IMetadataProviderthe owning provider for multi-provider-correct data access
Optionalquery?: QueryInfothe loaded query metadata, when available (lets an enricher read the query's associated entity, fields, etc.)
the assembled query result rows to enrich
Abstract seam for a post-query row enricher. Concrete enrichers live OUTSIDE MJCore (e.g. an ML-scoring enricher in Predictive Studio) and register themselves on the MJGlobal ClassFactory via
@RegisterClass(QueryResultEnricherBase, '<key>'). RunQuery resolves the registered enricher by key and awaits EnrichResults just before returning, appending whatever columns the enricher produces.Enrichers MUST be resilient: an enrichment failure must never break the underlying query. RunQuery wraps the call in a try/catch and falls back to the original rows, but enrichers should also degrade gracefully (return the input rows unchanged) rather than throwing for recoverable conditions.