Support Article
Expression builder does not evaluate local variables
SA-69914
Summary
Error occurs in the activity Expression builder when using local variables in the expression.
Error Messages
Compilation failed for com.pegarules.generated.custom.PegaExpression Java source: package com.pegarules.generated.custom; import com.pega.pegarules.priv.*; import com.pega.pegarules.priv.database.*; import com.pega.pegarules.priv.clipboard.PegaClipboardPage; import com.pega.pegarules.priv.generator.DependentRuleInfo; import com.pega.pegarules.priv.util.RulePool; import com.pega.pegarules.pub.*; import com.pega.pegarules.pub.clipboard.*; import com.pega.pegarules.pub.context.*; import com.pega.pegarules.pub.database.*; import com.pega.pegarules.pub.dictionary.*; import com.pega.pegarules.pub.infengine.*; import com.pega.pegarules.pub.runtime.*; import com.pega.pegarules.pub.services.*; import com.pega.pegarules.pub.util.*; import com.pega.pegarules.pub.generator.UnresolvedAssemblyError; import com.pega.ibm.icu.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.HashSet; import java.util.Set; public class PegaExpression { public static Object evaluate(PublicAPI tools, ClipboardPage myStepPage) { PegaAPI pega = (PegaAPI) tools; return (pega.<java.lang.String>resolveMethodCall("whatComesAfterLast--(String,char)", "whatComesAfterLast", null, null, new Object[]{Street, ' '})); } } Details: Optional[---------- 1. ERROR in /com/pegarules/generated/custom/PegaExpression.java (at line 26) return (pega.<java.lang.String>resolveMethodCall("whatComesAfterLast--(String,char)", "whatComesAfterLast", null, null, new Object[]{Street, ' '})); ^^^^^^ Street cannot be resolved to a variable ---------- 1 problem (1 error) Compile failed.]
Steps to Reproduce
- Create an activity with a local variable.
- Set a property with @Functionname(Local.myVariable,).
Root Cause
A defect in Pegasystems’ code or rule.
Resolution
Perform the following local-change in the Expression builder of an activity:
Use @function(localparam) format instead of @function(Local.localparam).
BUG-417128 is raised for this issue.
Published January 5, 2019 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.