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

Activity with sendFile() initiated twice for refresh section

SA-47960

Summary



Activity with the sendFile() initiates twice for an on click event and refresh section with activity call.


Error Messages



Not Applicable


Steps to Reproduce

  1. Configure a button with onClick action with a Refresh section and run activity.
  2. Configure the sendFile() in the Java step of an activity.
  3. Click the button. The activity is run twice.


Root Cause



File download (send file) supports the reload harness as the reload section only retrieves a portion of the harness. Using the pre-activity with the reload section, only the file content is sent as a response. In this case, the reload harness must be initiated internally with the given pre-activity. Since the reload harness action is not available in PRPC 6.2. SP2, it is recommended to skip the activity execution for the first time.

Resolution

Perform the following local-change:

  1. Skip the original activity which executes the external service by adding a wrapper activity.
  2. Configure this wrapper activity as a pre-activity for the reload section.

Perform the below steps in the wrapper activity,

  1. Check the flag for Execute Original Activity. If the flag is True, call the original activity.
  2. Write a Java step to have a dummy sendfile() statement.
  3. Set the property on the step page which allows the original activity to be called.
  4. Configure an Exit activity.
  5. Call the original Activity.

On the first execution of the wrapper activity, the original activity is not called and the flag is set on the step page. The reload harness recalls the original activity. The original activity is called by checking and resetting the flag on the activity.


Suggest Edit

Published March 27, 2018 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

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