if(node instanceof WSNode){
WSNode wsNode = new WSNode(((WSNode) node).toXML());
((NodeImpl)wsNode).setGraph(wsGraph);
List<DataPort> inputPorts = node.getInputPorts();
for (DataPort dataPort : inputPorts) {
wsNode.addInputPort(new CepPort(dataPort.toXML()));
}
List<DataPort> outputPorts = node.getOutputPorts();
for (DataPort dataPort : outputPorts) {
wsNode.addOutputPort(new CepPort(dataPort.toXML()));
}
return wsNode;
}else if(node instanceof CepNode){
CepNode cepNode = new CepNode(((CepNode) node).toXML());
List<DataPort> inputPorts = node.getInputPorts();
for (DataPort dataPort : inputPorts) {
CepPort cepPort = new CepPort(dataPort.toXML());
cepNode.addInputPort(cepPort);
}
List<DataPort> outputPorts = node.getOutputPorts();
for (DataPort dataPort : outputPorts) {
cepNode.addOutputPort(new CepPort(dataPort.toXML()));
}
((NodeImpl)cepNode).setGraph(wsGraph);
return cepNode;
}else if(node instanceof InputNode){
InputNode inputNode = new InputNode(((InputNode) node).toXML());
List<DataPort> outputPorts = node.getOutputPorts();
for (DataPort dataPort : outputPorts) {
inputNode.addOutputPort(new CepPort(dataPort.toXML()));
}
((NodeImpl)inputNode).setGraph(wsGraph);
return inputNode;
}else if(node instanceof OutputNode){
OutputNode outputNode = new OutputNode(((OutputNode) node).toXML());
List<DataPort> inputPorts = node.getInputPorts();
for (DataPort dataPort : inputPorts) {
outputNode.addInputPort(new CepPort(dataPort.toXML()));
}
((NodeImpl)outputNode).setGraph(wsGraph);
return outputNode;
}