-
1. Re: How to get the current node-type?
camunda Feb 24, 2006 6:15 AM (in response to david.trattnig)Hi David,
why do you not use the standard jbpm way?<task-node name="MyTask"> <task swimlane="Group"/> <transition name="RETRY" to="A"></transition> <transition name="DONE" to="B"></transition> </task-node>
Then a TaskInstance is automatically created for you by jbpm!
By the way: You can get the Node-Type by the jbpm API, just look which type (Class) the Node has... -
2. Re: How to get the current node-type?
david.trattnig Feb 24, 2006 6:43 AM (in response to david.trattnig)Thanks a lot for your reply.
Yes, i also thought about the way to define the task in the process definition. But then i've the same problem: The task is created automatically, but then I've to assign it to a user at runtime. In other words: Not later than now I need to know at which node the Process Instance is - If task node --> assign the task.. with your mentioned "class lookup".
anyway, is there a better way?
thx again.
david -
3. Re: How to get the current node-type?
aguizar Feb 25, 2006 3:43 PM (in response to david.trattnig)The way Bernd proposes is the right one. You can use an assignment handler which jBPM will invoke at runtime so that you can assign your task to suit your needs.
The jBPM user guide, section 11.3, Assignment describes the jBPM task assingment model in detail. Please take a look at it and let us know if it fulfills your needs. -
4. Re: How to get the current node-type?
david.trattnig Feb 27, 2006 3:45 AM (in response to david.trattnig)I've got a dialog where the user chooses if he/she wants to create a pooled task or a task for a specific user of the predefined group.
When the user submits, I perform the "signal()", the task node will be enterd and the assignment handler will be called. Right? But where I get the previously defined User-Assignment-Data from (In the Assignment Handler)? -
5. Re: How to get the current node-type?
david.trattnig Mar 6, 2006 7:39 AM (in response to david.trattnig)Is there nobody who assigned a task to a user/group by user's choice? I mean the assignment should not be done automatically by the AssignmentHandler.
@alex.guizar: This issue isn't captured by the Assignment-Section of the user guide isn't it? -
6. Re: How to get the current node-type?
koen.aers Mar 7, 2006 5:06 AM (in response to david.trattnig)David,
In this case, you should set the createTasks attribute of the task node to false and create and assign the tasks in an actionHandler you associate with the node-enter event of the task node.
The actionHandler has access to all the variables of the processinstance through the execution context. So you can store the user's choice in a variable and retrieve it in the actionHandler to perform the task creation and assignment.
Regards,
Koen -
7. Re: How to get the current node-type?
david.trattnig Mar 22, 2006 2:04 AM (in response to david.trattnig)Thank you Koen,
you helped a lot.
Regards,
david -
8. Re: How to get the current node-type?
david.trattnig Mar 30, 2006 9:34 AM (in response to david.trattnig)Look here: http://jboss.org/index.html?module=bb&op=viewtopic&p=3933716#3933716
...If you also want to create & assign a TaskInstance in an Action-Handler --> there are several problems with this issue!
Cheers,
david