task.setDescription(taskTO.getDescription());
if (taskUtil.getType() == TaskType.SCHEDULED) {
task.setJobClassName(taskTO.getJobClassName());
} else if (taskTO instanceof AbstractSyncTaskTO) {
final AbstractSyncTaskTO syncTaskTO = (AbstractSyncTaskTO) taskTO;
ExternalResource resource = resourceDAO.find(syncTaskTO.getResource());
if (resource == null) {
throw new NotFoundException("Resource " + syncTaskTO.getResource());
}
((AbstractSyncTask) task).setResource(resource);
fill((AbstractSyncTask) task, syncTaskTO);
}