Is there a way to create a parameter that is available in a jobflow and any subgraphs or jobflows without having to pass it as a parameter to subgraphs every time.
For Example, let’s say I want to create a paramter called ‘PI’ whose value is 3.14, but I don’t want to pass it as parameter every time to my subgraphs. Is it possible for me to create it once and use it from any graphs and subgraphs in the project?
Hi,
There are a couple of options that you can use to store some general value, but I am afraid, that you have to link your current graph to the “global” parameter or value anyway.
Best practice is to use an External (Shared) Parameter file. Please follow the instructions in the documentation (link “External (Shared) Parameter file”) and create a new parameter file. The file is then immediately available in your current graph but it is also stored outside the graph within the project. All you need to do in order to use the same parameter file in another graph/subgraph is to drag and drop the file from the Navigation pane (Project root directory) to the Outline pane of the new graph (you can also use function “Link parameter file”, as the documentation says, but I believe the “drag and drop” is easier).
In addition, please let me mention also so-called Database Lookup Table. You can have your parameters and its values in a DB table (e.g. Cities and its zipcodes) and access the values using Lookup. Yet, in order to reference the predefined lookup in more graphs, you still need to use external lookup and link it to each graph again.
Thank you for understanding. Best Regards,
Eva
Hi Eva, I’m trying to accomplish the same thing as sshrestha, but I’m having trouble following what you’re suggesting. Is there anywhere a step by step guide on how to do this by any chance?
Thank you Eva,
I had a MASTER_AUTH_KEY that I wanted available in any graph that wanted to use it. I put the key value pair in workspace.prm file since that file seems to be available in every graph with the same parameter values.
However, your suggestions for db lookup seems to be more favorable for my case as I did not want to store the Auth key in the project. This way whenever the auth key changes i don’t have to update the project. Also, I could have as many parameters as I want without polluting the workspace.prm file.
Sincerely,
Shubha
Hi guys,
I can confirm that it is safe to use also the workspace.prm file and you are right, in such a case, you don’t need to link it to the graph/subgraph each time as the workspace.prm file is already linked to each job.
Additional note: You have to add your parameter to the workspace.prm file in the root directory if you want it to be “global”. I mean, the main workspace.prm file is in the Navigator pane at the bottom of the project’s directories and files list. You can double-iclick the file there and edit as usual. This way the parameter will be shared among all graphs. On the contrary, if you add the parameter within a single graph by double-clicking the workspace.prm file in graph’s Outline pane, you will see it in that single graph only.
PercyJin, if you decide to keep your parameters in a separate file (as I suggested originally), please follow the instructions on the following page:
http://doc.cloveretl.com/documentation/UserGuide/index.jsp?topic=/com.cloveretl.gui.docs/docs/index.html
On the above-mentioned page, there is also described how to “Link” the PRM file to each graph. You can skip this point by drag and drop the file from Navigator pane to the Outline of the graph in question. If you have any difficulties with the process, please let me know what exactly do you struggle with and I’ll help you through.
Thank you both and have a nice day,
Eva