code: private String formatRelation(Relation relation)
     {
        String result = null;
  
        if (relation != null)
        {
           StringBuilder sb = new StringBuilder(relation.getTargetTask().getID().toString());
  
           Duration duration = relation.getLag();
           RelationType type = relation.getType();
           double durationValue = duration.getDuration();
  
           if ((durationValue != 0) || (type != RelationType.FINISH_START))
           {
              String[] typeNames = LocaleData.getStringArray(m_locale, LocaleData.RELATION_TYPES);
              sb.append(typeNames[type.getValue()]);
           }
  
           if (durationValue != 0)
           {
              if (durationValue > 0)
              {
                 sb.append('+');
              }
  
              sb.append(formatDuration(duration));
           }
  
           result = sb.toString();
        }
  
        m_eventManager.fireRelationWrittenEvent(relation);
        return (result);
     }
docs: This method is called to format a relation.
  
  @param relation relation instance
  @return formatted relation instance