code: @Transactional
  	public ProcessInstance findProcessInstance(Long id) {
  		log.debug("findProcessInstance {}",id);
  		ProcessInstance ret = null;
  		try {
  			ret = m_entityManager.find(ProcessInstance.class, id, LockModeType.PESSIMISTIC_WRITE);
  			if (ret == null) {
  				throw new WorkflowException("Could not find process instance id="+id);
  			}
  			ret.getAudits().size();
  		} catch (Exception e) {
  			e.printStackTrace();
  			throw e;
  		}
  		return ret;
  	}
docs: /* (non-Javadoc)
  @see nz.co.senanque.workflow.WorkflowDAO#findProcessInstance(java.lang.Long)