UI Expression Language

You can use the UI expression language to dynamically create values for text parameters of basic UI elements according to the associated model node attributes of any basic element UI item.

Syntax

Each expression includes a reserved keyword that references a model's node. You qualify it with a name that references an attribute on the model's node. For example:

The node named #{amn.name} has a maximum quantity of #{amn.maxQuantity}.
  • You must start each expression with #{ (pound sign and left curly bracket) and end it with } (right curly bracket).

  • The amn keyword creates a reference to the model's node for a UI basic element.

  • Each expression is case sensitive, including the amn keyword.

  • You must always qualify the amn keyword with a reference to an attribute of the model's node:

    #{amn.referenceName}
  • You must refer to valid attribute. Valid attributes are enumerated in the user assistance for configurator model node properties. If the attribute isn't valid, then Configurator will create an error when you attempt to use it in an expression.

  • UI expression attribute references are formed by putting the initial letter of the attribute name into lower case. The prefixes Is and Has are omitted from expression references.

The following table summarizes attribute references in the UI expression language.

UI Expression Language Reference

Refers To

Example Expression

name

The name of the associated model node.

#{amn.name}
description

The description of the associated model node.

#{amn.description}
quantity

The quantity of the associated model node.

#{amn.quantity}
boundQuantity

Attributes named like IsBoundQuantity

#{amn.boundQuantity}
hasChildren

Attributes named like HasChildren

#{amn.hasChildren}
value

The value of a transactional attribute, if the associated model node is an attribute under the root model node.

#{amn.value}

suppAttrs['<suppAttrName>']

The value of the named supplemental attribute.

#{amn.suppAttrs['color']}
userAttrs['<UDAttrGroup>.<UDAttrName>']

The value of the named user-defined attribute.

#{amn.userAttrs['PhysicalAttributes.Color']}

Restrictions on the UI Expression Language

The following restrictions apply to UI expression language expressions.

  • Expressions are case-sensitive.

  • Expression attribute references must be to attributes that are valid for the associated model node. This validation is also applied if you change the associated model node for an element.

  • The expression language can be used with all model node system, user and supplemental attributes, but only for the text parameters of basic UI elements. The basic UI elements are: Text, Image, Spacer, and IFrame. The text parameters are: Text, Inline Style, Style Class and URL.

  • References to elements of a collection or list aren't valid. Example of invalid reference: #{amn.children[0].name}.

  • References to transactional item attributes are only valid when the associated model node of a basic UI element is a transactional attribute under the root node of the model. Valid reference expression: #{amn.value}.

  • If an attribute value of the associated model node isn't available at run time, the displayed value is blank. If an expression can't be evaluate at run time because an attribute value isn't available, the displayed value is N/A.

Typical Uses for the UI Expression Language

You typically use the UI Expression Language to:

  • Create a Text basic UI element in a user interface page to dynamically display the minimum and maximum values of its associated model node. Example:

    Min: #{amn.minValue}
    Max: #{amn.maxValue}
  • Create an IFrame basic UI element where the IFrame's URL is dynamically augmented to provide query parameters. Example:

    https://www.mysite.com:1000/perform?taskID=#{amn.value}
  • Store a central set of Cascading Style Sheets (CSS) in a node's supplemental attribute and use the expression language to generically refer to the CSS from a basic UI element's Inline Style attribute. Example:

    #{amn.suppAttr['InlineStyle']}