Returning the status of a task executed in synchronous mode
Procedure
Use the runTask MetaServlet command to run the execution task.
Example
For example (on
Windows):
MetaServletCaller.bat --tac-url=http://localhost:8080/org.talend.administrator/
--json-params={"actionName":"runTask","authPass":"admin","authUser":"admin@company.com",
"mode":"synchronous","taskId":"2502"} --format-output
Example
If the task has been executed successfully, you will get for example:
{
"errorStatus": "NO_ERROR",
"execBasicStatus": "OK",
"execDetailedStatus": "ENDED_OK",
"execDetailedStatusLabel": "Ok",
"execRequestId": "1406816118032_sYHGd",
"executionTime": {
"millis": 6011,
"seconds": 6
},
"jobExitCode": 0,
"returnCode": 0,
"status": "READY_TO_RUN"
}
The task status at the end of the execution is Ready to
run and the execution status Ended
OK as well as the Job exit code 0
indicate that it ended successfully.
Example
If the task has failed, you will get for
example:
{
"errorStatus": "JOB_ERROR",
"execBasicStatus": "ERROR",
"execDetailedStatus": "JOB_ERROR",
"execDetailedStatusLabel": "Job ended with error(s)",
"execRequestId": "1406817091606_fVsht",
"executionTime": {
"millis": 3847,
"seconds": 3
},
"jobExitCode": 1,
"returnCode": 0,
"status": "READY_TO_RUN"
}
The execution status Job error as well as the
Job exit code 1 indicate that an error occurred
during the task execution.