You are here: Reference > Rule types > Correspondences > More about Correspondence rules

  More about Correspondence rules
 

  1. About 
  2. New 
  3. Corr 
  4. Prompts 
  5. Pages & Classes 
  6. Security 
  7. History 
  8. More... 

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 workspace. 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 PDN articles:

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

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:

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:

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

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

Java code display

When you save a correspondence rule, the system converts HTML and JSP tags (or directives) to Java source code. As a learning or debugging aid, you can review this Java code.

Click the Show Java toolbar button to see to see the system-generated Java code that implements the correspondence rule. The window presents a read-only preview of the Java that implements this rule instance. This Java code is not identical to the Java that executes at runtime, which includes Java code inlined from other rule instances and reflects rules in the requestor's RuleSet list.

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.

Definitions attachment category, correspondence, fragment, stream processing, verify
Related topics About Correspondence Fragment rules
About JSP tags
Property references in expressions
Include JSP tag
Property-Set-Corr method
Reference JSP tag
Standard rules Standard correspondence rules

About Correspondence