for (InputNode node : GraphUtil.getNodes(this, InputNode.class)) {
DataPort oldPort = node.getOutputPort(0);
if (oldPort instanceof WSPort) {
node.getOutputPorts().remove(oldPort);
this.ports.remove(oldPort);
SystemDataPort newPort = new SystemDataPort();
this.ports.add(newPort);
newPort.setKind(Kind.DATA_OUT);
newPort.setName(oldPort.getName());
newPort.setGraph(this);
newPort.setNode(node);
newPort.createID();
node.getOutputPorts().add(newPort);
for (DataEdge edge : oldPort.getEdges()) {
edge.setFromPort(newPort);
newPort.getEdges().add(edge);
}
}
}
for (OutputNode node : GraphUtil.getNodes(this, OutputNode.class)) {
DataPort oldPort = node.getInputPort(0);
if (oldPort instanceof WSPort) {
node.getInputPorts().remove(oldPort);
this.ports.remove(oldPort);
SystemDataPort newPort = new SystemDataPort();
this.ports.add(newPort);
newPort.setKind(Kind.DATA_IN);
newPort.setName(oldPort.getName());
newPort.setGraph(this);
newPort.setNode(node);
newPort.createID();
node.getInputPorts().add(newPort);
for (DataEdge edge : oldPort.getEdges()) {
edge.setToPort(newPort);
newPort.getEdges().add(edge);
}
}
}
}