code: private void writePredecessors(Project.Tasks.Task xml, Task mpx)
     {
        List<Project.Tasks.Task.PredecessorLink> list = xml.getPredecessorLink();
  
        List<Relation> predecessors = mpx.getPredecessors();
        for (Relation rel : predecessors)
        {
           Integer taskUniqueID = rel.getTargetTask().getUniqueID();
           list.add(writePredecessor(taskUniqueID, rel.getType(), rel.getLag()));
           m_eventManager.fireRelationWrittenEvent(rel);
        }
     }
docs: This method writes predecessor data to an MSPDI file.
  We have to deal with a slight anomaly in this method that is introduced
  by the MPX file format. It would be possible for someone to create an
  MPX file with both the predecessor list and the unique ID predecessor
  list populated... which means that we must process both and avoid adding
  duplicate predecessors. Also interesting to note is that MSP98 populates
  the predecessor list, not the unique ID predecessor list, as you might
  expect.
  
  @param xml MSPDI task data
  @param mpx MPX task data