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.
Fragments are useful to hold frequently needed HTML text, JavaScript, or style (CSS) text. Use the include JSP tag to instruct the system to copy at runtime the fragment text into the final HTML text during HTML generation.
An HTML fragment can be included in another HTML fragment, an HTML rule, or a control rule. A correspondence fragment can be included in another correspondence fragment or in a correspondence rule.
In contrast to text file rules, HTML fragment rules can contain JSP tags and so can produce dynamic content that depends on property values.
For highest quality and security, minimize the use of HTML fragment rules you create in application rulesets. While HTML fragment rules are necessary for specific features, use of auto-generated sections in flow actions and harnesses is preferable when possible. Auto-generated rules may often provide better performance, greater security, greater levels of browser independence, and more consistent branding and styles than hand-crafted rules.
If your application rulesets contain HTML fragment rules, use the Guardrails landing page to assess guardrail compliance, and use the Rule Security Analyzer to check for security vulnerabilities.
You can reference HTML fragment rules in several other rule types that contain editable HTML or XML text.
Use the <pega:include>
JSP tag in another rule to cause the system to incorporate the fragment rule HTML text at runtime.
Use the Records Explorer to list all HTML fragment rules available to you.
HTML fragment rules are instances of the Rule-HTML-Fragment rule type. They are part of the Technical category.