// amount
InputNode amount = (InputNode) workflow.addNode(this.inputComponent);
amount.setPosition(new Point(10, 10));
// if
IfNode ifNode = (IfNode) workflow.addNode(this.ifComponent);
ifNode.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 endif = workflow.addNode(this.endifComponent);
endif.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), ifNode.getInputPort(0));
graph.addEdge(ifNode.getControlOutPorts().get(0), approver.getControlInPort());
graph.addEdge(ifNode.getControlOutPorts().get(1), constYes.getControlInPort());
graph.addEdge(approver.getOutputPort(0), endif.getInputPort(0));
graph.addEdge(constYes.getOutputPort(0), endif.getInputPort(1));
graph.addEdge(endif.getOutputPort(0), output.getInputPort(0));
// Set the default values
// This needs to be after connection.
amount.setDefaultValue("500");
constYes.setValue("Yes");
ifNode.setXPath("$0 > 1000");
output.setConfiguredName("accept");
output.setConfigured(true);
return workflow;
}