code: public void addRelation() {
  
          if (m_relations == null) {
              m_relations = new HashMap<String, List<CmsRelation>>();
          }
          try {
              if (m_resource == null) {
                  // skip relation import if the import of the resource failed
                  return;
              }
              if (m_throwable != null) {
                  // relation data is corrupt, ignore relation
                  if (LOG.isWarnEnabled()) {
                      LOG.warn(
                          Messages.get().getBundle().key(
                              Messages.LOG_IMPORTEXPORT_ERROR_IMPORTING_RELATION_1,
                              getCms().getRequestContext().removeSiteRoot(m_resource.getRootPath())),
                          m_throwable);
                  }
                  getReport().println(m_throwable);
                  getReport().addError(m_throwable);
                  m_throwable = null;
                  return;
              }
              List<CmsRelation> currentRelations = m_relations.get(m_resource.getRootPath());
              if (currentRelations == null) {
                  currentRelations = new ArrayList<CmsRelation>();
                  m_relations.put(m_resource.getRootPath(), currentRelations);
              }
              currentRelations.add(
                  new CmsRelation(
                      m_resource.getStructureId(),
                      m_resource.getRootPath(),
                      m_relationId,
                      m_relationPath,
                      m_relationType));
          } finally {
              m_relationId = null;
              m_relationPath = null;
              m_relationType = null;
          }
      }
docs: Adds a relation to be imported from the current xml data.<p>
  
  @see #addResourceRelationRules(Digester, String)