AnsweredAssumed Answered

How to set the application context and classloader for a process engine

Question asked by alexd1 on Jan 14, 2014
Latest reply on Jan 15, 2014 by alexd1
Hi,

I am having an issue creating a process engine that can both see all of its classes and my beans in my application context. I noticed that the Spring process engine configuration is application context aware, but it doesn't have a way for me to set the class loader. On the other side, the org.activiti.engine.ProcessEngineConfiguration has a way for me to set the class loader, but no method I can find to set the application context for it to be able to see its delegate beans.

I have a reference to the classloader and the application context. I just have no idea how to set both.


Here's how I am creating the engine in java.
ProcessEngines.init();
ProcessEngine processEngine = ProcessEngineConfiguration
   .createStandaloneProcessEngineConfiguration()
   .setDataSource(dataSource)
   .setDatabaseSchemaUpdate("true")
   .setJobExecutorActivate(false)
   .setClassLoader(applicationContext.getClassLoader())
   .setTransactionsExternallyManaged(true)
   .buildProcessEngine();
ProcessEngines.registerProcessEngine(processEngine);

Outcomes