Skip to main content
Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Jacco_De_Zwart
Creator
Creator

Retrieve job property in Job

Hi all,

Is there a way to retrieve the job-status value in a job ?

0695b00000nSdaKAAS.png

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

Labels (3)
7 Replies
Anonymous
Not applicable

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.

0695b00000nSdnYAAS.png 

Regards

Shong

Jacco_De_Zwart
Creator
Creator
Author

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

Anonymous
Not applicable

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?

 

 

Jacco_De_Zwart
Creator
Creator
Author

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.

 

 

Anonymous
Not applicable

@Jacco de Zwart​ I see, but there is no a global variable for job status available for now.

Jacco_De_Zwart
Creator
Creator
Author

Where can I post a suggestion to make these properties as a global variable ?

Anonymous
Not applicable

You can open a feature request on Talend Bugtracker.