use of org.apache.airavata.workflow.model.graph.EPRPort in project airavata by apache.
the class ExitComponent method createPorts.
protected void createPorts(NodeImpl node) {
for (ComponentDataPort input : getInputPorts()) {
DataPort port = input.createPort();
node.addInputPort(port);
}
for (ComponentDataPort output : getOutputPorts()) {
DataPort port = output.createPort();
node.addOutputPort(port);
}
if (this.controlInPort != null) {
ControlPort port = this.controlInPort.createPort();
node.setControlInPort(port);
}
for (ComponentControlPort componentPort : this.controlOutPorts) {
ControlPort port = componentPort.createPort();
node.addControlOutPort(port);
}
if (this.eprPort != null) {
EPRPort port = this.eprPort.createPort();
node.setEPRPort(port);
}
}
use of org.apache.airavata.workflow.model.graph.EPRPort in project airavata by apache.
the class ComponentEPRPort method createPort.
/**
* @see org.apache.airavata.workflow.model.component.ComponentPort#createPort()
*/
@Override
public EPRPort createPort() {
EPRPort port = new EPRPort();
port.setName(this.name);
port.setComponentPort(this);
return port;
}
use of org.apache.airavata.workflow.model.graph.EPRPort in project airavata by apache.
the class WSGraphFactory method createPort.
public PortImpl createPort(XmlElement portElement) {
String type = portElement.attributeValue(GraphSchema.NS, GraphSchema.PORT_TYPE_ATTRIBUTE);
if (type == null) {
// Old graphs don't have the namespace for the attribute.
type = portElement.attributeValue(GraphSchema.PORT_TYPE_ATTRIBUTE);
}
PortImpl port;
if (GraphSchema.PORT_TYPE_WS_DATA.equals(type)) {
port = new WSPort(portElement);
} else if (GraphSchema.PORT_TYPE_SYSTEM_DATA.equals(type)) {
port = new SystemDataPort(portElement);
} else if (GraphSchema.PORT_TYPE_CONTROL.equals(type)) {
port = new ControlPort(portElement);
} else if (GraphSchema.PORT_TYPE_EPR.equals(type)) {
port = new EPRPort(portElement);
} else if (GraphSchema.PORT_TYPE_INSTANCE.equals(type)) {
port = new InstanceDataPort(portElement);
} else {
// Default is WsPort because of backword compatibility
port = new WSPort(portElement);
}
return port;
}
use of org.apache.airavata.workflow.model.graph.EPRPort in project airavata by apache.
the class EndDoWhileNode method edgeWasAdded.
/**
* @throws GraphException
* @see org.apache.airavata.workflow.model.graph.impl.NodeImpl#edgeWasAdded(org.apache.airavata.workflow.model.graph.Edge)
*/
@Override
protected void edgeWasAdded(Edge edge) throws GraphException {
// XXX cannot detect if the type is array or not from WSDL at this
// point. so no check here.
// super.edgeWasAdded(edge);
Port fromPort = edge.getFromPort();
Port toPort = edge.getToPort();
if (edge instanceof DataEdge) {
if (fromPort instanceof EPRPort) {
// TODO
return;
}
DataPort fromDataPort = (DataPort) fromPort;
DataPort toDataPort = (DataPort) toPort;
DataType fromType = fromDataPort.getType();
DataType toType = toDataPort.getType();
if (fromDataPort.getNode() == this) {
if (!(toType == null || toType.equals(WSConstants.XSD_ANY_TYPE))) {
fromDataPort.copyType(toDataPort);
}
} else if (toDataPort.getNode() == this) {
if (!(fromType == null || fromType.equals(WSConstants.XSD_ANY_TYPE))) {
toDataPort.copyType(fromDataPort);
}
} else {
throw new WorkflowRuntimeException();
}
}
}
use of org.apache.airavata.workflow.model.graph.EPRPort in project airavata by apache.
the class SystemNode method edgeWasAdded.
/**
* @throws GraphException
* @see org.apache.airavata.workflow.model.graph.impl.NodeImpl#edgeWasAdded(org.apache.airavata.workflow.model.graph.Edge)
*/
@Override
protected void edgeWasAdded(Edge edge) throws GraphException {
super.edgeWasAdded(edge);
GraphUtil.validateConnection(edge);
Port fromPort = edge.getFromPort();
Port toPort = edge.getToPort();
if (edge instanceof DataEdge) {
if (fromPort instanceof EPRPort) {
// TODO
return;
}
DataPort fromDataPort = (DataPort) fromPort;
DataPort toDataPort = (DataPort) toPort;
DataType fromType = fromDataPort.getType();
DataType toType = toDataPort.getType();
if (fromDataPort.getNode() == this) {
// setType() propagates the change to the whole workflow.
if (!(toType == null || toType.equals(WSConstants.XSD_ANY_TYPE))) {
fromDataPort.copyType(toDataPort);
}
} else if (toDataPort.getNode() == this) {
if (!(fromType == null || fromType.equals(WSConstants.XSD_ANY_TYPE))) {
toDataPort.copyType(fromDataPort);
}
} else {
throw new WorkflowRuntimeException();
}
}
}
Aggregations