code: @Override
      public List<ProcessInstance> getProcessInstances(String masterRequestId, String processName)
      throws ProcessException, DataAccessException {
          TransactionWrapper transaction = null;
          EngineDataAccessDB edao = new EngineDataAccessDB();
          try {
              Process procdef = ProcessCache.getProcess(processName, 0);
              if (procdef==null) return null;
              transaction = edao.startTransaction();
              return edao.getProcessInstancesByMasterRequestId(masterRequestId, procdef.getId());
          } catch (SQLException e) {
              throw new ProcessException(0, "Failed to remove event waits", e);
          } finally {
              edao.stopTransaction(transaction);
          }
      }
docs: Returns the process instances by process name and master request ID.
  
  @param processName
  @param masterRequestId
  @return the list of process instances. If the process definition is not found, null
  is returned; if process definition is found but no process instances are found,
  an empty list is returned.
  @throws ProcessException
  @throws DataAccessException