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.

More about HTML Fragment rules

Updated on April 5, 2022

Use HTML fragment rules to define universally available HTML parts, such as style sheets and scripts, including JavaScript files. During stream processing, a JavaServer Pages (JSP) tag can insert this text into other HTML rule instances.

Comparing HTML fragments with HTML rules

You can create a "universal" part in an HTML rule by using the ultimate base class ( @baseclass ) as the Applies To part of the key.

If you use an HTML fragment instead, then at runtime the system avoids the overhead of the class inheritance algorithm, improving runtime performance.

Comparing HTML fragments with static Web server files

If the HTML (or scripts or style sheets) text does not contain JavaServer Pages (JSP) tags, you can place the HTML in a text file rule rather than in a fragment rule. The system exports a text file rule to an appropriate directory the first time that the file is needed. In contrast to fragment rules, text file rules are not processed again, so using this approach improves performance.

You can incorporate static elements into your HTML forms and displays using normal HTML means, such as the following in the <HEAD> section:

<SCRIPT SRC="https://docs-previous.pega.com/filename.js" TYPE="text/JavaScript>

</SCRIPT>

<LINK HREF="https://docs-previous.pega.com/ruleprostylesheet.css" REL="STYLESHEET" TYPE="text/css">

You can view the generated Java code of a rule by clicking ActionsView Java. You can use this code to debug your application or to examine how rules are implemented.

Parent class

Through directed inheritance, the immediate parent class of the Rule-HTML-Fragment class is the Rule-Stream class.

Security

If your application rulesets contain HTML-Fragment rules, run the Rule Security Analyzer before locking a ruleset version, to look for possible security issues.

  • include JavaServer Page tag
  • Rule Security Analyzer

    To make Pega Platform applications more secure, you can run the Rule Security Analyzer. This tool searches through non-autogenerated rules to find specific JavaScript or SQL coding patterns that match regular expression rules, some of which might indicate security vulnerabilities, as detailed below.

  • About HTML Fragment rules

    Use HTML fragment rules to define universally available HTML parts, such as style sheets and scripts, including JavaScript files. During stream processing, a JavaServer Pages (JSP) tag can insert this text into other HTML rule instances.

  • HTML Fragment rules - Completing the New or Save As form

    HTML Fragment rules

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