User development,
A new message was posted in the thread "JBPM4.3 should be JBPM5.0":
http://community.jboss.org/message/523333#523333
Author : christian garderes
Profile :
http://community.jboss.org/people/chrigar
Message:
--------------------------------------------------------------
Yes i know that the question of jpa/support was evocated then abandoned for the new 4.x
architecture.
I was already disapointed at that time... ;-(
Nonetheless, until 4.3, we were able to inject the underlying hibernate session factory in
jbpm classes
In 3.x we used this kind of adaptator:
public class AdaptedJbpmFactoryBean extends LocalJbpmConfigurationFactoryBean {
@PersistenceContext
private EntityManager em;
public void afterPropertiesSet() throws Exception {
try {
Session session = (Session) em.getDelegate();
setSessionFactory(session.getSessionFactory());
super.afterPropertiesSet();
} catch (Exception e) {}
}
In 4.1-2 we rely on:
/** */
public class SpringJpaConfiguration extends SpringConfiguration {
/** */
@PersistenceContext
private EntityManager em;
/** */
public SpringJpaConfiguration(String jbpmConfigurationLocation)
{super(jbpmConfigurationLocation);}
/** */
public void initSessionFactory(){
setHibernateSessionFactory(((Session) em.getDelegate()).getSessionFactory());
}
the classes are loaded and initialized during ApplicationContext loading
Spring transaction management is used,
JBPM mapping files are loaded with an added xml persistence unit (jpa)
<?
xml version=+"1.0"+ encoding=+"UTF-8"+?><
persistence version=+"1.0"+
xmlns=+"http://java.sun.com/xml/ns/persistence"+
xmlns:xsi=+"http://www.w3.org/2001/XMLSchema-instance"+
xsi:schemaLocation=+"http://java.sun.com/xml/ns/persistence+http://j...
++
++>
<!-- ###################### -->
<!-- # jbpm mapping files # -->
<!-- ###################### -->
<persistence-unit name=+"xxxx"+
transaction-type=+"RESOURCE_LOCAL"+>
<mapping-file>jbpm.execution.hbm.xml</mapping-file>
<mapping-file>jbpm.history.hbm.xml</mapping-file>
<mapping-file>jbpm.repository.hbm.xml</mapping-file>
<mapping-file>jbpm.task.hbm.xml</mapping-file>
<mapping-file>jbpm.identity.hbm.xml</mapping-file>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
</persistence-unit></
persistence>
In 4.3, we can't find a way to do something similar in org.jbpm.api.ProcessEngine
jta should be a solution... but we are not working on a full jee stack,
so we have to make it by hand(?), indeed, if nothing else is found.
--------------------------------------------------------------
To reply to this message visit the message page:
http://community.jboss.org/message/523333#523333