
Expressions and comparisons
Expressions and comparisons
Pega Robot Studio™ allows you to implement expressions and comparisons to drive specific decisioning rules and to create the desired outcomes related in the project requirements. Expressions and Comparison components help to add conditions in the workflow and create or manipulate data values within the workflow.
Expressions
The BooleanExpression component of Pega Robot Studio allows you to add a logical statement that is either TRUE or FALSE. The BooleanExpression component can evaluate double, integer, string, and boolean datatypes and identifier values. You must specify the type of input used in the expression. Setting different data types for two parameters can invalidate the expression.
You can access the BooleanExpression component from the Comparisons & Expressions section of the Toolbox. Click the design block to enter the expression. Valid expressions include a > b, a < b, a > XXXX, a != b,a==b, or a==XXXX where XXXX is a hard-coded value. You can pass dynamic values to evaluate using the data ports enabled after the addition of an expression.
The Boolean Expression component provides you with an option to make a decision in a workflow. You can right-click on the output data node of Boolean Expression and select Make Decision. A decision design block appears on the screen and allows you to control the flow path of the workflow by using TRUE or FALSE logical paths.
The StringExpression component allows you to add standard string functions (such as concatenation to two string inputs) to the solution. The values can be dynamic or hard-coded data. In the case of hard-coded values, enclose the value in quotation marks.
The NumericExpression component allows you to perform standard mathematical functions such as addition, subtraction, and so on. You can also pass decimal values to the expression. The number of significant digits (precision) of decimal numbers is set using Decimals property.
Only BooleanExpression allows you to make a decision in the workflow. StringExpression and NumericExpression do not have the provision to add a decision design block.
Comparisons
Pega Robot Studio provides you with a group of comparison components to perform simple logical comparisons. Comparison components yield either True or False result events. You can find the comparison components in the Comparisons & Expressions section of the Toolbox.
The comparison components accept a single input and compare it against a static value. In the following example, the input data is compared against the static value 1000 to yield TRUE or FALSE result. Ensure the data type of the hard-coded value matches the data type on the input.
The default data type of the values in comparison components is Double. In the case of dynamic input, the data type of the value automatically changes to match the input value.
This Topic is available in the following Module:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?