We need to prevent HRefresh from doing a full data view refresh

Document ID : KB000012619
Last Modified Date : 14/02/2018
Show Technical Document Details

The HRefresh command is designed to execute in 3 different modes - "Full data view refresh", "Package content refresh", and "Item only refresh" modes.  The mode is determined by which item(s) are selected when the HRefresh UDP is called in Workbench.  If you select a State name, right click and select the HRefresh UDP to execute, HRefresh will perform a "Full data view refresh".  If you select one or more packages, right click and select the HRefresh UDP to execute, a "Package content only refresh" will be performed.  If you select a specific file or files, right click and select the HRefresh UDP to execute, only those files will be refreshed.  But what if you only want HRefresh to execute in one of these modes and not in the others?


Is there a way to ensure that HRefresh will only execute in the "Package content refresh" mode, and not in the "Full data view refresh" mode?


Yes, there is a way to do this. My testing was on a Windows server, but you can take this idea and adapt it for your server’s OS and your own preferences about any message returned by the script. Here’s what I did:

1. Created a Windows batch script named “pkgcheck.bat”. This script checks to see if any parameters were passed to it, and if so the script ends successfully, if not the script ends with an error code. Like this:

echo off
echo package=%1
if .%1==. exit /b 1
echo success!

2. I opened the properties of the HRefresh udp within my project and created a pre-link UDP with the following program line:

C:\Scripts\pkgcheck.bat [“package”]

If the pre-link UDP ends with an error code the HRefresh process fails and no files are checked out.

Additional Information:

I tried setting up the same script as a Pre-Cmd inside the HRefresh.cfg file and found that

1. It executes as an hexecp command, so this script would have to be propogated to all your release servers

2. An error code doesn’t prevent the hrefresh from happening.