I thnik, the simplest way is to define individual assigned tasks into the Task Node.
The Task Node will leave after all task are attended.
Thanks for replying. But i dont have control over how many users can be assigned for finishing the task and hence need to do this dynamically. Can you please tell me how we can do this programatically
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();
TaskInstance ti = taskMgtInstance.createTaskInstance(myTask, executionContext().getToken());
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">
<action class="my,paq.CreateTaskActionHandler" name="CreateTaskActionHandler"></action>
<task name="My Unassigned Task">
Works like a charm..Thanks Alejandro