List<String> taskNames = graph.getTopologicalSort(null);
List<TaskDefinition> taskDefinitionsInOrder = new ArrayList<TaskDefinition>();
for (String taskName : taskNames) {
TaskDefinition task = taskDefinitionsByTaskName.get(taskName);
taskDefinitionsInOrder.add(task);
}
return taskDefinitionsInOrder;
}