Support Article
Activity with sendFile() initiated twice for refresh section
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
- Configure a button with onClick action with a Refresh section and run activity.
- Configure the sendFile() in the Java step of an activity.
- 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:
- Skip the original activity which executes the external service by adding a wrapper activity.
- Configure this wrapper activity as a pre-activity for the reload section.
Perform the below steps in the wrapper activity,
- Check the flag for Execute Original Activity. If the flag is True, call the original activity.
- Write a Java step to have a dummy sendfile() statement.
- Set the property on the step page which allows the original activity to be called.
- Configure an Exit activity.
- 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.
Published March 27, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.