Integer.toString(continuedStory.getId())) + "\n\n" + story.getDescription());
continuedStory.setDescription(getResources(request).getMessage("story.continued.from",
Integer.toString(story.getId()) + "\n\n" + continuedStory.getDescription()));
Iterator taskIterator = story.getTasks().iterator();
while (taskIterator.hasNext()) {
Task task = (Task)taskIterator.next();
if (!task.isCompleted()) {
Task continuedTask = new Task();
BeanUtils.copyProperties(continuedTask, task);
continuedTask.setCreatedDate(new Date());
continuedTask.setStory(continuedStory);
continuedTask.setEstimatedHours(task.getEstimatedHours() - task.getActualHours());
continuedTask.setTimeEntries(null);
Integer continuedTaskId = (Integer)session.save(continuedTask);
HistorySupport.saveEvent(session, continuedTask, HistoricalEvent.CREATED, "continuation",
SecurityHelper.getRemoteUserId(request), new Date());
task.setDescription("Continued as task:" + continuedTask.getId() + "\n\n" + task.getDescription());
continuedTask.setDescription("Continued from task:" + task.getId() + "\n\n" +
continuedTask.getDescription());
}
}
return continuedStory;
}