TALEND sets the context variable based on TalendDate

I want to set a context variable depending on the TalendDate subroutine on the Value As Table tab, which will allow me to select the day yesterday: TalendDate.formatDate ("yyyy-MM-dd", TalendDate.addDate (TalendDate.getCurrentDate (), - 1, "dd"))

This does not work, I have no returns when I include in the selection as a date ('"+ context.date +"').

Could you tell me what I am missing? I would be very grateful if you could help me with this.

+4
source share
2 answers

You must create a global variable, and then in tJava, assign a value to it.

Or according to your current situation in tJava paste the following:

context.date = TalendDate.formatDate ("yyyy-MM-dd", TalendDate.addDate (TalendDate.getCurrentDate (), - 1, "dd"));

Then you can use your variable. It will not be a java date type, but a string.

+1
source

You can use the tContextLoad component to create pairs of key context values ​​that will be used in your tasks or child tasks.

tFixedFlowInput, , ( , ), tContextLoad :

Defining context variables at run time

tFixedFlowInput:

tFixedFlowInput configuration

tContextDump tLogRow, :

Output of tContextDump

+4

Source: https://habr.com/ru/post/1535894/


All Articles