I’m stuck with the command line syntax with PowerShell under windows 10 with Knime 3.5.2
I’ve defined a small workflow called test1 doing basically almost nothing, simply saving a dummy csv.
Case 1 (success):
With the following call from command line:
knime -nosplash -noexit -consoleLog -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir=“C:/Users/yap/KNIME/testflows_workspace/from_command_line/test1”
The workflow is called and exectued properly as shown by the screenshot below:
The screenshot shows also the workflow variables that are defined.
Case 2 (failure):
With the following command (same as above except the setting of a new value for the workflows variable my_integer), it fails.
knime -nosplash -noexit -consoleLog -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir=“C:/Users/yap/KNIME/testflows_workspace/from_command_line/test1” -workflow.variable=my_integer,5,int
I got an exit code 2, so it’s an issue with the parameters.
In the console log, I got the following message: ERROR main BatchExecutor Unknown option ‘-workflow’
And there, I don’t understand what’s wrong in this command line?
What am I missunderstanding?
Any hint will be appreciated. Thanks
I believe it is up to the order of options. Try putting workflow.variable option before workflowDir option.
Sadly no, I got exactly the same error. But thanks for the idea anyway.
This is my call from Linux that works. Not sure there are supposed to be differences between Win and Linux regarding workflow variable…
knime -nosplash -consolelog -application org.knime.product.KNIME_BATCH_APPLICATION -reset -workflow.variable="application_date","2018-08-15",String -workflowDir=...
That’s weird. I tried with other variables with different types, same thing.
I’ve even replaced the keyword -workflow.variable by -dummy.variable to see what error message I will obtain. And I got the same result, i.e. the ‘dummy’ keyword is unknown (as expected btw).
So it’s the -workflow keyword that is not recognized.
Maybe a knime package is missing in my current installation?
I doubt you are missing a package.
Do you get error:
ERROR main BatchExecutor Unknown option ‘-workflow’
ERROR main BatchExecutor Unknown option ‘-workflow.variable’
The only explanation I have is that your dot between workflow and variable isn’t actually a dot but some other weird character.
The issue comes from Windows Powershell.
Under windows10, the command line can be used from:
- MS DOS windows (with the black background)
- Windows Powershell (with the blue background)
From the MS DOS windows, my command line works fine.
From the Windows Powershell, I got this “workflow” option unknown…
Issue solved. It’s coming from the presence of the . (dot) in the option names… The dot is seen as a separator (or at least a special character) in Windows PowerShell).
I’ve surrounded the option name workflow.variable by double quotes and it works! It’s ugly but solves the issue.
knime -nosplash -noexit -consoleLog -reset -workflowDir=“C:/Users/yap/KNIME/testflows_workspace/from_command_line/test1/” -application org.knime.product.KNIME_BATCH_APPLICATION -“workflow.variable”=“X”,“x”,String
A little update of the documentation might be interesting (if my fix is the proper one).
Another solution could be to add a new keyword workflowVariable doing the same thing than workflows.variable while keeping workflow.variable to ensure that existing command lines continue to run under Ms Dos windows.
What do you think?
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.