More about Correspondence rules

Preview

After you save the correspondence form, click the Preview toolbar button to view an approximate run-time display of the correspondence in the lower half of the work area. If your clipboard contains pages that match those identified in the Pages & Classes tab, property values referenced in the correspondence rule appear in the display.

Examples and processing overview

For examples and additional information about correspondence, see these Pega Community articles:

  • Correspondence — Contents
  • How correspondence works
  • How to define correspondence using the rich text editor

After generation, correspondence items to be sent out are processed in background periodically by the SendCorr agent in the Pega-ProCom RuleSet.

Completed correspondence items are saved as instances of a Data-Corr- class, such as Data-Corr-Email or Data-Corr-Fax. In the normal case, when the correspondence is produced by flow processing, a Link-Attachment instance associates the Data-Corr- instance with the work item.

Standard flow actions

These standard flow actions support correspondence:

  • Work-.Notify, Work-NotifyQuick, and Work-.NotifyExternal support interactive correspondence.
  • @baseclass-.SendCorrespondence starts a screen flow to gather and validate correspondence details, before sending the correspondence.
  • Work-.AttachandHold and Work-.EditCategorizedAttachments support Word correspondence of a user-selected attachment category.

See Standard flow actions

Standard activities

In flows, you can use the two standard Notify activities named Work.-NotifyAll and Work-NotifyAssignee for correspondence related to an assignment.

Use the standard utility activity named Work-.CorrNew to generate correspondence without any user interaction. When you use this activity to generate email correspondence, you can set parameters so that all work item attachments, or all attachments of one or more specified categories, become attachments to the email message. Optionally, you can send the email to multiple TO: work parties, one or more CC: work parties, and one or more BCC: parties. You can associate a priority level of High or Low with a message, as expected by Microsoft Outlook.

Three standard low-level activities support outgoing email. Typically, these are called only by other standard activities:

  • Data-Corr-Email.Send — Can send in plain text or HTML format
  • @baseclass.SendEmailNotification
  • @baseclass.SendEmailNotificationwithAttachments
CAUTION:
In most situations, use only the Work-.CorrNew activity, a notify activity, or a flow action such as @baseclass.SendCorrespondence rather than calling any of these three low-level activities directly. This approach assures that
  • all needed parameters are gathered and validated
  • the outgoing email is associated with a work item and that the email appears in a work item History and Attachment display, supporting common legal or compliance requirements.

Digitally signed email

Your application can send digitally signed email messages, providing assurance to the recipients. See How to send digitally signed email.

Fragments

As an alternative to correspondence rules, you can create correspondence fragments, rules in the Rule-Corr-Fragment rule type. Use fragments for standard text that can be used in many different correspondence rules of different Applies To classes.

For example, you can use a fragment for a standard greeting, introductory or closing paragraph, or footer. By using a fragment copied into the correspondence rule using a <pega:include> JSP tag, you can avoid rewriting and maintaining common text in multiple correspondence rules.

Formats

Because correspondence rules are supported by stream processing, you can reference HTML styles or cascading style sheets (CSS files) in a correspondence rule. CSS files can ensure consistency in fonts, font sizes, layout, and appearance, whether final output is formatted by Microsoft Word or by a browser. Typically, a CSS file is stored in a text file rule ( Rule-File-Text rule type).

For example, you can use the CSS elements page-break-before and page-break-after to force page breaks in printed output. For example, this inline style element forces a new page:

<H1 style="page-break-before:always">Summary</H1>

Temporary files on user workstations

Correspondence processing can start a supported version of Microsoft Word on the user workstation. It creates temporary files in the directory identified by the Windows TEMP Environment variable, typically on the C: drive.

If the TEMP Environment variable does not exist or refers to a drive other than C:, the Pega Platform attempts to create a directory named C:\PegaTemp. If this is unsuccessful, it displays an error message and correspondence editing fails.

Detecting missing properties

Optionally, you can enable missing property detection for generated correspondence. Missing property detection checks all properties used in a generated correspondence for empty or Null values, including conditional correspondence fragment includes. Any properties referenced, but not actually used in the final correspondence, are not checked.

To enable missing property detection, create a one-step activity that runs prior to the correspondence being sent out which sets pxThread.pyTraceMissingProperties to true.. After the correspondence has been generated, Detected missing properties are then stored on the clipboard in the pxMissingProperties Page List, in the properties pxPropertyName and pxPropertyPath.

To disable this feature, setting the pxThread.pyTraceMissingProperties to false.

You can view the generated Java code of a rule by clicking Actions > View Java. You can use this code to debug your application or to examine how rules are implemented.

Parent class

Through directed inheritance, the immediate parent class of the Rule-Obj-Corr class (and of similar classes containing HTML text) is the Rule-Stream class, not the Rule-Obj - class.

Standard rules

Standard correspondence rules that apply to the Work- class include:

Name Type Purpose More
AcknowledgeSample Email Sample email message notifying an originator of a work item created that involves them.  
AcknowledgeSample PhoneText Sample phone text message notifying an originator of a work item created that involves them.  
AcknowledgeSample Mail Sample letter notifying an originator of a work item created that involves them.  
NewAssignment Email Email message notifies assignee of newly created assignment.  
PromptSample Mail Sample mail correspondence containing a user prompt.  
ResolutionSample Email Email message notifying a party that a work item is resolved. resolution
ResolutionSample Mail Letter notifying a party that a work object is resolved. resolution
ResolutionSample Phone Text Phone text message notifying a party that a work item has been resolved. resolution