Skip to main content


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

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.

Best practices for using the SAVE directive

Updated on May 3, 2020

Summary

When the save JSP tag (or directive) is used in a hand-crafted XML rule, HTML rule, HTML property rule, or other stream rule, choose a value for the name attribute that is unique application-wide or even system-wide..

 

Suggested Approach

The save JSP tag saves a name/value pair to a temporary scratchpad during stream processing. execution.

As an example, suppose that one HTML rule contains the following JSP tag:

<pega:save name=”result” ref=”.Total” />

If a completely separate HTML rule sets the name “result” as well, a collision of values may occur.

<pega:save name=”result” ref=”.FinalPrice” />

If an activity calls the first HTML rule and later called the second HTML rule, the first would set the temporary save name of “result” to the value in the .Total property. 

The second rule resets this temporary save name to the value in the .FinalPrice property.  If subsequent rules expect the .Total property value, the application will fail or return unexpected results.

To avoid this issue, create specific or unique names for the save tag. 

Examples

<pega:save name=”TotalResult” ref=”.Total” />

<pega:save name=”PriceResult” ref=”.FinalPrice” />

This prevents the system from overwriting values on the scratchpad and, as a result, returning unexpected results.

NOTE:  Do not use any values beginning with px, py, or pz. These are prefixes reserved for internal Pega object names, and can also cause unpredictable results if used as a save name.

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