doboss [
https://community.jboss.org/people/doboss] created the discussion
"Re: Help using persistence with JBPM 5.4"
To view the discussion, visit:
https://community.jboss.org/message/787148#787148
--------------------------------------------------------------
Okay, I got it working by changing the code like this:
@PersistenceUnit(unitName = "org.jbpm.persistence.jpa")
private EntityManagerFactory emf;
public void runIt()
{
try
{
if (kbase == null)
{
// load up the knowledge base
kbase = readKnowledgeBase();
}
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
// create a new knowledge session that uses JPA to store the runtime
// state
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
int sessionId = ksession.getId();
JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);
If anyone wants more details, I would be happy to provide them.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/787148#787148]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]