IGWv4Job
Interface for controlling and monitoring the progress of asynchronous Jobs/Tasks.
e.g. Javascript:
var gda = new ActiveXObject("GWv4.Application");
if (gda) {
var fileopt = gda.CreateFileOptions();
var job = gda.ImportLog(
"C:\\Folder\\text_data.csv",
"C:\\Folder\\text_data_import.stf",
"C:\\Folder\\import_template.gdasvtemp",
fileopt
);
while (!job.Completed) {
var prog = (job.Progress * 100) + "%";
WScript.StdOut.WriteLine(prog);
WScript.Sleep(500);
}
WScript.StdOut.WriteLine("Completed.");
if (job.Error && job.Error.length) {
WScript.StdOut.WriteLine("Error: " + job.Error);
}
}Contents
Properties
| Property | Description |
|---|---|
| Progress | Gets the progress of the Job as a value between 0.0 and 1.0 inclusive. |
| Completed | Indicates if the Job has completed. |
| Failed | Indicates if the Job failed. |
| Error | Gets the error status of the Job. |
| AllMessages | Gets a newline-separated string containing all messages generated by the Job. |
Public Methods
| Function | Description |
|---|---|
| Cancel | Cancels the Job. |
| Wait | Wait for the Job to complete. |
Properties
Progress
Gets the progress of the Job as a value between 0.0 and 1.0 inclusive.
double ProgressCompleted
Indicates if the Job has completed.
BOOL CompletedCheck the Error property to determine if there was a failure.
Failed
Indicates if the Job failed.
BOOL FailedSee Also: Error
Error
Gets the error status of the Job.
BSTR ErrorThis string will be empty of the Job completed without errors.
See Also: Failed
AllMessages
Gets a newline-separated string containing all messages generated by the Job.
BSTR AllMessagesPublic Methods
Method: Cancel
Cancels the Job.
HRESULT Cancel(void)Method: Wait
Wait for the Job to complete.
HRESULT Wait(void)This will block until the job is completed. Note that this will run the main application event loop from within the wait subroutine - so if the user interface is displayed then the user may still be able to interact with the application.