Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
There is table with changeable values: two dates. And I need to create job which would run only if today is between that two dates from table.
Is it possible to do? And how? Could you please help.
@Maryna Lykhoshva , You need to read dates from table, and then check if today is between the two dates on a tJavaRow, trigger the next processing using RunIf based on the checking result. The job looks like:
tMysqlInput--main--tJavaRow---runIf---next processing
on tJavaRow:
if(TalendDate.compareDate(TalendDate.getCurrentDate(), input_row.dateColumn1)==1&&TalendDate.compareDate(TalendDate.getCurrentDate(), input_row.dateColumn2)==-1){
context.condition=true;
}else{
context.condition=false;
}
//context.condition is context variable, boolean type, set its default value as false.
set the condition of runIf as: context.condition
Hope it helps you!
Regards
Shong
You could use a 'Run If' connection based on comparing 2 dates (TalendDate)
Run Iff: Current Date < date1 and Current Date > date2
yeah, but dates are often changed, so maybe Run If can check dates from table?
@Maryna Lykhoshva , You need to read dates from table, and then check if today is between the two dates on a tJavaRow, trigger the next processing using RunIf based on the checking result. The job looks like:
tMysqlInput--main--tJavaRow---runIf---next processing
on tJavaRow:
if(TalendDate.compareDate(TalendDate.getCurrentDate(), input_row.dateColumn1)==1&&TalendDate.compareDate(TalendDate.getCurrentDate(), input_row.dateColumn2)==-1){
context.condition=true;
}else{
context.condition=false;
}
//context.condition is context variable, boolean type, set its default value as false.
set the condition of runIf as: context.condition
Hope it helps you!
Regards
Shong
Thank you!
I'll try.