Skip to main content


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

Examples of expressions

Updated on January 14, 2022

Expressions provide a wide range of computations. Some examples of expressions are:

Constants

An expression can be as simple as a single literal constant.

"Good Evening"
142
true
20050705
0x143F871A

Single property references

An expression can reference a single property, identifying the page on which it is found. In the context of an activity, an expression can reference a parameter or local variable.

.Price
parameters
MortgageLoan.Application.ZIPCode
primary.pyLabel

Aggregate property references

You can identify aggregate properties or parts of aggregate properties. (The property mode of the target must match the result of the expression.)

MortgageLoan.Application.Address(4)
Globe.Division(7).Unit("West")
Invoices.pyOrders(2).pyItems("Manuals").pyItemNames

Linked property references

You can identify properties accessed through linked properties, using the syntax .property1.property2., where property1 is the linked property and property2 is a property reference in the linked class.

Note: Note the initial period character before the property name. (When no initial period is present, the system assumes that property1 is a page name.)
.pyUpdateOperator.pyLabel
.pyUpdateOperator.pySkillsPrimary(6)

Arithmetic, logical, and comparison operators

You can use most Java operators for arithmetic, string operations, comparisons, and conditions. Use parentheses to control the order of evaluation.

.Price * (1+(.Tax/100)) + ShipInfoPage.ShippingCost
.pyEffortActual >= .pyEffortForecast
3.14159*.radius *.radius

Function calls

Your expressions can call built-in functions, functions in standard libraries, and custom functions.

@SUM(.SubComponents().Price)
@Pega-RULES:MapTo.Function(argument1, argument2)

All combined

Expressions can incorporate all the elements described in this topic together:

@SUM(.SubComponents(38+.Offset).Price)

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