I have 2 jobs setup in TAC, one runs at night and one runs at daytime. When 1st job runs, it should pass a value 'A' and 2nd job runs, it should pass a value 'I'. Context variable is called PassRunValue.
Inside both of these two jobs, I've defined the context variable PassRunValue = "A" for job1
and PassRunValue = "I" for job2.
How can we pass the value from TAC to the a job?
my job has
Currently tjava contains: context.PassRunValue = "";
I don't know how to make that work, if I'm understanding your setup correctly.
I have a job that has to run at midnight before some other jobs that run every hour. I have a tJava component that sets the context variable "isMidnight", and I use "run if" links from it to choose a different set of subjobs to run based on the time.
Can you show the setup with the screen shot. I'm trying to see how you are setting context variable "isMidnight".
Here's the if logic
The "InitializeContext" tJava component contains:
ZonedDateTime thisHour = ZonedDateTime.now(ZoneId.of("US/Pacific")).truncatedTo(ChronoUnit.HOURS); context.isMidnight = thisHour.getHour() == 0;
The "Run if" conditions are then just simply "context.isMidnight" and "!context.isMidnight". This is the Stackoverflow post with the general approach:
I'm trying to understand, when I pass the value for PassRunValue variable from TAC, does it overwrite the value set in tjava?
1. Passing PassRunValue = "A" from TAC
2. Job has tjava component, which has value of context.PassRunValue = "";
3. Would tjava component set the context variable context.PassRunValue = "A" ?
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Pick up some tips and tricks with Context Variables
Learn how media organizations have achieved success with Data Integration
Test drive Talend's enterprise products.