I would like to know how to programmatically find the string value of %inFile%. I looked at the source code, but it's not clear to me.
Thanks,
Jin
I would like to know how to programmatically find the string value of %inFile%. I looked at the source code, but it's not clear to me.
Thanks,
Jin
Hi Jin,
I am not 100 percent sure, but if I remember correctly, then you are not supposed to find this string value. You just generate a command line that contains this placeholder and the node framework replaces it with some actual path and file name before it executes the command.
The idea here is that different executors (e.g. local vs. cluster vs. cloud) might want to place the file in different places and the command line should not depend on this.
Hope this helps,
Nils
Yes. For the ext tool node, you don't need to. But what I want to do is to create a custom node that executes an external program. I need to have the location in a variable, so I can create the command string. I think each node crates a temporary directory in AppData\Temp, and the input file (port0.csv) is created in input directory. I just need to know how to get the file name and its path.
Thanks,
Jin
I believe that you could still use the exact same replacement mechanism if you derive your custom node from the ext tool node. You just generate the command line (including placeholders) and let the framework do the rest (i.e., you don't implement your own execute-function, but just overwrite the function that generates the command line).
If you actually need access to the file name because you somehow want to modify it for your command line call, I would suggest to wrap your external tool with a shell script etc. that does this.
Hope this helps,
Nils
Hi Jin,
Probably Luis' Generic KNIME Nodes project can be also an option, it allows you to create KNIME nodes based on an XML configuration, those nodes will execute custom external commands. (Motivation from slide 16.)
Cheers, gabor