Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Defining the local variables for an activity

Updated on November 15, 2021

Use the Local Variables section to create scalar variables.

Local variables are stored together as fields in the Java class that the Pega Platform generates to implement the activity. These require less memory and execute faster than regular parameters. They are often used to pass information from step to step.

Local variables do not appear on the parameter page.

A local variable of type StringBuffer may be assembled in multiple steps, as a Property-Set on a StringBuffer appends the value to the StringBuffer.

Use the Local keyword to reference a local variable in a Property-Set method.

Note: To avoid Java null pointer exceptions, the system initializes String local variables to the empty string, and the StringBuffer local variable as:
public StringBuffer aBuffer = new StringBuffer();
Caution: Accordingly, do not list a local variable as the destination for an Out parameter. Do not pass a parameter reference as the destination for an Out parameter, unless passing the entire parameter page.
FieldDescription
Local Variables
NameEnter the name you choose for the local variable, any legal Java identifier. See How to enter a Java identifier. Don't choose a name that starts with pz or any of the reserved names.
DescriptionEnter a text description of this local variable, for information only.
Data TypeSelect the type of data that is expected as the value for the variable. Choose:
  • String for a Java.lang.string object
  • String Buffer for a Java StringBuffer object
  • int for a Java int
  • double for a Java double
  • boolean for a Java boolean
  • char for Java char
  • BigDecimal for the BigDecimal class
  • Object for any Java object
Local Action for Parameter Display
Local ActionOptional. Specify a flow action to use at runtime to produce a prompt form in which a user can enter values for the flow parameters specified in this tab.

Have a question? Get answers now.

Visit the Support 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.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us