1
votes

How can I set the dynamic file path or folder directory for kettle jobs?

Please check the attached screenshot.

Goal: Read the path from a config file as a variable[so that we can change the path dynamically as per the other parameters.]

Details: Say, we want to use the /web/test directory for test environment and we want to fetch file repository from the normal path when the parameter is not test! I assume, there must be a way to keep a config/ini file from where we can read the path and use the variable inside the "File/Directory" section of pentaho.

I am gone through variable reference option but which is mainly for database configurations parameter ,some people suggested which is not good option instead of you can specified the database configuration in xml. Please suggest any idea or solution.

enter image description here

1

1 Answers

3
votes

Sounds like you want to set a parameter/variable in the .kettle file and reference it in the File or directory text box. Note the red dollar sign next to the box. That means this field accepts variables. Here's the wiki entry for variables:

PDI Variables

You can also read from a config file directly (from a transform) and set it dynamically with the Set variables step if you can only have one .kettle file. Also check out the Check if connected to repository (from the Repository branch) step as well and see if that will suit your needs.

If none of these suite your needs, please add detail to your question to describe exactly what you're trying to do and how you're trying to do it.