[jboss-user] [jBPM] - Scope of the LocalTaskService

wqe wqe do-not-reply at jboss.com
Thu Oct 4 05:42:31 EDT 2012


wqe wqe [https://community.jboss.org/people/drupalspring] created the discussion

"Scope of the LocalTaskService"

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

--------------------------------------------------------------
According to this  https://community.jboss.org/thread/205868 thread ,since  the  session will keep the state likes facts or timer ,   I use "one process instance per session"  +architecture+ in which each process instance is created and manutiplated  by their own dedicate session.

For the human task , I use the LocalTaskService which is defined as singleton Spring bean.   So , after creating the session from an application scoped Knowledge base , I registered the work item handler using the following code .

StatefulKnowledgeSession session = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
TaskService localTaskService =  (TaskService)springContext.getBean("localTaskService"); 
LocalHTWorkItemHandler humanTaskHandler = new LocalHTWorkItemHandler(localTaskService, session);
session.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);


All the session use the same localTaskService instance to call the related API to do the human task operations . Is it okay or should I create the localTaskService for each session ?  I ask because it seems that calling the method  of localTaskService instance will somehow invoke the method on StatefulKnowledgeSession instance .
--------------------------------------------------------------

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

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/20121004/07915fa2/attachment.html 


More information about the jboss-user mailing list