-
1. Understanding Human Task call
salaboy21 Jan 17, 2011 11:19 AM (in response to odelyaholiday)Hi there,
In order to work with Human Tasks/ User Tasks you need to register a WorkItemHandler that knows what to do when a User task is reached in your processes. You can do that with:
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new ServiceTaskHandler());
Of course you also need to start up the Task Service Server.
Greetings.
-
2. Understanding Human Task call
odelyaholiday Jan 17, 2011 11:38 AM (in response to salaboy21)Is Human Task a reserved word? why shouldn't it start automatically when the workflow reached HumaTask element?
As well, when I want to mention that I complete the task - how do I do it?
I found that there are start and complete for human task . When shall I use them?
-
3. Understanding Human Task call
salaboy21 Jan 17, 2011 11:54 AM (in response to odelyaholiday)Hmm.. you sound confused..
When you model a BPMN2 process with an User Task, the xml generated creates a tag with an attribute containing the "Human Task" id. This id is used to bind a service that will be in charge of handling the life cycle of a human task (with the line of code that I pasted before). The reason why you need to start the TaskServer by hand is because it's an independant service that you can change if you want and provide a different implementations that suits your needs.
You last sentence ("I found that there are start and complete for human task . When shall I use them?") mention the TaskClient that is in charge of interacting with human tasks that are already created by your process in the Task Server. Using the client you can Start a task (meaning that you will start working on the task) and complete a task (meaning that you end the task).
The interaction between these components can be is described in the following image:
Try reading the following chapter of the Drools Flow documentation for more information:
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-flow/html/ch.Human_Tasks.html
Greetings.
-
4. Understanding Human Task call
odelyaholiday Jan 17, 2011 12:02 PM (in response to salaboy21)Thanks
So I understand that HumanTask has to be the id of that human task in the BPMN file? Since I couldn't find this name in Emergency BPMN diagram, while the EmergencyService has
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new CommandBasedWSHumanTaskHandler(ksession));
-
5. Understanding Human Task call
salaboy21 Jan 17, 2011 12:18 PM (in response to odelyaholiday)You can register different types of HumanTaskHandlers. In the emergency application I've used the CommandBasedWSHumanTaskHandler because it gives you some extra features for different environments. You are true, in my application it didn't have the "Human Task" string in my BPMN file, but that's because I was using an old schema where you need it.
Right now you need to register the "Human Task" workitemHandler with one of the TaskHandlers implementation in order to work.
Sorry for the confusion.
-
-
7. Understanding Human Task call
salaboy21 Jan 17, 2011 1:16 PM (in response to odelyaholiday)If you are using the SNAPSHOT you don't need to worry about it. The exception that you get:
"org.drools.WorkItemHandlerNotFoundException: Could not find work item handler for Human Task"
Can be solved just registering the "Human Task" WorkItem Handler
Did you do something like:
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new CommandBasedWSHumanTaskHandler(ksession));?
What is the error now?
-
8. Understanding Human Task call
odelyaholiday Jan 17, 2011 1:49 PM (in response to salaboy21)I changed it to ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new CommandBasedWSHumanTaskHandler(ksession));
and now it works!! thanks !
-
9. Understanding Human Task call
salaboy21 Jan 17, 2011 1:53 PM (in response to odelyaholiday)Great! keep us posted if you have troubles!