WorkflowPort fromPort = (WorkflowPort)from.getChildAt(0); WorkflowPort toPort = (WorkflowPort)to.getChildAt(0);
WorkflowPort fromPort = (WorkflowPort)from.getChildAt(from.getSelectedPort()); WorkflowPort toPort = (WorkflowPort)to.getChildAt(to.getSelectedPort());
  public void connectCells(WorkflowCell from, ActionDescriptor action, WorkflowCell to, ResultDescriptor result)  {    WorkflowPort fromPort = (WorkflowPort)from.getChildAt(0);    WorkflowPort toPort = (WorkflowPort)to.getChildAt(0);    resultIdGenerator.checkId(result.getId());    if(result.getId() == 0) result.setId(resultIdGenerator.generateId());    // Create Edge    ResultEdge edge = new ResultEdge(result, layout != null ? layout.getLabelPosition(result.getId()) : null);    // Connect Edge    ConnectionSet cs = new ConnectionSet(edge, fromPort, toPort);    Object[] cells = new Object[]{edge};    // Insert into Model    insert(cells, null, cs, null, null);    //toPort.assignIndex(edge);    //fromPort.assignIndex(edge);    // process join changed event    if(to instanceof JoinCell)    {      processJoinChangeEvent((JoinCell)to);    }  }