Using Expressions
Intended audience: USERS DEVELOPERS ADMINISTRATORS
AO Platform: 4.3
Overview
When configuring Properties across the different Composers, users can either enter a) an absolute value or, if the result is based on some calculation or value only known/available at runtime, b) an expression. This topic describes the different expression options in the UI available - typically identified by a lightning bolt or pencil icon next to a property:
MSO Query Functions Expressions - this dialog opens when the lightning bolt icon is associated with an MSO field property - mostly in the MSO Composer, but also available when configuring Filters in Easy Answers Dashboards.
DB Column Expression - this dialog opens when the pencil icon is clicked associated with a DB Column property in the MSO Sourcing page.
Expression Builder - this dialog opens when the lightning bolt icon is associated with most other properties (ie. not MSO field properties) - across all Composers.
MSO Query Function Expressions
The MSO Query Function Expressions are available from the Expression dialog available from MSO field properties - mostly in the MSO Composer.

In the Expression dialog, add MSO Query Expression in the Expression field, and/or select MSO Query Functions from the lightning bolt icon, then configure any required Parameters (if needed). For a full list of the MSO Query Functions, see the Functional Configurations > Query Functions page in the Admin solution.
Concatenation of two String properties using CONCAT() function | Concatenation of two String properties using Pipe (II) operator | Dialog with all MSO Query Functions |
---|---|---|
![]() | ![]() | ![]() |
DB Column Expression
The DB Column Expression is available from the MSO Composer > Sourcing page in the MAPPING section of the data source being configured. Instead of mapping MSO Properties to a specific DB Column, a database expression can be added by clicking the pencil icon, then using the DB Column dialog to enter an SQL expression, and enabling the “Is Expression” toggle.
In the following example, a new MSO Property, Age, has been created, which is mapped to an SQL expression instead of an existing DB Column available in the data source.

The expression uses a CASE - THEN - END construct to resolve the “length_of_service” value into three output values (New, Moderate, and Old) depending on three range definitions.

Expression Builder
The Expression Builder is used in Pipeline Composer, Application Composer, Annotation Composers, and Model Composer to create a dynamic configuration for a particular property resolved at runtime. The options in the Expression Builder depend on the property for which the Expression Builder has been opened. The entry point for the Expression Builder is the lightning bolt icon next to many properties as seen in the example below.

When clicked, the Expression Builder opens up allowing the user to enter the configuration for a Dynamic Value or an Expression. Click the Save button to save the configuration or Cancel to discard.

Value Type
Dynamic Value - use this if the property requires a single input value from some other object at runtime, ie property isn’t defined by a constant value. Example: Configurations >
CORE.appId
Expression - similar to Dynamic Value, but use Expression if property value configuration has more complexity, ie needs one or more functions, variables, methods, and/or operators to be defined. Example: Configurations >
ao_ConfigHelper:getValue("CORE","appId") + "_test"
Input field - enter/edit the Dynamic Value or Expression manually, or select from the Elements list and subsequent options.
Validate button - only available for Expression input allowing user to check that the Expression has been constructed and return the expected result.
Elements
Only those Elements relevant for a given property will be shown.
Elements | Description | Available for Dynamic Value | Available for Expression |
---|---|---|---|
Configurations
| Yes | Yes | |
Request Parameters
| Use this Element type if some property may need input at runtime. See Running a Pipeline / Previewing an Application section below. | Yes | Yes |
Fields
| Only available in the Pipeline Composer, - and the Fields option will only appear if a property is configured to eg. Reference an MSO. If that’s done, a Field from the Referenced MSO can be selected. | Yes | Yes |
Variables
| Only available in the Pipeline Composer, - and if Variables have been configured on the Variables page in the Pipeline Composer. Variables have a similar purpose to Request Parameters, but with the significant advantage that many additional capabilities can be defined for each variable, including a default value used if no input is provided. Variables can also be associated with JS functions that can provide styling/formatting of the input Variable. See Running a Pipeline and Configuring Variables in Pipeline Composer sections below. | Yes | Yes |
Lambda Functions
| This Element refers to the Java 8 implementation, ie a Lambda expression is a short block of code that takes in parameters and returns a value. Lambda expressions are similar to methods, but they do not need a name and they can be implemented right in the body of a method. To select a Lambda Function in the Expression Builder, the user must first reference his Lambda Expressions Class in the Settings panel in Pipeline Composer. See Adding Lambda Expressions Class in Pipeline Composer section below. | Yes | |
Expression Classes
| User can select from a number of different AO Platform specific Classes and Methods, or from some standard Apache/Java utility Classes typically in order to transform data. | Yes | |
Expression Variables
| Yes | ||
I18N
| This Element is used to allow String properties for “Display Names” to be referenced based on a language code. This is important if a Solution is created to be supported by different languages. If a language other than English is selected, but no language pack is available for the selected language, the default English will be used instead. | Yes | Yes |
JSON
| If a property can take a configuration JSON format as its input, selecting the JSON element will allow the user to manually enter (or paste) such JSON content. | Yes | Yes |
Running a Pipeline / Previewing an Application
If Request Parameters and/or Variables have been configured for properties in a Pipeline or an Application, and the user selects to Run/Preview during configuration to test it, a dialog will be shown allowing the user to provide the required Variables or Request Parameters as input to the process.

Dialog is shown when a user selects to Run a Pipeline with Variables and/or Requests Parameters
Configuring Variables in Pipeline Composer
In order for Variables to appear as selectable Elements in the Expression Builder, the Variable(s) have to be configured first on the Variables page (on the left side of the Pipeline Composer). Multiple Variables can be added, each with a Default Value as well as many other properties determining the UI styling/formatting of the Variable.

Adding Lambda Expressions Class in Pipeline Composer
The Settings panel in the Pipeline Composer contains a dropdown for selecting a Lambda Expressions Class. Select the needed Expression Class in order for Lambda Functions to appear in Expression Builder.
