One Star

[resolved] tFileInputProperties - problem exporting job

Hi all!
I would like to use a properties file that I can move around when I export my job (I don't want the desitnation to the properties file hardcoded in my component configuration).
In Basic settings for component tFileInputProperties I have to write a destination to my properties file but I want to keep my properties file editable and in the same directory with the bat file (when exporting job script). Is this possible?

Thanks in advance!
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] tFileInputProperties - problem exporting job

It means you need to pass the location and name of the properties file as a dinamic value/string.
One option for this is passing the properties file name as a command line arguement.
for implementing this
1)you need to define a contect variable which can keep the properties file name passed as command line arguement.
2) select prompt option check box.
3) modify the generated batch file after you export job script. The modification you need to do is like the following. you need to add the --context_param in the batch file command and provide the value.
--context_param COMMAND_LINE_CONFIG_FILE_NAME=D:\UKConfigSamplepProject.properties --context=Default

Hope it helps,
Thanks and Regards,
Pravu Mishra.
5 REPLIES
One Star

Re: [resolved] tFileInputProperties - problem exporting job

1) use tFileInputProperties component
2) define context variables for all the property values mentioned in the properties file
3) connect it to a tJavaRow component
4) compare the key names(property names) with the names mentioned in the properties file in the tJavaRow.
5) assign the values of keys to the context variables.
Now all your values mentioned in the properties file are set to context variables and you can use the context variavles at the place/or for another component.
Thanks and Regards,
pravu Mishra.
One Star

Re: [resolved] tFileInputProperties - problem exporting job

1) use tFileInputProperties component
2) define context variables for all the property values mentioned in the properties file
3) connect it to a tJavaRow component
4) compare the key names(property names) with the names mentioned in the properties file in the tJavaRow.
5) assign the values of keys to the context variables.
Now all your values mentioned in the properties file are set to context variables and you can use the context variavles at the place/or for another component.
Thanks and Regards,
pravu Mishra.

Thanks pravu, I have done all that but my question still remains. In Basic settings of tFileInputProperties component I want to set the attribute File name instead of explicitly for example "C:/TOS-Win32-r28760-V3.2.0M3/workspace/directory/in.properties" to something like %place_where_my_bat_file_is + "/in.properties".
If I leave it explicitly my properties file is then hardcoded and I don't want that...
Hope I was more clear on my problem this time Smiley Happy
Thanks!
One Star

Re: [resolved] tFileInputProperties - problem exporting job

It means you need to pass the location and name of the properties file as a dinamic value/string.
One option for this is passing the properties file name as a command line arguement.
for implementing this
1)you need to define a contect variable which can keep the properties file name passed as command line arguement.
2) select prompt option check box.
3) modify the generated batch file after you export job script. The modification you need to do is like the following. you need to add the --context_param in the batch file command and provide the value.
--context_param COMMAND_LINE_CONFIG_FILE_NAME=D:\UKConfigSamplepProject.properties --context=Default

Hope it helps,
Thanks and Regards,
Pravu Mishra.
One Star

Re: [resolved] tFileInputProperties - problem exporting job

Please refer to the job kept by me at the following URL
http://www.talendforge.org/exchange/tos/extension_view.php?eid=156
Thanks and Regards,
Pravu Mishra.
One Star

Re: [resolved] tFileInputProperties - problem exporting job

It means you need to pass the location and name of the properties file as a dinamic value/string.
One option for this is passing the properties file name as a command line arguement.
for implementing this
1)you need to define a contect variable which can keep the properties file name passed as command line arguement.
2) select prompt option check box.
3) modify the generated batch file after you export job script. The modification you need to do is like the following. you need to add the --context_param in the batch file command and provide the value.
--context_param COMMAND_LINE_CONFIG_FILE_NAME=D:\UKConfigSamplepProject.properties --context=Default

Hope it helps,
Thanks and Regards,
Pravu Mishra.

Thanks Pravu, this works! Smiley Happy

Cheers!