I came across a scenario where the required parameters must be sent to python script in talend and the python script is being called by using tsystem component.
What my analysis is -> to store the parameters/user-input in a context and call the context variables in tsystem component.....
Can you pls let me know if this is approach is correct...
This seems like an entirely reasonable approach. Just keep in mind that when using the tSystem component, you are essentially sending a Java String to the terminal. So when building your command with parameters, think about building a Java String that represents that command. For example....
If you are wanting to search a directory for txt files in one run and jpeg files in another, you could parameterise your extension name in a context variable called "fileExtension", then use it in a tSystem like below...
"cmd /c dir *." + context.fileExtension
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema
Pick up some tips and tricks with Context Variables