Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a global variable to use to return the job execution status" Success or Failure? I do not want to use tstatcatcher.
Usually you would expect this to be looked for after running a child job. To get the value from the tRunJob, you'd use the following....
((Integer)globalMap.get("tRunJob_1_CHILD_RETURN_CODE"))
....in the job calling the tRunJob.
During the running of the job, I believe the globalMap value you will want to look at is .....
((Integer)globalMap.get("talendJobLog_SUBPROCESS_STATE"))
.....but this will depend on timing. I've not tried this, so I would be interested to see how this works out. I'd recommend carrying out a test using a tPostJob and a tJava to test this.
it returns null
OK, I have just double checked what I did and my answer came from the fact that I was looking at the source code of a job with a tDie in it. I've just looked at an empty job and the code suggests that the status is set at the very end of the job. Getting it within the the running time of the job will require the use of tDie components or the stat catcher.
Can you let me know what your use case is and maybe also share some screenshots? It is very simple to get status of a job while it is running, but you may need to rework the job a little to allow this.
I have a pre job, logic to load date into target and post job. in the prejob i initiate my start time and end time is obviously from post job through tjava component. I just need to know how to do the status of a job using tjava.