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?