[jboss-user] [jBPM] - problem with JPAKnowledgeService and LocalTaskService

Ted Pan do-not-reply at jboss.com
Thu Nov 1 16:06:02 EDT 2012


Ted Pan [https://community.jboss.org/people/ted.pan] created the discussion

"problem with JPAKnowledgeService and LocalTaskService"

To view the discussion, visit: https://community.jboss.org/message/773504#773504

--------------------------------------------------------------
hi,

When I use JPAKnowledgeService and LocalTaskService, the process won't continue when complete the 2nd Human Task. 


the following is the code fragment




|  | Environment env = KnowledgeBaseFactory.newEnvironment(); |
|  | env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa")); |
|  | env.set( EnvironmentName.TRANSACTION_MANAGER,TransactionManagerServices.getTransactionManager()); |
|  |  |  |  |
|  | Properties properties = new Properties(); |
|  | properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory"); |
|  | properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory"); |
|  | KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties); |
|  | KnowledgeBase kbase = readKnowledgeBase();  -- read knowledgebase |
|  |  |
|  | ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); |
|  |  |
|  | EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task"); |
|  | org.jbpm.task.service.TaskService taskService = new org.jbpm.task.service.TaskService(emf, SystemEventListenerFactory.getSystemEventListener()); |
|  |  |
|  | LocalTaskService localTaskService = new LocalTaskService(taskService); |
|  | LocalHTWorkItemHandler localHTWorkItemHandler = new LocalHTWorkItemHandler(localTaskService,ksession, OnErrorAction.RETHROW); |
|  | localHTWorkItemHandler.setLocal(true); |
|  | localHTWorkItemHandler.connect(); |
|  | ksession.getWorkItemManager().registerWorkItemHandler("Human Task", localHTWorkItemHandler); |
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/773504#773504]

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/20121101/0a202d85/attachment.html 


More information about the jboss-user mailing list