referencedAttributesInValueOf returns the distinct attributes referenced by an attribute’s value expression. It supports dependency ordering before generated fields are initialized. section 9.3.4 section 11.4
The query’s implementation follows the value expression rather than assuming a single direct reference:
- Read the attribute’s value expression and collect every Attribute Reference nested in its AST. section 11.4
- Extract each reference’s target attribute, ignoring unresolved references that are not valid AST references. section 11.4 section 9.3.4
- Remove duplicates so repeated references and multiple paths to one attribute produce one dependency. section 11.4
Computed rental values
A rental-price expression can reference two distinct attributes through three Attribute References. The query returns those two attributes once each, allowing dependencyOrderOf to place their generated fields safely. section 11.4 section 9.3.4
Listing 11.21 The reworked version of referencedAttributesInValueOf
const referencedAttributesInValueOf = (attribute) =>
referencedAttributesIn(attribute.settings["value"])
This compact implementation delegates value-expression analysis to the generic referencedAttributesIn query. section 11.4
