code: private void cancelProcessInstance(ProcessInstance pProcessInst)
          throws Exception {
          edao.cancelTransitionInstances(pProcessInst.getId(),
                  "ProcessInstance has been cancelled.", null);
          edao.setProcessInstanceStatus(pProcessInst.getId(), WorkStatus.STATUS_CANCELLED);
          edao.removeEventWaitForProcessInstance(pProcessInst.getId());
          this.cancelTasksOfProcessInstance(pProcessInst);
      }
docs: Cancels a single process instance.
  It cancels all active transition instances, all event wait instances,
  and sets the process instance into canceled status.
  
  The method does not cancel task instances
  
  @param pProcessInst
  @return new WorkInstance