Thank your for your quick reply,
I'm using only the jboss transaction manager, it works fine for me now, I
can create the session but I have now another bug, it appear when I start
the workFlow
ksession.startProcess( "com.sample.ruleflow" );
Here is my stacktrace
java.lang.NullPointerException
at
org.drools.persistence.processinstance.JPAProcessInstanceManager.addProcessInstance(JPAProcessInstanceManager.java:33)
at
org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1620)
at
org.drools.process.command.StartProcessCommand.execute(StartProcessCommand.java:46)
at
org.drools.process.command.StartProcessCommand.execute(StartProcessCommand.java:10)
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:229)
at
org.drools.process.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:163)
at
org.drools.process.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:154)
at com.sample.ProcessTest.main(ProcessTest.java:64)
java.lang.RuntimeException: Could not rollback transaction
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:258)
at
org.drools.process.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:163)
at
org.drools.process.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:154)
at com.sample.ProcessTest.main(ProcessTest.java:64)
Caused by: java.lang.RuntimeException: Could not execute command
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:255)
... 3 more
Caused by: java.lang.NullPointerException
at
org.drools.persistence.processinstance.JPAProcessInstanceManager.addProcessInstance(JPAProcessInstanceManager.java:33)
at
org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1620)
at
org.drools.process.command.StartProcessCommand.execute(StartProcessCommand.java:46)
at
org.drools.process.command.StartProcessCommand.execute(StartProcessCommand.java:10)
at
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:229)
... 3 more
I think It happen because I did not define a transaction manager in my code
env.set(EnvironmentName.TRANSACTION_MANAGER, XXXX);
I don't know what can I put in instead EnvironmentName.TRANSACTION_MANAGER
of XXXX. Do you have any idea ?
EntityManagerFactory emf = Persistence.createEntityManagerFactory(
"org.drools.persistence.jpa" );
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
//env.set(EnvironmentName.TRANSACTION_MANAGER, XXXX);
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
ksession.startProcess( "com.sample.ruleflow" );
ksession.fireAllRules();
ksession.dispose();
Thank you very much
Regards
--
View this message in context:
http://drools.46999.n3.nabble.com/Drools-Human-Task-Service-Persistence-t...
Sent from the Drools: User forum mailing list archive at
Nabble.com.