Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Is there a way to retrieve the job-status value in a job ?
Based on the status I would like to change job context variables
So how do I retrieve 'development', 'testing' or 'production' from the job properties.
Thanks in advance.
Jacco
Hi
There is no global variable available for job-status, the status value is stored in jobName_0.01.properties file, eg:
<TalendProperties:Property xmi:id="_63fzoDUMEe2Vl5N2pzuuUw" id="_63NfwDUMEe2Vl5N2pzuuUw" label="test1234" version="0.1" statusCode="DEV" >
The jobName_0.01.properties file is located <studio installation directory>/workspace/project_name_folder/process/.
If you have access to the source file of job, using a tFileInputXML component to read jobName_0.01.properties file and retrieve the status value in a job.
Regards
Shong
Thanks Shong for your reply.
Does this hold up if I move the job from develop to production and deploy it to the TMC ??
Jacco
If the job is deployed to TMC and executed in Remote Engine, the jobName_0.01.properties file should be moved to same machine where Remote Engine is installed, so that the job can access the jobName_0.01.properties file.
the job status is defined before the job execution, it isn't a dynamic value changed at run time. Consider defining the job status in the beginning of job so that it can be easily accessed?
Shong,
When I I'm developing a (new) job, the status will be set to development. When I'm albe to read that status, i can use this to retrieve context variables from the database using tContextLoad component (with a tDBInput and tMap component first).
Just before I deploy the job to the TMC when I'm done developing and test, I change the status to production. Then, again the tContextLoad component will be fed the context variable for production, based on the status of the job using tDBInput and tMap in front of the tContextLoad component.
@Jacco de Zwart I see, but there is no a global variable for job status available for now.
Where can I post a suggestion to make these properties as a global variable ?
You can open a feature request on Talend Bugtracker.