You are here: Reference > Streams and JSP > JavaServer Pages tags > assert

assert JavaServer Page tag

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:

<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.

Related topics Obj-List method

JavaServer Pages tags