One Star

Issue with passing variable with context

I am trying to set a date stamp - 20091208 to use in may jobs to call my daily files.
I have set a context with the value equal to:
TalendDate.formatDate("yyyy",TalendDate.getCurrentDate()) + TalendDate.formatDate("MM",TalendDate.getCurrentDate())+TalendDate.formatDate("dd",TalendDate.getCurrentDate())
I call my variable using the context call: today_YYYYMMDD
Unfortunately when I run my job, the variable is returing the actual value (formula) TalendDate.formatDate("yyyy",TalendDate.getCurrentDate()) + TalendDate.formatDate("MM",TalendDate.getCurrentDate())+TalendDate.formatDate("dd",TalendDate.getCurrentDate())
and not the anticipated 20091208
Your help is appreciated
One Star

Re: Issue with passing variable with context

Context variable are Strings. So they are not interpreted as java expression and are not evaluated.
Not applicable

Re: Issue with passing variable with context

We ran into the same issue. Use an input sql, inputFile, or tFixedFlowInput to write to a tContextLoad component which then triggers the first subjob. This will enable the java expression to be interpreted and populate your context variable each time it runs.