code: private void readRelationships(net.sf.mpxj.ganttproject.schema.Task gpTask)
     {
        for (Depend depend : gpTask.getDepend())
        {
           Task task1 = m_projectFile.getTaskByUniqueID(Integer.valueOf(NumberHelper.getInt(gpTask.getId()) + 1));
           Task task2 = m_projectFile.getTaskByUniqueID(Integer.valueOf(NumberHelper.getInt(depend.getId()) + 1));
           if (task1 != null && task2 != null)
           {
              Duration lag = Duration.getInstance(NumberHelper.getInt(depend.getDifference()), TimeUnit.DAYS);
              Relation relation = task2.addPredecessor(task1, getRelationType(depend.getType()), lag);
              m_eventManager.fireRelationReadEvent(relation);
           }
        }
     }
docs: Read the relationships for an individual GanttProject task.
  
  @param gpTask GanttProject task