code: private void writeTaskPredecessors(Task record)
     {
        m_buffer.setLength(0);
        //
        // Write the task predecessor
        //
        if (!record.getSummary() && !record.getPredecessors().isEmpty())
        { // I don't use summary tasks for SDEF
           m_buffer.append("PRED ");
           List<Relation> predecessors = record.getPredecessors();
  
           for (Relation pred : predecessors)
           {
              m_buffer.append(SDEFmethods.rset(pred.getSourceTask().getUniqueID().toString(), 10) + " ");
              m_buffer.append(SDEFmethods.rset(pred.getTargetTask().getUniqueID().toString(), 10) + " ");
              String type = "C"; // default finish-to-start
              if (!pred.getType().toString().equals("FS"))
              {
                 type = pred.getType().toString().substring(0, 1);
              }
              m_buffer.append(type + " ");
  
              Duration dd = pred.getLag();
              double duration = dd.getDuration();
              if (dd.getUnits() != TimeUnit.DAYS)
              {
                 dd = Duration.convertUnits(duration, dd.getUnits(), TimeUnit.DAYS, m_minutesPerDay, m_minutesPerWeek, m_daysPerMonth);
              }
              Double days = Double.valueOf(dd.getDuration() + 0.5); // Add 0.5 so half day rounds up upon truncation
              Integer est = Integer.valueOf(days.intValue());
              m_buffer.append(SDEFmethods.rset(est.toString(), 4) + " "); // task duration in days required by USACE
           }
           m_writer.println(m_buffer.toString());
        }
     }
docs: Write each predecessor for a task.
  
  @param record Task instance