Expression Builder

The Expression Builder provides users with a visual, drag and drop way to build ClarioScript Expressions. ClarioScript Expressions allow users to manipulate data in a wide variety of ways. The Expression Builder is found in the Transform, Filter, Screen, and Treatment nodes, and while each of these nodes uses Expressions to manipulate data in different ways, the actual process of building Expressions is always the same.

../_images/expressionBuilder_annotatedOverview.png

The Expression Builder consists of three main areas: Expression Library, Expression Editor, and ClarioScript Preview.

Expression Library

To the left of the Expression Editor and ClarioScript Preview, is a box that contains three tabbed lists:

  1. Functions f(x) - the functions available to be invoked by an Expression
  2. Attributes [att] - the attributes available to be referenced in an Expression
  3. Constants cons - typed containers for the constant values to be referenced in an Expression. Project-level constants are listed in blue.

All Functions, Attributes, and Constants are themselves considered Expressions in Clario. View the Functions and Constants available in the Expression Library for each node that uses the Expression Builder.

Expression Editor

../_images/expressionBuilder_annotatedExpressionEditor.png

To build an Expression, select a Function, Attribute, or Constant from the Expression Library and drag and drop it into the Expression Editor, where it is visually represented as a tile. Whenever a second expression is added to the Expression Editor, an Operator is added between them. Expression Tiles may be added before, after, or in-between Expression Tiles already in the Expression Editor. Drag and drop actions allow for Expression Tiles to be reordered anywhere in the Expression Editor.

Expressions can be dropped directly into the Argument Tile of a Function Tile. This will create a Nested Expression. You can drill into a Nested Expression by double clicking anywhere on the Argument Tile. You can back out one level of any expression by clicking on the [Back] button. To return to the outermost level, click on the [Home] button.

When an Argument Tile is left blank, no Expression has been added to the Expression Editor, or the return type does not match the expected type a configuration error is indicated via red highlighting and an informative tooltip.

To edit the name or type of the Expression, type a new name in the Name field or choose a different Type from the drop down. Attribute names may only consist of the following characters: A-Z, a-z, 0-9, ‘-‘, and ‘_’.

When finished building the Expression in the Expression Editor, click [Save] to exit the Expression Builder and return to the configuration tab of the node. Or, click [Cancel] to exit without saving.

ClarioScript Preview

The ClarioScript Preview located above the Expression Editor contains a preview of the ClarioScript for the Expression. This view is read-only; to edit the ClarioScript directly, open the Code Editor from the node configuration. In the ClarioScript Preview, bold code indicates the current level of the Expression being manipulated in the Expression Editor, and red code indicates the portion of the Expression where an error exists.