Order order = project.order;
TaskSource taskSource = TaskSource.createForGroup(order
.getCurrentSchedulingDataForVersion());
TaskGroup taskGroup = taskSource
.createTaskGroupWithoutDatesInitializedAndLinkItToTaskSource();
BaseCalendar calendar = configurationDAO.getConfiguration()
.getDefaultCalendar();
taskGroup.setCalendar(calendar);
List<TaskElement> taskElements = new ArrayList<TaskElement>();
for (OrderElementDTO importTask : project.tasks) {
taskElements.add(createTask(importTask, importCalendar));
}
for (MilestoneDTO milestone : project.milestones) {
taskElements.add(createTaskMilestone(milestone));
}
for (TaskElement taskElement : taskElements) {
taskGroup.addTaskElement(taskElement);
}
return taskGroup;
}