JBoss Community

Re: In memory TaskClient without Mina or JMS

created by Kris Verlaenen in jBPM - View the full discussion

I see where you're going with this.  I assume you want to avoid using a loose coupling between the process engine and the human task service, but rather embed the service so you can call it directly?   I don't see any problem with this basically, what about just registering your own LocalWSHumanTaskHandler that doesn't use a local client but simply starts a server instance locally and instead of calling methods on the client calling the corresponding message on the server directly.

 

You could create a task session in your handler and cache this:

 

        EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");

        TaskService taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());

        TaskServiceSession taskSession = taskService.createSession();

 

And then modify WSHumanTaskHandler to call the taskSession instead of the taskClient whenever appropriate.

 

I can see how this would be useful for other people as well, so if this actually works, let me know and I'll add it to the codebase ;)   Or if my explanation doesn't make sense, let me know and I'll try to help.

 

Kris

Reply to this message by going to Community

Start a new discussion in jBPM at Community