-
1. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
gardellajp Jun 28, 2012 11:30 AM (in response to pgoncalves)I did this in a project:
StatefulKnowledgeSession session = JPAKnowledgeService.newStatefulKnowledgeSession(gewKnowledgeBase(), null, getEnvoriment()); TaskServiceSession taskServiceSession = taskService.createSession();
taskServiceSession.setTransactionType(Constants.TRANSACTION_TYPE);
org.jbpm.task.TaskService client = new LocalTaskService(taskServiceSession);
SyncWSHumanTaskHandler handler = new SyncWSHumanTaskHandler(client, session);
handler.setLocal(true);
handler.connect();
session.getWorkItemManager().registerWorkItemHandler("Human Task", handler);
I did a library that modularize this, to handle close resources etc.
Hope it helps.
-
2. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
pgoncalves Jun 28, 2012 11:33 AM (in response to gardellajp)Thanks, but SyncWSHumanTaskHandler is what I want to replace
-
3. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
swiderski.maciej Jun 28, 2012 12:45 PM (in response to pgoncalves)Try using this as you client:
new LocalTaskService(taskService)
obviously you need to create your taskService prior to that. and I believe that you should use LocalHTWorkItemHandler for local task service cases.
HTH
-
4. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
pgoncalves Jun 28, 2012 1:31 PM (in response to swiderski.maciej)Sorry, my bad! I didn't mentioned that the local task service was previously created...
1. In the docs (13.2.2) says that "If you are using persistence, you should use CommandBasedWSHumanTaskHandler"
As I did not find the CommandBasedWSHumanTaskHandler, I thought that GenericCommandBasedWSHumanTaskHandler was the replacement
The GenericCommandBasedWSHumanTaskHandler accepts a TaskClient as a client (TaskClient implements AsyncTaskService) but the LocalTaskService implements TaskService. So it does not match
2. If I understand you, I should not use the GenericCommandBasedWSHumanTaskHandler but LocalHTWorkItemHandler instead?
I've got the LocalHTWorkItemHandler from the github, and I realize that I also need to reimplement the GenericHTWorkItemHandler. But GenericHTWorkItemHandler has 2 errors and I realize that I would have to reimplement the ContentMarshallerHelper and TaskService, should I do this? Or should I use the jbpm-human-task-core 5.4 Snapshot?
Thanks
-
5. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
swiderski.maciej Jun 28, 2012 6:05 PM (in response to pgoncalves)Alright, my bad too gave you details about master stuff. But it looks like you are on 5.3 Final level which is good as that should be more stable (at least in long run). So in that case look at GenericHTWorkItemHandler and put LocalTaskService as client and make sure you set local on that handler as well.
Regarding command based handler, that is correct it should be used with persistence and remote transports to human task server. As you intend to use local task service you will have it done as part of the engine transaction. Documentation was not updated yet to guide how to use these new handlers hopefully will be done soon.
HTH
-
6. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
pgoncalves Jun 29, 2012 5:56 AM (in response to swiderski.maciej)Thanks Maciej
In the meanwhile (before your previous post) I was using the human-task-core.5.4-Snapshot and the jbpm-flow.5.4-snapshot, both from yesterday build... and it was working with the LocalHTWorkItemHandler. But I don't think it's a good ideia to use some parts of 5.4-snapshot and others from 5.3-final.... so I reverted everything to 5.3-final and used the GenericHTWorkItemHandler. It works.
That's what I do:
.... LocalTaskService localTaskClient = new LocalTaskService(taskService); GenericHTWorkItemHandler handler = new GenericHTWorkItemHandler(kSession); handler.setClient(localTaskClient); handler.setLocal(true); handler.setIpAddress("127.0.0.1"); handler.setPort(9123); kSession.getWorkItemManager().registerWorkItemHandler("Human Task", handler); handler.connect(); ....
-
7. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
arselv Jul 6, 2012 6:50 AM (in response to pgoncalves)Pedro: In this scenario how u are connecting the taskclient to the taskserver.? and operating the tasks start/complete functionality.?
I hope that u are using Mina as the taskserver. If possible kindly share the code snippet for taskclient connectivity.
-
8. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
pgoncalves Jul 6, 2012 7:26 AM (in response to arselv)Hi Arun
I'm not using mina, I'm using everything local with spring integration.
And I use the start/complete of the localTaskService.
But I'm having some problems with complete functionality because I'm still don't know how to manage the kSession in spring...!
Still, if you think that I will have some code snippet that may help you, just ask
-
9. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
arselv Jul 6, 2012 8:12 AM (in response to pgoncalves)Thanks for your clarification.
Im looking for client connectivity in case of external task service HornetQ/Mina.
But in your implementation which service are u using as your taskserver.
-
10. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
salaboy21 Jul 6, 2012 8:16 AM (in response to arselv)I'm not sure to understand what's the main topic / problem here?
The question is already marked as answered, so if there is another problem we should create a separate thread and be focused on the thread title..
Cheers
-
11. Re: jbpm 5.3 - GenericCommandBasedWSHumanTaskHandler and LocalTaskService, how to use it?
arselv Jul 6, 2012 8:35 AM (in response to salaboy21)Mauricio: I just needed clarification.I thought in case of localtak service we dont need a taskserver but in code snippet ipaddress,port has been configured.
Im working with hornetq and thought some example would work for me.( https://community.jboss.org/message/745805#745805 )