Rule Loading & Ranking

Rule Loading

On application initialization:

  1. Built-in WidgetsRules.oss rules are loaded. Build-in rules are already precompiled and are part of the @ngx-metaui/rules

  2. UI Library Built-in WidgetsRules.oss rules are loaded

  3. If global application rule exists the Application.oss then its loaded inside ValueQueriedObserver and there can only be one for the entire application.

  4. On first reference to class name in the MetaUI context:

    • Introspection rules are created and they are loaded from app/rules/[EntityNamne].oss

Application code can call Meta APIs to programmatically load rules files or register rules.

Rule Ranking

  • Matching rules are applied in rank order to build the property map.

  • Rules from system (default rules) have lowest rank, then introspection rules, then application rules.

  • Rank is (roughly) the order of appearance in the .oss file (later == higher rank)

  • When multiple rules update the same property, type and key-specific merge rules are applied:

    • Maps and trait lists are merged

    • visible, editable, and valid expressions are chained with AND semantics (except if override value is used - e.g. visible=true!)

    • Other values are overridden