code: private void cancelTasksOfProcessInstance(ProcessInstance procInst)
      throws NamingException, JMSException, SQLException, ServiceLocatorException, MdwException {
          List<ProcessInstance> processInstanceList =
              edao.getChildProcessInstances(procInst.getId());
          List<Long> procInstIds = new ArrayList<Long>();
          procInstIds.add(procInst.getId());
          for (ProcessInstance pi : processInstanceList) {
              Process pidef = getProcessDefinition(pi);
              if (pidef.isEmbeddedProcess())
                  procInstIds.add(pi.getId());
          }
          TaskServices taskServices = ServiceLocator.getTaskServices();
          for (Long procInstId : procInstIds) {
              taskServices.cancelTaskInstancesForProcess(procInstId);
          }
      }
docs: ///////////////////// other