Question

15
Views
Hema Priya S (HemaPriyaS4912)
Ford

Ford
IN
HemaPriyaS4912 Member since 2021 2 posts
Ford
Posted: June 3, 2021
Last activity: June 3, 2021
Posted: 3 Jun 2021 3:31 EDT
Last activity: 3 Jun 2021 8:00 EDT

I try to use function in local library in expression builder but it throws error like this 

"Compilation failed for com.pegarules.generated.custom.PegaExpression Java source: package com.pegarules.generated.custom&#59; import com.pega.pegarules.priv.*&#59; import com.pega.pegarules.priv.database.*&#59; import com.pega.pegarules.priv.clipboard.PegaClipboardPage&#59; import com.pega.pegarules.priv.generator.DependentRuleInfo&#59; import com.pega.pegarules.priv.util.RulePool&#59; import com.pega.pegarules.pub.*&#59; import com.pega.pegarules.pub.clipboard.*&#59; import com.pega.pegarules.pub.context.*&#59; import com.pega.pegarules.pub.database.*&#59; import com.pega.pegarules.pub.dictionary.*&#59; import com.pega.pegarules.pub.infengine.*&#59; import com.pega.pegarules.pub.runtime.*&#59; import com.pega.pegarules.pub.services.*&#59; import com.pega.pegarules.pub.util.*&#59; import com.pega.pegarules.pub.generator.UnresolvedAssemblyError&#59; import com.pega.ibm.icu.math.BigDecimal&#59; import java.util.ArrayList&#59; import java.util.Date&#59; import java.util.HashSet&#59; import java.util.Set&#59; public class PegaExpression { public static Object evaluate(PublicAPI tools, ClipboardPage myStepPage) { PegaAPI pega = (PegaAPI) tools&#59; ClipboardProperty pz_1 = pega.<java.util.Date>resolveMethodCall("FRVDate--(int)", "FRVDate", null, null, new Object[] { 44235 })&#59; return (pz_1)&#59; } } Deta
"Compilation failed for com.pegarules.generated.custom.PegaExpression Java source: package com.pegarules.generated.custom&#59; import com.pega.pegarules.priv.*&#59; import com.pega.pegarules.priv.database.*&#59; import com.pega.pegarules.priv.clipboard.PegaClipboardPage&#59; import com.pega.pegarules.priv.generator.DependentRuleInfo&#59; import com.pega.pegarules.priv.util.RulePool&#59; import com.pega.pegarules.pub.*&#59; import com.pega.pegarules.pub.clipboard.*&#59; import com.pega.pegarules.pub.context.*&#59; import com.pega.pegarules.pub.database.*&#59; import com.pega.pegarules.pub.dictionary.*&#59; import com.pega.pegarules.pub.infengine.*&#59; import com.pega.pegarules.pub.runtime.*&#59; import com.pega.pegarules.pub.services.*&#59; import com.pega.pegarules.pub.util.*&#59; import com.pega.pegarules.pub.generator.UnresolvedAssemblyError&#59; import com.pega.ibm.icu.math.BigDecimal&#59; import java.util.ArrayList&#59; import java.util.Date&#59; import java.util.HashSet&#59; import java.util.Set&#59; public class PegaExpression { public static Object evaluate(PublicAPI tools, ClipboardPage myStepPage) { PegaAPI pega = (PegaAPI) tools&#59; ClipboardProperty pz_1 = pega.<java.util.Date>resolveMethodCall("FRVDate--(int)", "FRVDate", null, null, new Object[] { 44235 })&#59; return (pz_1)&#59; } } Details: Optional[---------- 1. ERROR in /com/pegarules/generated/custom/PegaExpression.java (at line 25) ClipboardProperty pz_1 = pega.<java.util.Date>resolveMethodCall("FRVDate--(int)", "FRVDate", null, null, new Object[] { 44235 })&#59; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type mismatch: cannot convert from Date to ClipboardProperty ---------- 1 problem (1 error) Compile failed. ]"

 

 

I try to use function in local library in expression builder but it throws error like this 

***Edited by Moderator: Pooja Gadige to move from Pega Academy to Product, add platform capability tag***
Pega Platform 8.5 Low-Code App Development