Skip to main content

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

pyEditElement error: The code for the static initializer is exceeding the 65535 bytes limit

Updated on May 17, 2024

This error might occur when a Decision Data rule contains multiple propositions that are spread across various ruleset versions. At the time of the error, the proposition is either blank or is not displayed at all, even if the Decision Data rule references a valid pyEditElement section.

Message text example

When this error occurs, you can see the following message in the application logs:

Caused by: Failed to compile generated Java com.pegarules.generated.
                html_section.ra_stream_pyeditelement_17219faeab387d2d16b2d485081ba8c3: ---------- 
                1. ERROR in /com/pegarules/generated/html_section/ (at line 51)
                public class ra_stream_pyeditelement_17219faeab387d2d16b2d485081ba8c3 extends StreamBuilderSection implements StreamBuilder, FUASupport, FUAReusable, WebAllowable { 
                The code for the static initializer is exceeding the 65535 bytes limit 
                1 problem (1 error) 
                Compile failed.


The error is caused by the pyEditElement section that does not compile properly. The root cause of the compilation error is the way Java generation works for such circumstanced rule types as pyEditElement. Java compiles circumstanced pyEditElement sections in the system from the non-circumstanced base version that exists only in the @baseclass. As the number of Decision Data rule instances and the corresponding properties grows across multiple ruleset versions, the java compilation of the pyEditElement exceeds the 65,000 byte threshold.

To recover from the error, use the .pzCleanupEditElement utility. Use the utility by tuning its parameters and calling it as part of a wrapper activity to clean up pyEditElement sections for a single or multiple Decision Data rules.

Note: You can enable Debug logs for the DSM Utils library (com.pegarules.generated.pega_decisionengine_dsmutils) before running the .pzCleanupEditElement utility. Subsequently when you run the utility, you can expect to see logs that specify the redundant pyEditElement sections that the system identified for cleanup.

Cleaning up redundant pyEditElelement sections from Decision Data rules

In this example use case, you received compilation errors for the Phones and Tablets Decision Data rules, under the Sales business issue. These rules were saved or edited in multiple ruleset versions; DMSample:08-03-01 through DMSample:08-03-12.

Perform the following steps to fix the compilation errors:

  1. Set the Param.DecisionDataWithClassNames parameter to "DMOrg-DMSample-SR-Sales-Phones:Phones,DMOrg-DMSample-SR-Sales-Tablets:Tablets"
    where the parameter value is a comma-separated list of fully qualified Decision Data rule names in the format pyClassName:pyPurpose.
  2. Call the pzCleanupEditElement utility and pass the parameter page.
  3. Monitor the utility status.
    The utility status is set to FAIL in case of a failure.
    Running the pzCleanupEditElement utility as part of a wrapper activity
    An activity form with a step that calls the pz cleanup edit element utility.
Result: The utility deletes the pyEditElement sections that are associated with the Phones and Tablets Decision Data rules in DMSample:08-03-01 through DMSample:08-03-11, even if any of the affected ruleset versions is locked. The utility does not delete the pyEditElement section for the rules in the most recent ruleset version (in this case, DMSample:08-03-12).

Excluding rulesets from the cleanup

You can encounter the compilation error with default Decision Data rules that are part of Pega Customer Decision Hub, or applications that you built on top of them. In such a case, do not delete the pyEditElement section from the application engine rulesets, for example, PegaMKT-Engine.

Instead, edit the pySkipDeleteEditElement When rule to specify the rulesets to skip when cleaning up redundant Decision Data rules.

  1. In the navigation pane of Dev Studio, click Records.
  2. Expand the Decision category, and then click When.
  3. Open the pySkipDeleteEditElement rule.
  4. In the Advanced tab, click Add condition.
  5. Specify the condition to skip a ruleset.
    For example: @startsWith(.pyRuleSet,Pega-MKT-")
  6. Save the rule.
  • Previous topic Edits to the rule form layout are not propagated
  • Next topic Troubleshooting the Decision Data Store service

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

Close Deprecation Notice
Contact us