CancelJobs
Use this function to cancel asynchronous processes that were launched by the RunProcess function and are blocked due to certain conditions. Any pending changes in a job canceled with CancelJobs are rolled back.
Blocking conditions include:
- lock acquisition on a object used by the process
- waiting for another process to finish
- execution of the Sleep function within the process
Syntax
CancelJobs(JobID1,JobID2...);
Argument |
Description |
---|---|
JobID1, JobID2... |
The job ID of a process that you want to cancel. |
Example
ID1 = RunProcess(`async_process_1`);
# Do something else
ret = GetJobStatus(ID1);
If(ret = ProcessExecutionInProgress())
CancelJobs(ID1);
EndIf
In this example, if async_process_1
is still executing but blocked due to one of
the reasons mentioned previously, the execution of async_process_1
is terminated
and any of its pending changes are rolled back.