if (toNodes.size() == 0) {
function += SPACE + "void";
} else {
if (toNodes.size() == 1 && toNodes.get(0) instanceof WSPort) {
WSPort outPort = (WSPort) toNodes.get(0);
returnElement = outPort.getComponentPort().getElement();
returnType = outPort.getType();
} else {
throw new WorkflowRuntimeException("Unhandled port type for Dynamic component or to many outputs");
}
for (Port port : toNodes) {
if (toNodes.get(0) instanceof DataPort) {
if (!returnType.equals(((DataPort) toNodes.get(0)).getType())) {
throw new WorkflowRuntimeException(
"Dynamic output port connected to input ports of different types.");
}
} else {
throw new WorkflowRuntimeException("Unhandled port type for Dynamic component");
}
}
int index = BasicTypeMapping.getSimpleTypeIndex(returnElement);
if (-1 != index) {
function += SPACE + BasicTypeMapping.getTypeName(index);
} else {
throw new WorkflowRuntimeException("WIll be fixed with complex type mappign");
}
}
function += SPACE + "operationName(";
List<DataPort> inputPorts = this.node.getInputPorts();
boolean first = true;
// variable list in function prototype
for (DataPort inPort : inputPorts) {
Port fromPort = inPort.getFromPort();
if (fromPort instanceof WSPort) {
WSPort wsPort = (WSPort) fromPort;
XmlElement element = wsPort.getComponentPort().getElement();
// QName inType = ((DataPort) fromPort).getType();
int typeIndex = BasicTypeMapping.getSimpleTypeIndex(element);
if (-1 != typeIndex) {
if (first) {