Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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

  1. Create an activity with a local variable.
  2. 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

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration 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 Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us