use of org.apache.airavata.workflow.model.component.ws.WSComponentKey in project airavata by apache.
the class Workflow method bindComponents.
/**
* Binds WSNodes to components
*
* @throws ComponentException
* @throws GraphException
*/
public void bindComponents() throws ComponentException, GraphException {
// This map is to avoid creating multiple instances for the a component
Map<WSComponentKey, WSComponent> components = new HashMap<WSComponentKey, WSComponent>();
for (WSNode node : GraphUtil.getWSNodes(this.graph)) {
String id = node.getWSDLID();
logger.debug("id: " + id);
// WsdlDefinitions wsdl = this.wsdlMap.get(id);
//
// if (wsdl == null) {
// // XXX This happens while loading a workflow that is created by
// // the version 2.2.6_2 or below from GPEL.
// // Need to look for wsdl manually.
// // id should be look like
// // {http://www.extreme.indiana.edu/math/}Adder
// for (WsdlDefinitions w : this.wsdlMap.values()) {
// QName name = WSDLUtil.getWSDLQName(w);
// if (name.toString().equals(id)) {
// wsdl = w;
// break;
// }
// }
// }
// if (wsdl == null) {
// continue;
// }
// try {
// QName portType = node.getPortTypeQName();
// if (portType == null) {
// // XXX This happens while parsing xwf created by the version
// // 2.2.6_1 or below.
// portType = WSDLUtil.getFirstPortTypeQName(wsdl);
// }
// String operation = node.getOperationName();
// if (operation == null) {
// // XXX This happens while parsing xwf created by the version
// // 2.2.6_1 or below.
// operation = WSDLUtil.getFirstOperationName(wsdl, portType);
// }
// WSComponentKey key = new WSComponentKey(id, portType, operation);
//
// WSComponent component = null;
// if (components.containsKey(key)) {
// component = components.get(key);
// } else {
// //FIXME
// // component = WSComponentFactory.createComponent(wsdl, portType, operation);
// components.put(key, component);
// }
// node.setComponent(component);
// } catch (UtilsException e) {
// logger.error(e.getMessage(), e);
// }
}
this.graph.fixParameterNodes();
GraphUtil.propagateTypes(this.graph);
}
Aggregations