Discussion:
[jboss-user] [jBPM] - Dynamic task assignment
roxy1987
2013-01-15 21:59:40 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Dynamic task assignment"

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

--------------------------------------------------------------
Hi,

I am in a scenario where I need to dynamically assign task to actors. But I dont wanna use expressions and variables. I believe there is no Assignment Handler in jbpm 5 unlike jbpm 4. So what I have in mind is to leave the actor ID parameter blank and while starting the process I can search my custom tables and match task names to get the appropriate actors and then may be map the tasks with the actors using jbpm API. Is there a possibility for such a design? I get the ProcessInstance object while starting a process. So I can use the process instance id for creating such a mapping. But I am not getting how to use the PI object.

Or may be some one could suggest a better way of achieving this.

Thanks.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792128#792128]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Demian Calcaprina
2013-01-15 22:13:43 UTC
Permalink
Demian Calcaprina [https://community.jboss.org/people/calca] created the discussion

"Re: Dynamic task assignment"

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

--------------------------------------------------------------
I think you can create your own WorkItemHandler for the Human Task node. The current implemenation gets the "actorId" and "groupId" variables, but you could write your implementation.

In fact this handler:
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/process/workitem/wsht/AbstractHTWorkItemHandler.java https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-core/src/main/java/org/jbpm/process/workitem/wsht/AbstractHTWorkItemHandler.java

could have injected the peopleAssignmentHelper, to be able to use different strategies.


Hope this helps,

Demian
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792132#792132]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
roxy1987
2013-01-15 22:21:49 UTC
Permalink
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion

"Re: Dynamic task assignment"

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

--------------------------------------------------------------
Hey,
Thanks.
So there in fact is a Handler which can help me achieve what I am looking for. I actually read salaboy's post somewhere that there is no assignment handler in jbpm 5.
Well I cant access the link you posted from my office but will definitely look at it once I am home.

WorkItemHandler is providing me 2 methods. abortWorkItem and executeWorkItem. So what you are saying is using WorkItem and WorkItemManager arguments, I will be able to get my job done?

Regards.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792135#792135]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...