Chapter 04

Paragraph rules

The words live in Pega Paragraph Rules, and a decision table chooses which ones show. One small trick, the pyWorkPage prefix, causes most of the surprises.

Pega 24 – 26

Words you will meet

  • Paragraph rule
  • pyWorkPage
  • IsParagraphApplicable

Phase 4 · Step 10

Create the paragraph rules.

  1. In Dev Studio: Create → User Interface → Paragraph.
  2. Save each rule to your work class: MyApp-Work-PaymentReminder.
  3. Use the pyWorkPage prefix for every case property reference (explained below).
PR_Salutation
<p>Dear << pyWorkPage.CustomerName >>,</p>
PR_Closing
<p>Yours sincerely,<br/>The ACME Team</p>
PR_BodyStandard
<p>Your bill of << pyWorkPage.AmountDue >> is now overdue. Please pay now.</p>
PR_BodyGold
<p>We note your balance of << pyWorkPage.AmountDue >>. As a Gold member, please pay at your convenience.</p>

Paragraph text is illustrative. The << … >> markers are where a case value is merged into the HTML.

The one trick

Why pyWorkPage?

The same applies to the decision table in the next step. Try it: untick the prefix on either one and watch what the letter does. These are the first two rows of the troubleshooting table, in action.

Break the prefixTry it: untick a pyWorkPage. box and read the letter

MembershipLevel on the case

Make a mistake on purpose

The letter on screen

Dear Sam Rivera,

Your bill of $120.00 is now overdue. Please pay now.

Yours sincerely, The ACME Team

What the engine did

  1. GenerateDocumentContent(DocumentID = DOC0003)
  2. Section LETTER_START: 1 paragraph row
  3. PR_Salutation: not conditional, include
  4. Section LETTER_BODY: 2 paragraph rows
  5. PR_BodyStandard: IsParagraphApplicable, row MembershipLevel = STANDARD is true, include
  6. PR_BodyGold: IsParagraphApplicable, no row matched, otherwise returns false, skip
  7. Section LETTER_END: 1 paragraph row
  8. PR_Closing: not conditional, include

The Paragraph table, and which rows made it in

  • PAR0101LETTER_START · seq 1PR_SalutationincludedDear << pyWorkPage.CustomerName >>,
  • PAR0102LETTER_BODY · seq 1PR_BodyStandardincludedYour bill of << pyWorkPage.AmountDue >> is now overdue. Please pay now.
  • PAR0103LETTER_BODY · seq 2PR_BodyGoldskippedWe note your balance of << pyWorkPage.AmountDue >>. As a Gold member, please pay at your convenience.
  • PAR0104LETTER_END · seq 1PR_ClosingincludedYours sincerely, The ACME Team

Illustrative: a simulation of the example in this guide, not a real Pega system.

Phase 4 · Step 11

Specialise the decision table.

The IsParagraphApplicable decision table controls which conditional paragraph shows, here based on MembershipLevel. You do not edit the original: you save a copy to your own class and ruleset.

  1. In Dev Studio, search for the rule IsParagraphApplicable.
  2. Click Save as and save to your work class and ruleset.
  3. Add the following rows to your specialised copy:
Rows of the specialised IsParagraphApplicable decision table
Document IDSection nameParagraph IDpyWorkPage.MembershipLevelReturn
DOC0003LETTER_BODYPR_BodyStandardSTANDARDtrue
DOC0003LETTER_BODYPR_BodyGoldGOLDtrue
otherwisefalse

Your turn

Questions and comments

Stuck on something, or have a thought? Write it here. To talk about one part, use the Comment button under that section's heading.

A hands-on guide by Sanjeev Kujur. Independent, and not affiliated with or endorsed by Pegasystems.

Tested against Pega Infinity v26 / Constellation v26 · Updated 5 Nov 2026