// Input parameter node
InputNode inputNode = (InputNode) workflow.addNode(this.inputComponent);
inputNode.setPosition(new Point(50, 50));
// Constant node
ConstantNode constantNode = (ConstantNode) workflow.addNode(this.constantComponent);
constantNode.setPosition(new Point(50, 120));
// Output parameter
OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
outParamNode.setPosition(new Point(300, 220));
// Connect ports
graph.addEdge(inputNode.getOutputPort(0), adderNode.getInputPort(0));
graph.addEdge(constantNode.getOutputPort(0), adderNode.getInputPort(1));
graph.addEdge(adderNode.getOutputPort(0), outParamNode.getInputPort(0));
// Set the default value of an input and the constant.
// This needs to be after connection.
String paramValue1 = "2";
inputNode.setDefaultValue(paramValue1);
String paramValue2 = "3";
constantNode.setValue(paramValue2);
return workflow;
}