try {
Class<?> jpaPersistenceCtxMngrClass = Class.forName( "org.jbpm.persistence.JpaProcessPersistenceContextManager" );
Constructor<?> jpaPersistenceCtxMngrCtor = jpaPersistenceCtxMngrClass.getConstructors()[0];
this.jpm = ( PersistenceContextManager) jpaPersistenceCtxMngrCtor.newInstance( new Object[] { this.env } );
} catch ( ClassNotFoundException e ) {
this.jpm = new JpaPersistenceContextManager(this.env);
} catch ( Exception e ) {
throw new RuntimeException("Error creating JpaProcessPersistenceContextManager", e);
}
}
env.set( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER, this.jpm );