/**
   * {@inheritDoc}
   *
   * @return
   * @throws java.lang.Exception
   */
  @Override
  protected ModelAndView handleRequestInternal(
      HttpServletRequest request, HttpServletResponse response) throws Exception {

    Registration registration = Security.getRegistration(request);
    if (registration == null) return new ModelAndView("redirect:/login.htm");

    WorkflowRun workflowRun = getRequestedWorkflowRun(request);

    if (workflowRun != null) {
      Integer ownerId = workflowRun.getOwner().getRegistrationId();
      Integer registrationId = registration.getRegistrationId();

      if (registrationId.equals(ownerId)) {
        if (workflowRun.getStatus() != WorkflowRunStatus.completed) {
          workflowRun.setStatus(WorkflowRunStatus.cancelled);
          getWorkflowRunService().update(workflowRun);
        }
      }
    }

    return null;
  }