Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Expressions

Updated on January 14, 2022

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.

For information about SQL functions, see Report Definitions — Using the Calculation Builder.

The information in this topic discusses creating Java expressions.

Expressions in Pega Platform look similar to formulas in Microsoft Excel but are based on Java language conventions.

You can type in an expression, or (in many places) use the Expression Builder to guide you in entering an expression. Expressions can include constants, property references, operators for arithmetic and logical operations, parentheses to control the order of evaluation, and functions.

Expressions can perform operations on data, including:

  • Performing mathematical operations
  • Comparing property values
  • Manipulating text
  • Transforming data
  • Converting data types (casting)
Note: Expressions , which are used in many situations , differ from Declare Expression rules, which create expressions that are evaluated automatically. Declare Expression rules contain expressions, but so do many other rule types.

Expressions in rule forms

You can enter expressions in activities, data transforms, Constraints rules, and most other places that compute a value at runtime.

In rule forms, the sorts of expressions you can enter into fields in the forms depends on the defined behaviors of the rule form's fields and what sorts of entries they allow. The field in which an expression appears determines whether the expression is part of:

  • The right-hand side of an assignment to a property
  • The computation of a value
  • A Boolean (or logical) expression (yielding a true/false value)
  • A property reference containing an expression as a subscript

You can also use expressions in most fields that allow a constant value. Similarly, you can use expressions to supply the subscript value of a list or group element within a property reference.

You cannot use expressions in fields that require property references as the destination of assigning a value. For example, you cannot use an expression in the Target column of a Set action in a data transform or in the Property-Set method parameter array.

Expressions in HTML and XML streams

Through the <when> JSP tag and Java scriptlets (or the<when> directive and Java directive), you can include expressions in HTML-based rules or XML Stream rules. You can use these in HTML rules, XML Stream rules ( Rule-Obj-XML rule type) and correspondence rules ( Rule-Obj-Corr rule type).

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us