use of org.motechproject.tasks.exception.TaskNotFoundException in project motech by motech.
the class TaskServiceImpl method deleteTask.
@Override
@Transactional
public void deleteTask(Long taskId) {
Task t = getTask(taskId);
if (t == null) {
throw new TaskNotFoundException(taskId);
}
LOGGER.info("Deleted task: {} with ID: {}", t.getName(), taskId);
tasksDataService.delete(t);
}
use of org.motechproject.tasks.exception.TaskNotFoundException in project motech by motech.
the class TaskServiceImpl method exportTask.
@Override
@Transactional
public String exportTask(Long taskId) {
Task task = getTask(taskId);
if (null != task) {
LOGGER.info("Exporting task: {} with ID: {}", task.getName(), task.getId());
JsonNode node = new ObjectMapper().valueToTree(task.toDto());
removeIgnoredFields(node);
return node.toString();
} else {
throw new TaskNotFoundException(taskId);
}
}
Aggregations