// amount
InputNode amount = (InputNode) workflow.addNode(this.inputComponent);
amount.setPosition(new Point(10, 10));
// if
DoWhileNode doWhileNode = (DoWhileNode) workflow.addNode(this.doWhileComponent);
doWhileNode.setPosition(new Point(200, 100));
// Approver nodes
Component approverComponent = this.componentRegistry.getComponent(Approver.WSDL_PATH);
Node approver = workflow.addNode(approverComponent);
approver.setPosition(new Point(350, 10));
// const
ConstantNode constYes = (ConstantNode) workflow.addNode(this.constantComponent);
constYes.setPosition(new Point(350, 200));
// endif
Node endDoWhile = workflow.addNode(this.endDoWhileComponent);
endDoWhile.setPosition(new Point(550, 100));
// Output
OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
output.setPosition(new Point(700, 100));
// Connect ports
graph.addEdge(amount.getOutputPort(0), approver.getInputPort(0));
graph.addEdge(amount.getOutputPort(0), doWhileNode.getInputPort(0));
graph.addEdge(doWhileNode.getControlOutPorts().get(0), approver.getControlInPort());
graph.addEdge(doWhileNode.getControlOutPorts().get(1), constYes.getControlInPort());
graph.addEdge(approver.getOutputPort(0), endDoWhile.getInputPort(0));
graph.addEdge(constYes.getOutputPort(0), endDoWhile.getInputPort(1));
graph.addEdge(endDoWhile.getOutputPort(0), output.getInputPort(0));
// Set the default values
// This needs to be after connection.
amount.setDefaultValue("0");
constYes.setValue("Yes");
doWhileNode.setXpath("$1 = 1");
output.setConfiguredName("accept");
output.setConfigured(true);
return workflow;
}