BetaBetaRegisters a new condition in the registry.
The condition's ID must be unique across all registered conditions. If a condition with the same ID already exists, this method throws an error. It's recommended to register conditions during application startup.
The condition to register. Must have a unique ID.
Optionalmetadata: ConfigMetadataOptional metadata associated with the condition. The ConfigMetadata fields passed here move onto RulePrimitive fields when migrating to RuleRegistry.
OptionalgetBetaRetrieves metadata for all conditions in the registry.
This method returns an array of metadata objects containing information about all registered conditions, including their IDs, types, and configuration details.
An array of condition metadata objects, or undefined if not supported by the registry implementation.
BetaRetrieves a specific condition by its unique identifier.
If no condition with the given ID exists, this method throws an error. Use ConditionRegistry.hasCondition first if you need to check for existence.
The unique identifier of the condition to retrieve.
The condition with the specified ID.
BetaRetrieves all registered conditions.
This method returns a list of all conditions currently in the registry, regardless of their type. This can be useful for debugging, inspection, or building dynamic UIs that need to enumerate available conditions.
An array of all registered conditions.
BetaChecks whether a condition with the given ID exists in the registry.
This method is useful for defensive programming, allowing you to verify that a condition exists before attempting to retrieve or remove it.
The unique identifier of the condition to check.
true if a condition with the ID exists, false otherwise.
BetaRemoves a condition from the registry.
The condition is identified by its ID. If no condition with the given ID exists in the registry, this method throws an error.
The condition to remove. Must exist in the registry.
Central registry for managing conditional evaluation rules across the application.
The ConditionRegistry acts as a global repository for Condition instances, allowing different parts of the application to register, retrieve, and evaluate conditions. This is particularly useful for:
Components typically access the registry via the platform service and register their conditions when the application initializes. Conditions can be added and removed dynamically, allowing for flexible runtime configuration.
Example
Registering and using conditions in a component
See
Deprecated
Use RuleRegistry instead.