ApplicationContext applicationContext = new GenericXmlApplicationContext(new UrlResource(resource));
Map<String, ProcessEngine> beansOfType = applicationContext.getBeansOfType(ProcessEngine.class);
if ( (beansOfType==null)
|| (beansOfType.isEmpty())
) {
throw new ProcessEngineException("no "+ProcessEngine.class.getName()+" defined in the application context "+resource.toString());
}
ProcessEngine processEngine = beansOfType.values().iterator().next();
log.fine("==== SPRING PROCESS ENGINE CREATED ==================================================================");