4 Replies Latest reply on Apr 23, 2008 4:29 PM by Ronald van Kuijk

    Very Simple Swimlane......help!

    Frank Newbie

      Hi all Jbpm users,
      I have a simple process with 2 Task. Every Task has the same assignment class (assignment.AssignTask) which needs to know what kind of user is in charge to execute the Task.

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="Gap">
       <swimlane name="buyer" />
       <swimlane name="seller" />
      
      
      <start-state name="start">
       <transition to="buyItems"></transition>
      </start-state>
      
      <task-node name="buyItems">
      
       <task name="TaskBuyItems" swimlane="buyer">
       <assignment class="assignment.AssignTask" />
       </task>
       <transition to="sellItems"></transition>
      </task-node>
      
      <task-node name="sellItems">
      
       <task name="TaskSellItems" swimlane="seller">
       <assignment class="assignment.AssignTask" />
       </task>
       <transition to="end"></transition>
      </task-node>


      As you can see the swimlane is just a flag....inside the AssignTask class I look for buyers and sellers list....

      The problem is that I cannot read the value of the Swimlane inside the assignment.AssignTask class...

      public void assign(Assignable arg, ExecutionContext arg1) throws Exception {
      
       SwimlaneInstance swim = arg1.getTaskInstance().getSwimlaneInstance(); // RETURNS NULL
      
       String actorId = arg1.getTaskInstance().
       getActorId(); // ALSO THIS RETURNS NULL
       }


      Do I need to set up users/groups on the database in order to use swimlanes ? In this case the users/groups check-up has been already done by the web application, so I only need somehow to read the swimlane in the Task Assignment class....

      Any help ?
      Thanks