code: public void generateOutlineNumber(Task parent)
     {
        String outline;
  
        if (parent == null)
        {
           if (NumberHelper.getInt(getUniqueID()) == 0)
           {
              outline = "0";
           }
           else
           {
              outline = Integer.toString(getParentFile().getChildTasks().size() + 1);
           }
        }
        else
        {
           outline = parent.getOutlineNumber();
  
           int index = outline.lastIndexOf(".0");
  
           if (index != -1)
           {
              outline = outline.substring(0, index);
           }
  
           int childTaskCount = parent.getChildTasks().size() + 1;
           if (outline.equals("0"))
           {
              outline = Integer.toString(childTaskCount);
           }
           else
           {
              outline += ("." + childTaskCount);
           }
        }
  
        setOutlineNumber(outline);
     }
docs: This method is used to automatically generate a value
  for the Outline Number field of this task.
  
  @param parent Parent Task