• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Passing multiple values in one single context string and tocanize it.

#1 2010-07-09 12:25:24

Mani
Member
Registered: 2009-05-12
Posts: 23

Passing multiple values in one single context string and tocanize it.

Hi,

I have the job design currently check the condition and send a mail with log file attachment.

Log file -----if condition -----  send mail

If condition checks the system hours with the input context value "email_time" and triggers the send mail option if true.

Talend.getdate("HH").equals(context.email_time)

Now, I like to pass the context value "email_time' with mutiple values ="07,04,12,16,21" and check the if condition for each value say 07,04,12,16,21 seperately before pass the trigger to send mail.

Please let me know your pointers.


Thanks and Regards,
Mani.

Offline

#2 2010-07-09 16:28:40

dangig
Member
Company: ERP Guru
Registered: 2010-03-05
Posts: 32
Website

Re: Passing multiple values in one single context string and tocanize it.

Hi,

If you know the Apache commons-lang library ( http://commons.apache.org/lang/ ), it contains ArrayUtils class that could help for what you are trying to do. The condition would become:

Code:

ArrayUtils.contains(context.email_time.split(","), TalendDate.getDate("HH"))

Daniel


Daniel Giguere
ERP Guru
  T 1.877.664.1023 ext.114
  E daniel.giguere@erpguru.com

Offline

#3 2010-07-10 08:51:49

alevy
Member
Registered: 2009-11-20
Posts: 1478

Re: Passing multiple values in one single context string and tocanize it.

A simpler way is just context.email_time.contains(Talend.getdate("HH")).

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Passing multiple values in one single context string and tocanize it.

Board footer

Powered by FluxBB