Referencing other rules and static files
Your HTML rule can include HTML text and JSP tags or directives. It can reference other HTML, style sheets and scripts that are defined in rules of these types:
- HTML Fragment rules
- Text file rules
These rule types support the HTML rule type. None by itself defines an entire user interface display. Rules of these types can be included, referenced, or linked into your HTML rule. HTML rules are the only user interface rules that run directly from an activity. Also, HTML rules are the only user interface rules for which class inheritance applies:
<pega:include>JSP tag to incorporate HTML fragments, and other HTML rules, into your main HTML rule. The HTML fragment may also reference Web server files, extracted from a binary file rule or text file rule.
<pega:reference >JSP tag to incorporate property values.
At runtime, the system processes HTML rules in the context of a user's current clipboard (a source of values for properties). It interprets directives and retrieves clipboard values to create HTML for the server to send to the browser using either the HTTP or HTTPS protocol. This is known as stream processing.
After you save the form, click
or type the equivalent keyboard shortcut
to view an approximate runtime rendering of the HTML rule.
Using the Tracer
To trace the start and end of HTML rule executions:
- Access the Tracer.
- Click Settings to open the Tracer Settings panel.
- Under the Rule Types to Trace section, select the Stream Rules check box.
Where HTML rules are referenced
After you complete and save an HTML rule, you can cause the system to evaluate and display it in any of several ways:
- In a section or harness.
- In a flow action.
- In an activity step using the Show-HTML method. Identify the HTML rule as the first parameter.
- From a Submit button in another HTML rule that defines a form, using the following syntax for a stream defined on the current primary page (which must be a named, top-level page) or defined in the @baseclass class:
<INPUT TYPE="submit" NAME="pyStream=myStream">
- From a Submit button in another HTML rule that defines a form, using this syntax for a stream defined on a page other than the current primary page:
<INPUT TYPE="submit" NAME="pyStream=myStream &pyPrimaryPageName="otherPrimaryPage">
You can use the same specification in a URL directive to define an anchor that selects this processing. If the stream is based on the current primary page, include the
PRIMARYkeyword option in the URL directive.
You can view the generated Java code of a rule by clicking. You can use this code to debug your application or to examine how rules are implemented.
Through directed inheritance, the immediate parent class of the Rule-Obj-HTML class (and of several other classes containing HTML text) is the Rule-Stream class, not the Rule-Obj- class.
If your application rulesets contain HTML rules, run the Rule Security Analyzer before locking a ruleset version to look for possible security issues.
- stream processing
- Introducing JavaServer Page tags
- Property references in expressions
- Rulesets to trace
You can select the rulesets to trace in the Tracer Settings dialog box. The dialog box lists all of the rulesets that you can access, in the order they appear in your ruleset list, based on your access group and other sources.
- About HTML rules
Use an HTML rule to describe how the system is to assemble, through stream processing, portions of HTML displays in your application.
- HTML rules -
As a best practice, before creating a new HTML rule, it is strongly recommended that you investigate using an auto-generated section instead. The New form displays a message with information about that alternative.