Skip to content

Providing Arguments

Steven England edited this page Jan 30, 2017 · 8 revisions

Info: The complete list of arguments can be found here: KnimeNet --> ArgumentBag


To get the most out of KnimeNet you obviously want to execute workflows with custom Arguments. A standard command line call to KNIME would look like this:

knime -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="workspace/Knime_project"

A more complex call to KNIME CLI might look like this:

knime -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="workspace/Knime_project" -workflowDir="workspace/Knime_project" -workflow.variable=my_integer,5,int -workflow.variable2=my_integer,hello,String -workflow.variable3=my_integer,pathtofile,String --launcher.ini "PathToIni" -credential=db;steven

And this might not be the most complex one. Especially the dynamic part of workflow variables might become a mess with procedural shell programming. Might... :) In KnimeNet this is all captured in an ArgumentBag. Knime is a child of Eclipse. This is why you have to major fields that these arguments belong to:

KNIME specific Configuration

These are native KNIME command line arguments. For example:

var argumentBag = new ArgumentBag();
/* flags */
argumentBag.NoSave = true;
/* workflow variables*/
argumentBag.WorkFlowVariables = new[]
{
   new WorkFlowVariable ("var1", "value1", VariableType.Double),
   new WorkFlowVariable ("var2", "value2", VariableType.Integer),
   new WorkFlowVariable ("var3", "value3", VariableType.String)
}

Eclipse specific Configuration

These are arguments that KNIME inherits from Eclipse.

var argumentBag = new ArgumentBag();
/* flags */
argumentBag.SuppressErrors = false;
/* VM arguments */
argumentBag.VmArguments = new[] { new VmArgument("vm key", "vm value");}

Initialisation from JSON

You can create an ArgumentBag from a JSON string like this:

var json = "{ ... JSON string here ... }";
var argumentBag = ArgumentBag.FromJson(json);

Use an native Argument String

You could also use the plain old argument string instead of the one created from the properties.

var argumentBag = new ArgumentBag("-reset -nosplash ...");