Node multiNode = workflow.addNode(multiComp);
multiNode.setPosition(new Point(320, 130));
// Input node 1
InputNode inputNode1 = (InputNode) workflow.addNode(this.inputComponent);
inputNode1.setPosition(new Point(20, 30));
// Input node 2
InputNode inputNode2 = (InputNode) workflow.addNode(this.inputComponent);
inputNode2.setPosition(new Point(20, 100));
// Input node 3
InputNode inputNode3 = (InputNode) workflow.addNode(this.inputComponent);
inputNode3.setPosition(new Point(20, 170));
// Input node 4
InputNode inputNode4 = (InputNode) workflow.addNode(this.inputComponent);
inputNode4.setPosition(new Point(20, 240));
// Output
OutputNode outputNode = (OutputNode) workflow.addNode(this.outputComponent);
outputNode.setPosition(new Point(500, 130));
// Connect ports
graph.addEdge(inputNode1.getOutputPort(0), adderNode1.getInputPort(0));
graph.addEdge(inputNode2.getOutputPort(0), adderNode1.getInputPort(1));
graph.addEdge(inputNode3.getOutputPort(0), adderNode2.getInputPort(0));
graph.addEdge(inputNode4.getOutputPort(0), adderNode2.getInputPort(1));
graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
graph.addEdge(adderNode2.getOutputPort(0), multiNode.getInputPort(1));
graph.addEdge(multiNode.getOutputPort(0), outputNode.getInputPort(0));
// Set the default values
// This needs to be after connection.
inputNode1.setConfiguredName("a");
inputNode2.setConfiguredName("b");
inputNode3.setConfiguredName("c");
inputNode4.setConfiguredName("d");
inputNode1.setDescription("This is the first input.");
inputNode2.setDescription("This is the second input.");
inputNode3.setDescription("This is the third input.");
inputNode4.setDescription("This is the fourth input.");
inputNode1.setConfigured(true);
inputNode2.setConfigured(true);
inputNode3.setConfigured(true);
inputNode4.setConfigured(true);
inputNode1.setDefaultValue("2");
inputNode2.setDefaultValue("3");
inputNode3.setDefaultValue("4");
inputNode4.setDefaultValue("5");
outputNode.setConfiguredName("z");
outputNode.setConfigured(true);
return workflow;
}