Run a job on a date condition

One Star

Run a job on a date condition

Hello,
I need to run a job only when the current date is in month january.
I have seen that there is the tWaitForSQLData component but it only works on a reached nb of rows.
Could you give me some suggestions please.
Thanks
One Star

Re: Run a job on a date condition

You can maybe use the trigger Runif to the tRunJob component.
One Star

Re: Run a job on a date condition

Hello,
Set a variable with tSetGlobalVar :
key : "the_date"
value : TalendDate.getDate("MM")
Plug a trigger "run if" from the tSetGlobalVar to your job with this condition :
("06").equals(((String)globalMap.get("The_date")))
In this example the job will run if the current date is in month june.
JC
One Star

Re: Run a job on a date condition

Thanks very much.
The solution of jcoutin works very good.
One Star

Re: Run a job on a date condition

Really working ..thanks
One Star

Re: Run a job on a date condition

Smiley Happy
Happy to be helpful.
Five Stars

Re: Run a job on a date condition


@jcoutin wrote:
Hello,
Set a variable with tSetGlobalVar :
key : "the_date"
value : TalendDate.getDate("MM")
Plug a trigger "run if" from the tSetGlobalVar to your job with this condition :
("06").equals(((String)globalMap.get("The_date")))
In this example the job will run if the current date is in month june.
JC

Thanks for the solution, I also need when the month is different. Instead of month equals to June I need month different from June. Can you help me?

Employee

Re: Run a job on a date condition

@haralba 

 

Please add a not condition as a wrapper function.

 

Relational.NOT(true)

eg:- Relational.NOT(<your existing condtion>)

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog