[jboss-user] [JBoss jBPM] - Re: Multiple Simultaneous Task Instances of the Same Task

dleerob do-not-reply at jboss.com
Fri Mar 7 03:45:40 EST 2008


Thank you. It tried it out, and it works perfectly.

In my action class:

  |   TaskMgmtDefinition tmd = 
  | (TaskMgmtDefinition)  executionContext.getDefinition(TaskMgmtDefinition.class);
  |   Task task = tmd.getTask("Principal Approval");
  |   TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance();
  |   String[] approvers = new String["actor1","actor2"]; //get desired actors here
  |   for (int x = 0; x < approvers.length; x++) {
  |     TaskInstance taskInstance = tmi.createTaskInstance(task, executionContext.getToken());
  |     taskInstance.setActorId(approvers[x]);
  |   }
  | 

Just remember, in your processdefinition.xml, the <task-node> must have the following attribute if you don't want to create a task instance automatically.
create-tasks="false"

Hope this helps someone else.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134767#4134767

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134767



More information about the jboss-user mailing list