You are here: Portals > Case Manager portal > Case attachments

Case attachments

An attachment identifies a file, screen shot image, URL, or text note that a user or activity associates with a case.

Classes for attachments

The system stores attachments in instances of the following concrete classes, subclasses of the Data-Work Attach- class:

By default, attachments are stored as rows of the pc_data_workattach table. Attachments are not stored in the same database table as the cases.

File attachments

When a user designates a file as an attachment, the system uploads a copy of the file and links it to the history of the work item. The system saves attachments for correspondence in HTML format (.htm file type) even if a user edited the correspondence with Microsoft Word. If the correspondence includes embedded images or other embedded objects, the attachment is saved as a .zip archive containing the objects and the .htm file. The system converts the .zip file internally into characters using Base64 encoding.

The description text (Subject field) of a file attachment is limited to 60 characters.

By default, file attachments are restricted to 1 gigabyte in size. You can set a larger or smaller limit with the prconfig.xml file setting:

<env name="Initialization/MaximumFileUploadSizeMB" value="nn" />

where nn is the size in megabytes.

Note: As an alternative to updating the prconfig.xml file, you can use Dynamic System Settings to configure your application. See Prconfig settings and classifications.

If a user accesses the Pega 7 Platform server with the HTTPS protocol (rather than HTTP), this may block certain download operations from the server to the workstation. For details and suggestions, see PDN article Troubleshooting: "Internet Explorer cannot download messages" (Tomcat with SSL).

Optionally, you can choose to store file attachments for an application in an external content management system such as Alfresco. This capability requires the optional Pega-Connect ruleset.

File attachment versions

File attachments are normally a permanent read-only part of the history of a work item. However, in some applications, you can edit and update the attached file (using Windows workstation software), creating a higher-numbered version of the file attachment. The application retains all versions, in sequence. You can edit the description of a new version to add a number or other distinguishing information.

For example, a photograph stored as a .jpg file might be difficult to interpret or might contain extraneous material. When rules have the appropriate configuration, you can open and manipulate the .jpg file (using Windows imaging software) to crop, filter, or annotate the image. Pega 7 Platform retains the original unaltered file as the first edition and the updated file as the second edition.

Similarly, you can edit a project plan file with Microsoft Project, or revise a Microsoft Word document, and so on.

The standard flow action Work-.EditAttachment supports opening and editing file attachments.

Case attachments in CMIS repositores and web storage providers

You can configure your application to access and store case attachments in external CMIS repositories and web storage providers. You can enable this option on the Integration & security tab of the application rule. You can also maintain versions of case attachments that are stored in CMIS repositories.

For more information about accessing and storing case attachments in web storage providers, see Case and Pulse attachments in web storage providers.

Case attachment versions in CMIS repositories

You can configure your application to access, store, and manage versions of case attachments by using external ECM repositories that support CMIS. You can check out, lock, and locally edit a case attachment that is stored in an external ECM repository that supports CMIS. You can also check in the case attachment to create a new version of the attachment. The application retains all versions in sequence.

For more information, see Case attachments in CMIS repositories.

URL and URI attachments

URL and URI attachments can provide flexibility and power while requiring little storage. A URL can point to a document or file on an intranet or the World Wide Web. A URL can also cause Pega 7 Platform to execute an activity in your application; the activity can search or retrieve a document or file, call an external system, and so on.

See PDN article Linking to external documents versus importing them as work item attachments.

Screen shot (screen capture) attachments

You application can include a window capture feature, so that you can capture a picture of any desktop window and permanently save this image as a screen shot attachment to a work item (an instance of the Data-WorkAttach-ScreenShot class). While not readable by automated processes, the screen shot image provides evidence of facts, values, signatures, or similar information from outside systems and sources.

The image file, usually in the .jpg file format, is stored internally as characters using Base64 encoding. Use the Advanced View of the standard History and Attachments display to include screen shot attachments.

The prScreenCapture ActiveX control supports this capability.

Scanned document attachments

A user with a scanner attached to her workstation can use Pega Document Scanning to scan documents and attach them as TIFF or GIF image files to work items. The standard Work-.pyCreateScannedDocument local flow action starts this operation. The user can also configure scanner defaults from this flow action.

Use the Work-.ViewImageAttachments flow action to view scanned image attachments from within the Pega 7 Platform application. Use the Advanced View of the standard History and Attachments display to enter screen shot attachments.

Virus checking

Files received from any source might contain computer viruses. You can connect your application's processing of work item attachments to an external virus-checking module. Virus checking occurs before the system saves the attachment to the database. Override the standard extension point activity Data-WorkAttach-File.CallVirusCheck to call the checker and modify processing by the flow to handle files reported to contain viruses. The virus check module can be a Java routine or (when Pega 7 Platform is hosted on Microsoft Windows) in a Windows DLL file.

Limits

While the number of attachments you can add to a work item is unlimited, the standard list view rule  Link-Attachment.AttachmentList.ALL displays only up to 100 attachments. You can override this rule if necessary.

Attachments and search results

If the Index Attachments check box is selected in the Search tab of the System landing page (Designer Studio> System > Settings > Search), a search of work items in a composite User portal can include searching the contents of text-file attachments for a specified word or text string. See Understanding full-text search.

Conversion of Microsoft Word document to PDF format

Pega 7 Platform provides two approaches to convert Microsoft Word documents to Portable Document Formats (PDFs). For each approach, the original .doc or .docx file and the converted PDF file become two file attachments, typically of separate categories.

To convert in the foreground, include the standard flow action .Work-.ConvertAttachmenttoPDF as a local flow action in appropriate assignments in the flow. You must select this flow action, complete the form, and wait for workstation conversion.

Attachment category rules

You can support attachments with attachment category rules to control the user's ability to add, view, edit, or delete attachments. For more information, see Attachment category.

Attachment reference properties

You can use the standard page list properties pyAttachments and pyAttachmentCategories to reference all attachments or by category. When a the system or the user adds an attachment, the system automatically populates both properties and associates them with the case.