Four Stars

Modify context variable permanently

Hi,

 

Is it possible to modify a context variable within a job, so I can use the newest value of the context variable the next time I run the job?

 

I would like to use this feature to store the last time the job has run btw.

 

Thanks.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Thirteen Stars TRF
Thirteen Stars

Re: Modify context variable permanently

Use tContextDump to overwrite the context file with the current values for all the context variables.


TRF
Thirteen Stars TRF
Thirteen Stars

Re: Modify context variable permanently

This view is usefull only when running jobs from the Studio.

As soon as you'll run the jobs from the command line or a scheduler, you'll have to manage 1 or more context files which can be overwritten at runtime bt the jobs.

During the development cycle, it's a good practice to use a context file to avoid any surprrise after job deployment.

Have a look to the documentation or search for "implicit context" or something like that.


TRF
5 REPLIES
Thirteen Stars TRF
Thirteen Stars

Re: Modify context variable permanently

Use tContextDump to overwrite the context file with the current values for all the context variables.


TRF
Four Stars

Re: Modify context variable permanently

A context file? I'am new to Talend so I don't really know what a context file is, I'am just using the view under my job for setting the context variables and I preferer to keep it this way so I don't have to create other seperate files on my computer.
Thirteen Stars TRF
Thirteen Stars

Re: Modify context variable permanently

This view is usefull only when running jobs from the Studio.

As soon as you'll run the jobs from the command line or a scheduler, you'll have to manage 1 or more context files which can be overwritten at runtime bt the jobs.

During the development cycle, it's a good practice to use a context file to avoid any surprrise after job deployment.

Have a look to the documentation or search for "implicit context" or something like that.


TRF
Four Stars

Re: Modify context variable permanently

I tried to override the context variable with a tJava but when i use a tContextDump it stills printing the old value in the file. How I can overcome this?
Thirteen Stars TRF
Thirteen Stars

Re: Modify context variable permanently

Share your job design and tJava piece of code


TRF