} else {
String message = "The type of input " + index + " ("
+ inputType1 + ") of " + getID()
+ " must be same as the type of input "
+ (index + size) + " (" + inputType2 + ").";
throw new GraphException(message);
}
// input1 -> output
if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
outputPort.copyType(port);
} else if (outputType.equals(portType)) {
// Do nothing.
} else {
String message = "The type of input " + index + " ("
+ inputType1 + ") of " + getID()
+ " must be same as the type of output " + index + " ("
+ outputType + ").";
throw new GraphException(message);
}
} else if (port == inputPort2) {
// input2 -> input1
if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
inputPort1.copyType(port);
} else if (inputType1.equals(portType)) {
// Do nothing.
} else {
String message = "The type of input " + index + " ("
+ inputType1 + ") of " + getID()
+ " must be same as the type of input "
+ (index + size) + " (" + inputType2 + ").";
throw new GraphException(message);
}
// input2 -> output
if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
outputPort.copyType(port);
} else if (outputType.equals(portType)) {
// Do nothing.
} else {
String message = "The type of input " + (index + size) + " ("
+ inputType2 + ") of " + getID()
+ " must be same as the type of output " + index + " ("
+ outputType + ").";
throw new GraphException(message);
}
} else if (port == outputPort) {
// output -> input1
if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
inputPort1.copyType(port);
} else if (inputType1.equals(portType)) {
// Do nothing.
} else {
String message = "The type of input " + index + " ("
+ inputType1 + ") of " + getID()
+ " must be same as the type of output " + index + " ("
+ outputType + ").";
throw new GraphException(message);
}
// output -> input2
if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
inputPort2.copyType(port);
} else if (inputType2.equals(portType)) {
// Do nothing.
} else {
String message = "The type of input " + (index + size) + " ("
+ inputType2 + ") of " + getID()
+ " must be same as the type of input " + index + " ("
+ outputType + ").";
throw new GraphException(message);
}
} else {
throw new XBayaRuntimeException();
}
}