OptionalcontextUser: UserInfoThe acting user, used by the built-in RunView-backed lookup resolver
(required server-side; client-side may omit it).
OptionalpromptResolver: PromptResolverOptional resolver for prompt rule sources. Core does not depend on the AI
stack, so this is injected by a higher layer that has an AIPromptRunner (the bulk-update
processor supplies one). Omit it and any prompt rule reports a clear error instead of running.
OptionalentityDocumentResolver: EntityDocumentResolverOptional resolver for entityDocument rule sources. Core does not
depend on the templates/AI stack, so this is injected by a higher layer that can render an Entity
Document (the processor supplies one). Omit it and any entityDocument rule reports a clear error.
Computes and (unless DryRun) writes the rule results onto the entity, then Save()s it — so MJ
Record Changes versioning captures the before/after. No write occurs if any rule errored or nothing
changed.
A loaded entity to update.
The rules to apply.
Optionaloptions: EntityFieldRulesOptionsEntityFieldRulesOptions (context + dry-run).
Computes the per-field changes for a loaded entity — WITHOUT mutating it — coercing each new value to the target field's type. This is the dry-run primitive.
A loaded entity (its current values are the "old" side of the diff).
The rules to evaluate.
Optionalcontext: Record<string, unknown>Optional extra data the rules may reference (merged over the entity's fields).
StaticValidatePre-flight validation of a rule set against an entity's metadata. Pure + synchronous — safe to run
in a UX on every edit. Checks each rule's target field exists and is writable, and that any field
source reference resolves to a real field.
The target entity.
The rules to validate.
Optionalprovider: IMetadataProviderMetadata provider to resolve the entity (defaults to the global provider). Pass the owning provider in multi-provider contexts.
Metadata-aware application of a FieldRuleSet to MJ entity records. Instantiate once per bulk run and reuse across records so the underlying expression cache is shared. Holds an acting user for the built-in lookup resolver.