Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[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!
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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.

View solution in original post

5 Replies
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

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 0683p000009MACn.png
Thanks!
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

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! 0683p000009MACn.png

Cheers!