[jboss-user] [jBPM] - Re: Asynchronous service tasks and transactions

Rahul Agrawal do-not-reply at jboss.com
Fri Aug 24 08:05:10 EDT 2012

Rahul Agrawal [https://community.jboss.org/people/rahulamt] created the discussion

"Re: Asynchronous service tasks and transactions"

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


I doing it the same way but not directly. I am not registering my handler with kession. But the completeWorkItem(workItemId, result) i am calling on the same session. The call to this method is not inside the handler but inside an ejb that is called from the new thread that i am calling.

My workItemHandler is as follows:

public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {

                    final String operation = (String) workItem.getParameter("Operation");

                    final WorkItem internalWorkItem = workItem;
                    final WorkItemManager internalWorkItemManager = manager;

                    new Thread(new Runnable() 
                                   public void run() 

               Map<String, Object> inParams = internalWorkItem.getParameters();


                                                                                     results = EJBCallLookUP.call(operation, inputParams);
           catch(Exception e)


in the EJBCallLookUP.call I am looking up the ejb for the operation and calling the method with operation name. Inside that operation i am calling the completeWorkItem(...) with the session.

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120824/2c88e230/attachment-0001.html 

More information about the jboss-user mailing list