JBoss Community

Obtain a handle to ExecutionImpl from unit tests

created by Al Nadein in jBPM - View the full discussion

Hi,

 

I need to be able to switch between in-memory and physical databases. In order to do so, I have two cfg files: jbpm.cfg.xml and jbpm.test.cfg.xml and depending on the database, use

 

Configuration.getProcessEngine() 


or

 

new Configuration().setResource("jbpm.test.cfg.xml").buildProcessEngine()

 

After that, I'd like to obtain the corresponding ProcessEngine from anywhere in my code including the unit tests. EnvironmentImpl.getFromCurrent(ProcessEngine.class) fails with something along the lines of "environment is not set".

 

Any help will be greatly appreciated.

Reply to this message by going to Community

Start a new discussion in jBPM at Community