ClassLoader peCL = JenkowEngine.class.getClassLoader();
ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(peCL);
// set common cfg here.
ProcessEngineConfigurationImpl peCfg = (ProcessEngineConfigurationImpl)cfg;
peCfg.setIdentityService(new IdentityServiceImpl());
peCfg.setBeans(ctxBeans);
List<BpmnParseListener> preParseListeners = peCfg.getPreParseListeners();
if (preParseListeners == null){
preParseListeners = new ArrayList<BpmnParseListener>();
peCfg.setPreParseListeners(preParseListeners);