code: private Integer getOutlineLevel(Task task)
     {
        String value = task.getWBS();
        Integer result = Integer.valueOf(1);
        if (value != null && value.length() > 0)
        {
           String[] path = WBS_SPLIT_REGEX.split(value);
           result = Integer.valueOf(path.length);
        }
        return result;
     }
docs: Extract the outline level from a task's WBS attribute.
  
  @param task Task instance
  @return outline level