code: @Transactional
  	public DeferredEvent removeDeferredEvent(ProcessInstance processInstance,
  			TaskBase task) {
  		List<DeferredEvent> deferredEvents = processInstance.getDeferredEvents();
  		for (DeferredEvent deferredEvent: deferredEvents) {
  			if (deferredEvent.getEventType() != EventType.DONE && deferredEvent.getTaskId().longValue() == task.getTaskId() && task.getProcessDefinitionName().equals(deferredEvent.getProcessDefinitionName())) {
  				log.debug("killed deferred event processId {} taskId {} status {} {}", deferredEvent.getProcessInstance().getId(), deferredEvent.getId(), deferredEvent.getEventType() ,deferredEvent.getComment() );
  				deferredEvent.setEventType(EventType.DONE);
  				return deferredEvent;
  			}
  		}
  		log.debug("failed to find deferred event processId {} {} taskId {}", processInstance.getId(), task.getProcessDefinitionName(), task.getTaskId());
  		return null;
  	}
docs: /* (non-Javadoc)
  @see nz.co.senanque.workflow.WorkflowDAO#removeDeferredEvent(nz.co.senanque.workflow.instances.ProcessInstance, nz.co.senanque.process.instances.TaskBase)