Search in sources :

Example 1 with EPRPort

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);
    }
}
Also used : SystemComponentDataPort(org.apache.airavata.workflow.model.component.system.SystemComponentDataPort) DataPort(org.apache.airavata.workflow.model.graph.DataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort) EPRPort(org.apache.airavata.workflow.model.graph.EPRPort) ControlPort(org.apache.airavata.workflow.model.graph.ControlPort) ComponentControlPort(org.apache.airavata.workflow.model.component.ComponentControlPort) ComponentControlPort(org.apache.airavata.workflow.model.component.ComponentControlPort) SystemComponentDataPort(org.apache.airavata.workflow.model.component.system.SystemComponentDataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort)

Example 2 with EPRPort

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;
}
Also used : EPRPort(org.apache.airavata.workflow.model.graph.EPRPort)

Example 3 with EPRPort

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;
}
Also used : EPRPort(org.apache.airavata.workflow.model.graph.EPRPort) ControlPort(org.apache.airavata.workflow.model.graph.ControlPort) InstanceDataPort(org.apache.airavata.workflow.model.graph.amazon.InstanceDataPort) SystemDataPort(org.apache.airavata.workflow.model.graph.system.SystemDataPort) PortImpl(org.apache.airavata.workflow.model.graph.impl.PortImpl)

Example 4 with EPRPort

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();
        }
    }
}
Also used : DataPort(org.apache.airavata.workflow.model.graph.DataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort) DataEdge(org.apache.airavata.workflow.model.graph.DataEdge) EPRPort(org.apache.airavata.workflow.model.graph.EPRPort) DataPort(org.apache.airavata.workflow.model.graph.DataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort) EPRPort(org.apache.airavata.workflow.model.graph.EPRPort) Port(org.apache.airavata.workflow.model.graph.Port) DataType(org.apache.airavata.model.application.io.DataType) WorkflowRuntimeException(org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException)

Example 5 with EPRPort

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();
        }
    }
}
Also used : DataPort(org.apache.airavata.workflow.model.graph.DataPort) DataEdge(org.apache.airavata.workflow.model.graph.DataEdge) EPRPort(org.apache.airavata.workflow.model.graph.EPRPort) DataPort(org.apache.airavata.workflow.model.graph.DataPort) EPRPort(org.apache.airavata.workflow.model.graph.EPRPort) Port(org.apache.airavata.workflow.model.graph.Port) DataType(org.apache.airavata.model.application.io.DataType) WorkflowRuntimeException(org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException)

Aggregations

EPRPort (org.apache.airavata.workflow.model.graph.EPRPort)10 DataPort (org.apache.airavata.workflow.model.graph.DataPort)7 Port (org.apache.airavata.workflow.model.graph.Port)6 DataEdge (org.apache.airavata.workflow.model.graph.DataEdge)5 ComponentDataPort (org.apache.airavata.workflow.model.component.ComponentDataPort)4 WorkflowRuntimeException (org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException)4 ControlPort (org.apache.airavata.workflow.model.graph.ControlPort)4 DataType (org.apache.airavata.model.application.io.DataType)3 DataType (org.apache.airavata.model.appcatalog.appinterface.DataType)2 QName (javax.xml.namespace.QName)1 ComponentControlPort (org.apache.airavata.workflow.model.component.ComponentControlPort)1 SystemComponentDataPort (org.apache.airavata.workflow.model.component.system.SystemComponentDataPort)1 ControlEdge (org.apache.airavata.workflow.model.graph.ControlEdge)1 Edge (org.apache.airavata.workflow.model.graph.Edge)1 GraphException (org.apache.airavata.workflow.model.graph.GraphException)1 Node (org.apache.airavata.workflow.model.graph.Node)1 InstanceDataPort (org.apache.airavata.workflow.model.graph.amazon.InstanceDataPort)1 PortImpl (org.apache.airavata.workflow.model.graph.impl.PortImpl)1 InputNode (org.apache.airavata.workflow.model.graph.system.InputNode)1 OutputNode (org.apache.airavata.workflow.model.graph.system.OutputNode)1