Skip to main content


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

assert JavaServer Page tag

Updated on August 10, 2022

Use the assert JavaServer Page tag to improve processing efficiency when displaying the results of the Obj-List method.

Summary

In an activity that uses the Obj-List method, you identify the concrete classes for the Page List property that holds the results from the method. However, when you display the Page List in an HTML display, the system has no way — other than the Assert tag — to indicate in the HTML which classes are involved.

Accordingly, at runtime the system rechecks the class of each page in the list. The pega:assert tag provides a way to indicate in the HTML which classes to use for each page.

If you're working with a class group, use the elseassert option for each class in the class group. In addition, use a final elseassert option to display something when the system doesn't find anything in any of the classes listed. Someone later might add a class to a class group and neglect to update the Assert tag in HTML forms. In such cases, the elseassert option can be important for debugging.

Complete syntax

In the syntax presentations below:

  • Square bracket characters [ and ] define optional parts of the tag. Do not type the brackets.
  • JSP delimiters <pega: and /> mark the start and end of the tag.
  • Replace any text in italics with your choice of value of that type.
<pega:assert name="class-name1" >
	insert content
	<pega:elseassert name="class-name2" />
	insert content
	<pega:elseassert />
	insert default content
</pega:assert>

Example

For example, in a worklist, the data belongs to a page of class Code-Pega-List. Each pxResults page is limited to one or a few classes. The assert tag reduces the number of rules the system reads to generate the display.

<pega:forEach name=".pxResults" >
	<pega:withEmbedded name="$this" >
		<pega:assert name="Assign-Worklist" >
			insert row definition
		</pega:assert>
	</pega:withEmbedded >
</pega:forEach>

You can assess the benefits of the assert tag by using the Performance tool to compare the Rule Count number when the assert tag is used with the number when it is not used.

JavaServer Pages tags

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