I have a .js file which I want to access on KNIME Server in a Java Snippet, how can I access the file, where could I store it and how would the path look like?
Thanks
I have a .js file which I want to access on KNIME Server in a Java Snippet, how can I access the file, where could I store it and how would the path look like?
Thanks
Hi,
I would suggest you put a folder inside your workflow that you call “files” and then use the List Files node to list files in knime://knime.workflow/files. You will get a table with one row that is the actual path to your js file. Turn that into a flow variable using Table Row to Variable and pass that to your Java Snippet node. There you can then read the file.
Kind regards
Alexander
Gonna try this as soon as KNIME Core is installed on our server. Thank you!
Hey Ivan,
I tried this, and it works on the local machine, however on the server it doesnt work. When I open the Workflow as a new job on the server, the variable in the Java Snippet is gone.
Hi there @tbtt,
what do you mean it doesn’t work on Server? You deployed workflow on Server, ran it and got error or?
Br,
Ivan
Hi Ivan,
let me clarify:
I deployed it on the server, rightclick->open as new job on server and try to run it. But the Java code isn’t working (I guess because the variable can’t be resolved), if I open the Java Snippet Node,
the variable is not appearing in the list.Hi @ipazin and @tbtt,
A developer told me that this feature is deprecated and should not be used anymore. Can you try to use my idea of using the List Files node?
Kind regards,
Alexander
Hey Alexanders,
finally was able to test your solution, worked out perfectly, thanks!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.