WaitResult Reference

An object of type WaitResult is returned by the main WaitForTasks method to describe the task that completed, if any.  The properties of a WaitResult object are read-only, and are described below.

Typically only the HasCompletion property is used.  The queryTaskRunInfo method of the main object is usually used in preference to the other WaitResult properties, since it provides more information.

boolean bHasCompletion = WResult.isCompleted();
Returns 

true if this object describes a task that has completed, else false if waitForTasks timed out or otherwise failed to find a task completion.

The remaining properties of  WaitResult are valid only if isCompleted is true.

String TaskID = WResult.getTaskID();
Returns  the ID of the task that has just completed.
String TaskName = WResult.getTaskName();
Returns  the name of the task that has just completed.
int TaskErrorCode = WResult.getTaskErrorCode();
Returns  the task error code of the completed task.  0 means no error; -1 means the WaitResult object was empty.
String TaskErrorDescription = WResult.getTaskErrorDescription();
Returns  the task error description of the completed task.  This will be "" if there was no error.
String TaskNominalStartTime = WResult.getTaskNominalStartTime();
Returns  the nominal date and time the task started, in the format YYYY-MM-DD HH:MM:SS.  If the task was started by the scheduler, the actual start time will probably be shortly after this time, due to the fact that the scheduler evaluates tasks only once per minute. 
String TaskTimeEnded = WResult.getTaskTimeEnded();
Returns  the date and time the task ended, in the format YYYY-MM-DD HH:MM:SS.