Search in sources :

Example 1 with EdgeModel

use of org.apache.airavata.model.EdgeModel in project airavata by apache.

the class JsonWorkflowParser method addEdges.

/**
 * @param outPort -
 * @param links  -
 * @return key: nodeId,inportId  value : link
 */
private Map<String, Edge> addEdges(OutPort outPort, List<Link> links) {
    Map<String, Edge> inPortMap = new HashMap<>();
    if (links != null) {
        for (Link link : links) {
            EdgeModel edgeModel = new EdgeModel(link.getId());
            Edge edge = new DirectedEdge(edgeModel);
            // edge.setFromPort(outPort);
            outPort.addEdge(edge);
            inPortMap.put(link.getTo().getNodeId() + "," + link.getTo().getPortId(), edge);
        }
    }
    return inPortMap;
}
Also used : DirectedEdge(org.apache.airavata.workflow.core.dag.edge.DirectedEdge) HashMap(java.util.HashMap) DirectedEdge(org.apache.airavata.workflow.core.dag.edge.DirectedEdge) Edge(org.apache.airavata.workflow.core.dag.edge.Edge) EdgeModel(org.apache.airavata.model.EdgeModel)

Aggregations

HashMap (java.util.HashMap)1 EdgeModel (org.apache.airavata.model.EdgeModel)1 DirectedEdge (org.apache.airavata.workflow.core.dag.edge.DirectedEdge)1 Edge (org.apache.airavata.workflow.core.dag.edge.Edge)1