4 Replies Latest reply on Nov 20, 2008 10:33 AM by Ronald van Kuijk

    ActorID and swimlane for a Task instance

    azeemullah mohammed Newbie

      Hi ,
      In my application i need to insert both Actor id as well as swimlane for a taskinstance whenever it is created.Because the logged in user views his tasks in myworkitem page and in group workitem he will be viewing the group workitem tasks. So for Myworkitem i will retrive based on ActorId and for group workitem i will retrive based on swimlane instance.

      My JPDL :Contains
      ----------------------

      For swimlane i have given swimlane Tag as
      --------------------------------------------------


      <assignment pooled-actors="AD,GSM,RVP,DVP,CDM"/>



      For the actorId setting i have used .. Event tag with task-create attribute. where i am doing the following code


      My Sample Task Node in my JPDL
      ---------------------------------------
      <task-node name="RateCard AD Approval">






      </task-node>



      public class MyHandlerClass implements ActionHandler
      {
      private static final long serialVersionUID = 1L;

      public void execute(ExecutionContext poExecutionContext) throws Exception {
      System.out.println("Assigning the Task to the User");
      JbpmContext jbpmContext = poExecutionContext.getJbpmContext();
      long taskId = poExecutionContext.getTaskInstance().getId();
      System.out.println("Task Instance ID IS ::::::::: "+taskId);
      TaskInstance taskInstance = jbpmContext.getTaskInstance(taskId);
      taskInstance.setActorId("AD");
      jbpmContext.save(taskInstance);
      System.out.println("Task Instance ACTOR ID::::::::: "+poExecutionContext.getTaskInstance().getActorId());
      System.out.println("Assigning Done");
      }
      }




      The Problem is when i remove the swimlane from Process Defintion it sets the Actor id in taskInstance table. but when i try with swimlane it either sets the actor iD but removes the swimlaneInstance .

      WHY do we not have provision to set both while task instantiated...

      Kindly reply as soon as possible.