Joshua Hicks (JoshuaH7)
Charles Schwab

Charles Schwab
JoshuaH7 Member since 2016 1 post
Charles Schwab
Posted: March 2, 2021
Last activity: March 2, 2021
Posted: 2 Mar 2021 18:31 EST
Last activity: 2 Mar 2021 18:52 EST

How can I eliminate a Java step that uses pega.getWorkIDPrefix()

I'm using a java step in activity to generate a work object ID and would like to refactor the step into a function call, as prescribed by the severe warning I'm getting on the activity - "Java steps are difficult to maintain. Consider wrapping your logic inside a function and invoke your function using the Call-Function activity method."

The problem is this line of Java that uses a pega object:

String prefix = pega.getWorkIDPrefix(myStepPage.getClassName());


If I attempt to do the same in a function, I receive an error 

This record has 1 Error in 1 place line: 1 pega cannot be resolved


How can I get the pega object recognized by functions like they are in Java steps? 

Pega Platform 8.3.2 Case Management Financial Services Senior System Architect