Previous Topic: RemoteTarget.getHostName MethodNext Topic: RemoteTarget.onError Method


RemoteTarget.hasCompleted Method

This method checks the execution state of a remote script evaluation. Execution is considered complete if the abort() call ends execution, if an error occurs during processing, or if the script is successfully run on the target node. Find out if execution completes successfully or an error occurs using the errorOccurred() and getError() methods.

This method has the following syntax:

hasCompleted()

The method returns the following values:

true

Execution complete.

false

Execution is not complete.

Example

Manually implement a wait for completion.

aRT = run-remote "! ver" on "ascli1"
while(!aRT[0].hasCompleted())
{
    sleep(500);
}
if(aRT[0].errorOccurred())
{
    ? "Error"
}
else
{
    ? "Result:", get-remoteResult(aRT[0])
}

Usually scripts only use the -wait option of the run-remote command.

See also:

RemoteTarget.abort Method

RemoteTarget.errorOccurred Method

RemoteTarget.getError Method

run-remote Command--Execute a Script on Remote Systems (Funclet)