getJobReturn(jobId, [blocking=false])


jobId is a string indicating the batch job ID.

blocking (optional) is a Boolean value indicating whether the blocking mode is enabled. If blocking is false (default), the function will return an exception if the job is not completed. If blocking is true, the function will not return a value until the job is completed.


Retrieve the batch job result. For details about batch jobs please refer to Batch Job Management.


def job1(n){
   s = 0
   for (x in 1 : n) {
       s += sum(sin rand(1.0, 100000000)-0.5)
       print("iteration " + x + " " + s)
   return s

job1_ID=submitJob("job1_ID","", job1, 100);
// output
The job [job1_ID20210428] is not complete yet.

Rerun the getJobReturn command after the job is completed:

// output

If we would like getJobReturn to hold off returning results until the job is completed, we can set the optional parameter blocking to true. This feature is useful in handling batch job dependencies.

job1_ID = submitJob("job1_ID","", job1, 100)
getJobReturn(job1_ID, true);
// output