The Expression Builder is a tool that guides you in authoring arithmetic and logical expressions in a natural language format. For example, you can compute an employee's salary by defining a calculation that uses properties, such as the number of years employed, employee review rating, and job grade level.
You can open the Expression Builder in multiple locations throughout Dev Studio by clicking the Build an expression icon. For example, you can enter expressions in activities, data transforms, constraints, and most other places that compute a value at run time.
For more information about using the tool, see Building expressions with the Expression Builder.
The Expression Builder provides the following features:
- Build expressions in an integrated text editor
- Add functions and properties into the text editor
- Search for properties and non-internal functions.
The following figure shows the list of results for a keyword search:
- Select properties and functions while entering text in the text editor
The following figure shows some example suggestions:
- A navigation pane that displays functions in available libraries and properties within a selected page
- Automatic bracket matching
- Syntax validation
The following figure shows an example of syntax validation:
- Building expressions with the Expression Builder
Create calculations that save you time by automatically providing values in your application by authoring expressions in the Expression Builder. The Expression Builder eases the construction of expressions in your application by providing a large input area, prompting for functions, prompting for properties, and adding the ability to test your results.
An expression is a single text element that when produces a string value. Users create both SQL expressions (or functions) for use in report definitions and Java expressions for use in activities and other rules.
- Examples of expressions
Expressions provide a wide range of computations. Some examples of expressions are:
- Constants in expressions
An expression can consist of only a constant — also called a literal value — or can include constants, operators, property references and functions.
- Functions in expressions
Functions extend the power of Pega Platform expressions. An expression can contain many function calls, including calls to built-in functions, standard functions, and custom functions that you create. Use the Function Builder to help find the function that you need.
- Displaying all functions in the Expression Builder
Build advanced expressions that automate calculations in your application by displaying internal functions and libraries from your entire system in the Expression Builder. By default, the Expression Builder displays only non-internal libraries and functions. You can display all functions in the system by overriding the pyShowInternalLibrary When rule setting.