Ejemplo n.º 1
0
        public virtual void updateTask(TaskDto taskDto)
        {
            TaskService taskService = engine.TaskService;

            Task task = getTaskById(taskId);

            if (task == null)
            {
                throw new InvalidRequestException(Response.Status.NOT_FOUND, "No matching task with id " + taskId);
            }

            taskDto.updateTask(task);
            taskService.saveTask(task);
        }
Ejemplo n.º 2
0
        public virtual void createTask(TaskDto taskDto)
        {
            ProcessEngine engine      = ProcessEngine;
            TaskService   taskService = engine.TaskService;

            Task newTask = taskService.newTask(taskDto.Id);

            taskDto.updateTask(newTask);

            try
            {
                taskService.saveTask(newTask);
            }
            catch (NotValidException e)
            {
                throw new InvalidRequestException(Response.Status.BAD_REQUEST, e, "Could not save task: " + e.Message);
            }
        }