// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java // The path to the documents directory. String dataDir = Utils.getDataDir(ParentAndChildTasks.class); Project prj = new Project(dataDir + "ParentAndChildTask.mpp"); // Create a ChildTasksCollector instance ChildTasksCollector collector = new ChildTasksCollector(); // Use TaskUtils to get all children tasks in RootTask TaskUtils.apply(prj.getRootTask(), collector, 0); List tasks = collector.getTasks(); int iSize = tasks.size(); // Parse through all the collected tasks for (int i = 0; i < iSize; i++) { Task tsk = (Task) tasks.get(i); System.out.println("Task Name = " + tsk.get(Tsk.NAME)); }