[jboss-dev-forums] [jBPM Development] - Re: jbpm3 Assign task to multiple actors
Alejandro Velazquez
do-not-reply at jboss.com
Thu May 26 13:51:31 EDT 2011
Alejandro Velazquez [http://community.jboss.org/people/avelazquez] created the discussion
"Re: jbpm3 Assign task to multiple actors"
To view the discussion, visit: http://community.jboss.org/message/607310#607310
--------------------------------------------------------------
OK,
Programatically,you can add an Action to the enter-event in the Task Node.
In the ActionHandler you create the tasks required (individual assigned) via the TaskMgtInstance; something like:
//First, obtain the unassigned task from the node
TaskNode taskNode = (TaskNode) executionContext.getNode();
Task myTask = taskNode.getTask("My Unassigned Task")
//Then, create the required task instances, by using myTask as model.
TaskMgmtInstance taskMgtInstance = executionContext.getTaskMgmtInstance();
for(.....) {
TaskInstance ti = taskMgtInstance.createTaskInstance(myTask, executionContext().getToken());
ti.setName(......);
ti.setActorId(.....);
.....
}
In order to make this works, you have to disable the automatic creation of task instances in the Task Node. By setting the attribute: create-tasks="false". So, the task-node is something like:
<task-node name="task-node1" create-tasks="false">
<event type="node-enter">
<action class="my,paq.CreateTaskActionHandler" name="CreateTaskActionHandler"></action>
</event>
<task name="My Unassigned Task">
......
</task>
</task-node>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/607310#607310]
Start a new discussion in jBPM Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110526/9d6ee597/attachment.html
More information about the jboss-dev-forums
mailing list