Navigation:  Actions > Miscellaneous >

Wait Action

Previous pageReturn to chapter overviewNext page

The Wait action creates a step to pause the build until a given amount of time has elapsed, the given time or date/time is reached, until one or more files are created or modified, or until one or more processes exit or complete.  This can be useful for recurring builds and parallel builds.


For instance, to build once every day, the entire build could be placed in a loop (by using the Repeat conditional build rule property) and the first step set to a Wait action that waits Until a given date/time of 14:30 is reached.  To pause for 5 seconds, select A given amount of time and enter 00:00:05.


Or a build could be kicked off remotely by setting the action to wait for a file to be created or modified, and then creating or updating the file from a remote machine.


Another use for this step is for parallel builds.  When multiple parts of a build which don't depend on each other need to be run simultaneously, the master build project can launch each parallel part of the build from a VisBuildPro Project step marked to not wait for completion.  If the rest of the build is dependent on the completion of the parallel builds, the build could be set up as demonstrated in the Chain.bld sample.


Note: The Sleep method can be used to pause from script code.


Wait until: Specifies what to wait for.


Time / Date+time / Filename(s) / Process ID(s): The amount of time to wait, the time or date+time to wait for, one or more filenames to wait to be created or modified, or one or more process IDs to wait for.  Elapsed time should be entered in the form HH:MM:SS (hours, minutes, seconds), MM:SS (minutes, seconds) or SS (seconds); a given time should be entered in military format in the form HH:MM, date+time should be entered in the form MM/DD/YYYY HH:MM, and a process ID should be entered in decimal (base 10) format.


Delete files before waiting: If checked, any existing files to be wait on will be deleted before waiting (applies only to file option).


Wait for all files to be created or modified or all processes to exit: If checked, the action will wait for all listed files to be created or modified or all processes to exit.  If unchecked, the action will continue on the first created or modified file or completed process.


Don't wait if file already exists: When waiting until a file is created, if this checkbox is checked, the step will stop waiting if the specified file has already been created by the time the step starts (applies only to file option).


Success string or codes: If provided, when waiting for files, the first line of each created or modified file will be searched for the specified string, and if the string is not found, the action will fail.  If waiting for processes to complete, the exit code of the process will be compared with the exit codes in this field to determine success or failure.  By default, a zero (0) exit code is considered successful, and any other code is a failure.  Sometimes, an application will return non-zero exit codes to indicate partial success or additional information, and multiple ranges of success exit codes can be specified in the format low1:hi1, low2:hi2, code3.  For instance, 0:5, 10 would cause the values 0 through 5 and 10 to be considered successful exit codes.