One Star

how to pass content of thashmap to java routien in tjava component

Hi,
I am having the problem with thashmap component.
here i will have one holiday list table which will have list of holidays.I ahve one table which will have start date and end date my requiremnet is to calculate the working days(excluding sun,sat,holidays) between given start date and end date.

Holiday list table
date
-----
2/2/2013
3/2/2013
3/15/2013
my table will have
start date end date
----------- -----------
1/2/2013 2/31/2013
3/1/2013 3/31/2013
my output should be
start date end date holiday count
----------- ----------- ---------
1/2/2013 2/31/2013 1
3/1/2013 3/31/2013 2

for this thing i used one thash map to store the holiday list and created one userdefined routien but not able to pass the content of the thashmap to routien to check whether the date between start date and date is there in the holiday list.Can you please help in this.

Thanks,
Ganga
4 REPLIES
Seven Stars

Re: how to pass content of thashmap to java routien in tjava component

Does this topic help you?
One Star

Re: how to pass content of thashmap to java routien in tjava component

Hi,
want to run multiple files with same file mask.
situations is like this I have file with same name in a folder batch needs to iterate on each file and run as many times as files are present.
Please suggest a way out.
Four Stars

Re: how to pass content of thashmap to java routien in tjava component

tFileList->iterate-->tlogrow
Use file mask as "*".
Whether the metadata is same for all the files?
Pl check following
https://help.talend.com/search/all?query=tFileList&content-lang=en
Vaibhav
One Star

Re: how to pass content of thashmap to java routien in tjava component

I would either use;
tHashMap->tFlowToIterate->tJava, access the info in the tHashMap using the global map and pass it to you routine, ((String)globalMap.get("rowfromhashmap.date_info")).
or
tHashMap->tJavaRow and access it directly using the input_row, input_row.date_info and pass.
Hope this helps.