[jboss-user] [jBPM] - jbpm 5.2 to jbpm 5.3
Alberto Prieto
do-not-reply at jboss.com
Fri Oct 19 05:51:06 EDT 2012
Alberto Prieto [https://community.jboss.org/people/albertopl19] created the discussion
"jbpm 5.2 to jbpm 5.3"
To view the discussion, visit: https://community.jboss.org/message/767007#767007
--------------------------------------------------------------
Hi,
I'm trying to migrate my app to jbpm 5.3 with spring. First my files:
Beans:
<jee:jndi-lookup id="JbpmDataSource" jndi-name="${jdbc.datasource.name}" />
JbpmTaskServiceImpl.java
@PersistenceUnit
private EntityManagerFactory emf;
@Autowired
private KnowledgeBase kbase;
@Autowired
private TaskSessionSpringFactoryImpl taskSessionFactory;
private TaskServiceSession taskServiceSession;
@PostConstruct
private void initTaskServiceSession() {
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager());
env.set(EnvironmentName.TRANSACTION_SYNCHRONIZATION_REGISTRY,
TransactionManagerServices
.getTransactionSynchronizationRegistry());
env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());
env.set(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
new ObjectMarshallingStrategy[] {
new JPAPlaceholderResolverStrategy(env),
new SerializablePlaceholderResolverStrategy(
ClassObjectMarshallingStrategyAcceptor.DEFAULT) });
this.taskServiceSession = this.taskSessionFactory
.createTaskServiceSession();
// this.taskServiceSession = taskService.createSession();
StatefulKnowledgeSession ksession = JPAKnowledgeService
.newStatefulKnowledgeSession(kbase, null, env);
CustomSyncWSHumanTaskHandler humanTaskHandler = new CustomSyncWSHumanTaskHandler(
this, ksession);
humanTaskHandler.setLocal(true);
humanTaskHandler.connect();
ksession.getWorkItemManager().registerWorkItemHandler("Web Flow Task",
humanTaskHandler);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task",
humanTaskHandler);
CustomWebServiceTaskHandler serviceHandler = new CustomWebServiceTaskHandler(
ksession);
ksession.getWorkItemManager().registerWorkItemHandler(
"Web Service Task", serviceHandler);
new JPAWorkingMemoryDbLogger(ksession);
}
When I try to start my server, I get javax.persistence.TransactionRequiredException: No local transaction to join. And when I debug, the ksession have a null WorkItemManager... don't know why.
Thanks for your help.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/767007#767007]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121019/a8364ecc/attachment-0001.html
More information about the jboss-user
mailing list