0 Replies Latest reply on Oct 6, 2008 4:37 AM by adel ahmadyan

    create-task="false" does not wok

    adel ahmadyan Newbie

      I wanted to dynamically create my tasks, hence I put this task-node:

      <task-node create-task="false" name="task-node-1" >

      <assignment class="MyRoleAssignmentHandler" config-type="bean">

      <action class="CreateMultiTask"


      with the following actionHandler:

      public class CreateMultiTask implements ActionHandler {
      public void execute(ExecutionContext executionContext) throws Exception {
      Token token = executionContext.getToken();
      TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance();
      TaskNode taskNode = (TaskNode) executionContext.getNode();

      // Assignee:
      Vector roleInstanceSet = (Vector) tmi.getProcessInstance().getContextInstance().getVariable("__assignee");
      if ( roleInstanceSet == null ) throw new Exception("Role instance set is null . ..");
      // Task
      Task task = taskNode.getTask( tmi.getProcessInstance().getContextInstance().getVariable("__task").toString());
      for( Long ri : roleInstanceSet ){
      TaskInstance ti = tmi.createTaskInstance(task, executionContext);
      ti.setActorId("$RI_" + ri.toString());

      it does as it supposed to do, it creates some task based myActionHandler but also it create one additional task than expected ( the default task for task-node, which is defined in the task tag. ) it seems that create-task="false" does not work.

      any comments or suggestion are welcome.