code: private int updateStructure(int id, Task task, Integer outlineLevel)
     {
        task.setID(Integer.valueOf(id++));
        task.setOutlineLevel(outlineLevel);
        outlineLevel = Integer.valueOf(outlineLevel.intValue() + 1);
        for (Task childTask : task.getChildTasks())
        {
           id = updateStructure(id, childTask, outlineLevel);
        }
        return id;
     }
docs: Iterates through the tasks setting the correct
  outline level and ID values.
  
  @param id current ID value
  @param task current task
  @param outlineLevel current outline level
  @return next ID value