Back Forward Expressions — Examples

  Show all 

C-471 04-01Expressions provide a wide range of computations. Some examples of expressions are:

Constants

An expression can be as simple as a single literal constant. See Constants in Expressions for more information.

"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. See Property references in expressions for more information.

.Price
param.InterestRate
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.) See How to reference parts of aggregate properties.

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

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. See Operators in expressions for more about each operator and precedence.

.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. See Functions in expressions.

@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)

Up About expressions