I am trying to create a component. This component job is to:
create a directory / folder called ‘process’ (if it doesn’t exist) in the top level (see below).
create a child directory / folder in process (the name will be randomised)
Pass the child directory / folder path out as a flow variable
Inputs: None. Outputs: flow variable: child path.
My KNIME Explorer window looks a bit like this:
If the component is placed into the Calculate Life Expectancy Workflow I would want it to produce the ‘process’ folder where it says ###HERE### and child folder within it.
But, the component must work if I placed it in any of the other groups and when I deploy it to the server it must work there too. e.g. if the component is placed in the Enterprise Scotty Pessimistic Score, the process folder would be in the Enterprise Scotty Pessimistic Score group.
I can not figure out a way for KNIME to get the path required to create the process folder and its child folder.
It’s hard to tell without your workflow, but as a first guess:
You can set Path values to “Relative to” and then “Current workflow” or “Current workflow data area” (which is a folder named “data” inside the workflow folder).
Your paths then only need to consist of the last part and will adapt accordingly if you move the workflow somewhere else (colleages machine, server, …).
For future readers:
I have attached the workflow below.
In the original component spec I wanted the process folder to be below the parent e.g. Enterprise Landing Party Life Expectancy. This workflow does not do that, it does (as Thyme explained) put it into a folder named ‘data’ inside the workflow folder.
Interesting, I thought it’s possible to write to the workflow directory as well, either using “current workflow” or bypassing the restriction using ../ but no, didn’t work. It’s probably better to stick to the data area anyway.