GetJobStatus

This function returns the status for a specified process.

Syntax

GetJobStatus(JobID);

Argument

Description

JobID

The job ID of a process for which you want to return status.

Example

ID1 = RunProcess(`async_process_1`);
#*** Do something else in the main TI

#*** Check async_process_1 execution status
Ret = GetJobStatus(ID1);

If(Ret = ProcessExecutionInProgress());
   WaitForAllJobs(ID1);
EndIf;

Ret = GetJobStatus(ID1);

If(Ret = ProcessExitNormal());
   #*** async_process_1 finished execution and completed successfully, proceed with its results.
EndIf;

If(Ret = ProcessExitSeriousError());
   #*** async_process_1 finished execution but failed with error, perform error handling.
EndIf;

In this example, after launching async_process_1, the ID1 can be used to check its execution status of the process. The return value of the GetJobStatus can be compared with process return codes, such as ProcessExitNormal and ProcessExitSeriousError that return the value of ExecuteProcess.