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.
The following tabs are available on this form:
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.
Where referenced
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.
Access
Use the Records Explorer to list all HTML fragment rules available to you.
Category
HTML fragment rules are instances of the Rule-HTML-Fragment rule type. They are part of the Technical category.
- HTML Fragment rules - Completing the New or Save As form
HTML Fragment rules
- Creating a content security policy
Create a content security rule so that browsers load resources only from authorized web sites.
- List View form - Understanding the HTML tab
HTML tab on the List View form
- Declare Trigger form - Completing the Pages & Classes tab
Use this tab to list the clipboard pages referenced by name in the Triggers tab. See How to Complete a Pages & Classes tab for basic instructions.
- More 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.
- Viewing generated Java code of Access When rules
- Improving your compliance score
Follow development best practices to improve your compliance score. By eliminating risks, such as custom code or degraded performance, you can improve quality and resolve issues before your application goes into production.
- JavaServer Pages tags
- 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.
Previous topic More about Sections Next topic HTML Fragment rules - Completing the New or Save As form