public static ProcessEngine lookupProcessEngine(String engineName) {

    ServiceLoader<ProcessEngineProvider> serviceLoader = ServiceLoader.load(ProcessEngineProvider.class);
    Iterator<ProcessEngineProvider> iterator = serviceLoader.iterator();

    if(iterator.hasNext()) {
      ProcessEngineProvider provider = iterator.next();
      if (engineName == null) {
        return provider.getDefaultProcessEngine();
      } else {
        return provider.getProcessEngine(engineName);
      }
    } else {
      throw new RestException(Status.INTERNAL_SERVER_ERROR, "Could not find an implementation of the "+ProcessEngineProvider.class+"- SPI");
    }
  }
public static ProcessEngine lookupProcessEngine ( String engineName ) { ServiceLoader < ProcessEngineProvider > serviceLoader = ServiceLoader . load ( ProcessEngineProvider . class ) ; Iterator < ProcessEngineProvider > iterator = serviceLoader . iterator ( ) ; if ( iterator . hasNext ( ) ) { ProcessEngineProvider provider = iterator . next ( ) ; if ( engineName == null ) { return provider . getDefaultProcessEngine ( ) ; } else { return provider . getProcessEngine ( engineName ) ; } } else { throw new RestException ( Status . INTERNAL_SERVER_ERROR , "Could not find an implementation of the " + ProcessEngineProvider . class + "- SPI" ) ; } }
Look up the process engine from the {@link ProcessEngineProvider}. If engineName is null, the default engine is returned.
@param engineName
@return