3 Replies Latest reply on Sep 15, 2008 9:27 AM by Ronald van Kuijk

    Swimlane assignment - h e l p  m e !

    rrrrr rrrr Newbie

      Hi all jbom users,
      I'm developing a trouble ticketing interface with jBpm.
      I have 2 swimlanes: the manager and the developer. I would need to assign the actorId of each task depending on the value of a Context variable.

      I have saved in the context variable "manager" and "developer" the person who are in charge to supervision and develop the ticket.

      <swimlane name="manager" >
       <assignment actor-id="#{manager}">
       </swimlane>
      
       <swimlane name="developer" />
       <assignment actor-id="#{developer}">
       </swimlane>
      
       <task-node name="AssignTicket">
      
       <task name="TicketAssignment" " swimlane="developer">
       </task>
       .........
       </task-node>
      
       <task-node name="TicketResolved">
      
       <task name="Ticketsolved" swimlane="manager">
       </task>
       .........
       </task-node>



      Unfortunately I get "null" when I recall taskInstance.getActorId()
      so assignment doesn't work this way......
      any help ?
      thanks
      john


        • 1. Re: Swimlane assignment - h e l p  m e !
          Ronald van Kuijk Master

          this currently is not supported this way (although it would be a nice addition)

          Write your own assignmenthandler for this. It can be a very simple one (see e.g. the testcases in the source of jBPM or search on the web for examples

          • 2. Re: Swimlane assignment - h e l p  m e !
            rrrrr rrrr Newbie

            Hello,
            thanks for your reply (sorry for taking long to reply too).
            Well at the moment I have applied an AssignmentHandler, the matter is that inside the AssignmentHandler I have to check on which node I am.

            if (node.equals("AssignTicket"))
            actorId= getDeveloperName(ctx);
            
            if (node.equals("TicketResolved"))
            actorId= getManagerName(ctx);


            That's quite ugly, I have tried using a barebones SwimLane just to tell the Task which kind of user is in the task........

            <swimlane name="manager" />
            <swimlane name="developer" />
            
             <task-node name="AssignTicket">
             <task name="TicketAssignment" " swimlane="developer">
             <assignment class="assignment.AssignTask" />
            </task>
             .........
             </task-node>
            
             <task-node name="TicketResolved">
            
             <task name="Ticketsolved" swimlane="manager">
             <assignment class="assignment.AssignTask" />
             </task>
             .........
             </task-node>


            But using swimlane="xxx" then the assignment class is not called anymore!

            Is there a way when AssignTask is fired to know the swimlane ?
            (if the task belongs to the developer group or to the manager group)

            I hope I have been clear........
            thanks a lot
            john

            • 3. Re: Swimlane assignment - h e l p  m e !
              Ronald van Kuijk Master

              two roles, use two assignmenthandlers, nothing to 'decide' then in the actionhandler