Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

File attachment properties not available in CallVirusCheck

SA-31535

Summary



Pega 7 provides an Out-of-the-box (OOTB) extension activity Data-WorkAttach-File.CallVirusCheck for developers to save into their application rulesets.

This is called in many places where a file is being uploaded. The intent is that developers can customize this activity with virus checking functionality to check the content of uploaded files.

However user found a number of use cases where this activity is called too early, before metadata about the file, for example, file name and file content are available on the clipboard.


Note: CallVirusCheck is unpredictable as the required properties are not on the clipboard.


Error Messages

Not Applicable


Steps to Reproduce



Use case 1: Case Manager 7 portal - Profile Picture Upload
  1. Log into Pega 7 as a Developer.
  2. Launch Case Manager portal.
  3. Open your profile from the menu at top right and click the profile picture to add/replace it.
  4. Click the Browse button.
  5. Navigate to any graphic file to upload.
  6. Before you click the Open button, open the Tracer.
  7. Click the Open button in the file chooser dialog.

In the Tracer look for the last step of the call to CallVirusCheck and click on the primary page (UploadedFilePage) to open it.

The properties pxAttachName and pyAttachStream are not present.

Now, about 16 lines later in the Tracer, click the same page (UploadedFilePage) to open it.

These two properties are now present.

Examine more closely the activity @baseclass.pzFileUploadGadget (ruleset Pega-Social:07-10-09) and observe that the UploadedFilePage is created and then passed immediately to CallVirusCheck.

There are a few properties on the page due to the pyDefault models used to initialize it but no information about the file.
The pxAttachName and pyAttachStream are not set until the Java step which occurs later in the activity. Hence CallVirusCheck can do nothing.

Use case 2: Case Manager 7 portal - Pulse File Upload

This is available on the Dashboard and Profile pages.

The same defect occurs again in the Pega Pulse widget when uploading a file.

The tracer shows the call to CallVirusCheck called from the same activity as use case 1.

Use case 3: PegaMarketing portal - Profile Picture upload

Same defect.

Use case 4: PegaMarketing portal - Pulse File Upload

Result: Same defect.

Root Cause



File related information like file name, file type, file content, and so on, is not available in primary page for CallVirusCheck activity, when called from pzFileUploadGadget activity.

In @baseclass.pzFileUploadGadget activity, Pega has moved CallVirusCheck and subsequent Property-Set-Messages steps to the end.

That way, existing java step populates file information on UploadedFilePage and makes it available for CallVirusCheck activity.



Resolution



Apply HFix-31031.

Published July 18, 2017 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us