code: private void readTasks(Integer id)
     {
        Integer currentID = id;
        Table table = getTable("WBSTAB");
  
        while (currentID.intValue() != 0)
        {
           MapRow row = table.find(currentID);
           Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID"));
           readLeafTasks(task, row.getInteger("FIRST_CHILD_TASK_ID"));
           Integer childID = row.getInteger("CHILD_ID");
           if (childID.intValue() != 0)
           {
              readTasks(childID);
           }
           currentID = row.getInteger("NEXT_ID");
        }
     }
docs: Read leaf tasks attached to the WBS.
  
  @param id initial WBS ID