The UI Expression Language

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

UI Expression Language Syntax

Expressions in the UI expression language consist of a reserved keyword, which refers to an associated model node, qualified with a name that refers to an attribute of the model node.

An example of using the expression language is:

The node named #{amn.name} has a maximum quantity of #{amn.maxQuantity}.
  • All expressions start with #{ and end with }.

  • The keyword amn establishes a reference to the associated model node for a UI basic element.

  • Expressions are case-sensitive, including the keyword amn.

  • The keyword amn is always qualified by a reference to an attribute of the associated model node, following this form:

    #{amn.referenceName}
  • References must be to a valid attribute of the associated model node. Valid attributes are enumerated in the user assistance for configurator model node properties. References to attributes that don't apply to the associated model node generate errors when attempt to use them in expressions.

  • 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.

Uses for the UI Expression Language

Uses for the expression language include the following:

  • Creating 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}
  • Creating 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}
  • Storing a central set of Cascading Style Sheets (CSS) in a model node's supplemental attribute and using the expression language to generically refer to the CSS from a basic UI element's Inline Style attribute. Example:

    #{amn.suppAttr['InlineStyle']}