code: public void updateTask(Task task) {
          try {
              executionDAO.updateTask(task);
              indexDAO.indexTask(task);
          } catch (Exception e) {
              String errorMsg = String.format("Error updating task: %s in workflow: %s", task.getTaskId(), task.getWorkflowInstanceId());
              LOGGER.error(errorMsg, e);
              throw new ApplicationException(ApplicationException.Code.BACKEND_ERROR, errorMsg, e);
          }
      }
docs: Sets the update time for the task.
  Sets the end time for the task (if task is in terminal state and end time is not set).
  Updates the task in the {@link ExecutionDAO} first, then stores it in the {@link IndexDAO}.
  
  @param task the task to be updated in the data store
  @throws ApplicationException if the dao operations fail