Thursday, July 14, 2011

JBPM Swimlane for Alfresco

Often, a process has the notion of a role in which multiple tasks during the process get assigned to the same  actor playing that role. For example, suppose you are defining a process that contains multiple tasks performed by "marketing". Rather than assign the marketing group or individual repeatedly to each task, it would be nice if you could make the assignment once, and then tell the other tasks to use the same assignment. In jBPM this is implemented through swimlanes. An actor can be assigned to a swimlane, and then all tasks that need to be performed by the same actor refer to the swimlane.

Alfresco creates one swimlane for you automatically called "initiator". The initiator swimlane is a convenient way to assign tasks to whoever started the workflow.



When defining a business process, it is important to understand how the participants in the process will do the work. One specific area that needs to be considered is whether to use pooled actors for a given task. Suppose you assigned a task to a group of ten people. You could iterate through the group and assign a task to each and every member of the group, and then not consider the task complete until all actors have taken action. An alternative is to use pooled actors. Using a pool, all members of a group are notified of the task.
Example: 




   
         #{bpm_assignee}
   


  
   
   

 
 
   
   
   
  
 
 
   
   
     




      When workflow starts we pass "bpm:assignee" properties for task "scwfa:start_registration" and go to "nextStep". (When workflow starts swimline initiator gets nodeRef of user who Started Workflow)
There is a task with name "scwfa:registration_unreal_forwarder" in "nextStep" and swimlane =  "registration_unreal_forwarder".  Now bpm_assignee process variable (Which I pass as task variable when workflow starts, and task variables after task complete became process variable) goes to "registration_unreal_forwarder" swimlane. It means this task assignees to user which selected when workflow starts. And this swimlane saved in DB by magic Alfresco :)

      Next task is "scwfa:registration_unreal_forwarder_two". and swimlane="registration_unreal_forwarder" for this task. if we pass "bpm:assignee" properties for scwfa:registration_unreal_forwarder task and then go to next the process variable "bpm_assignee" update its value to new which I specified. But swimlane doesn't change it's value.


So, thant is why we need swimlane :)

2 comments:

  1. Hello,

    I appreciate for your post, and learn much from it. It’s really an excellent work. I really enjoy reading most of your articles and your thoughts about Jboss. JBoss is the most widely used open source application server on the market.

    Thanks!

    ReplyDelete
    Replies
    1. Not at all.
      It's great to read comments like yours :)

      Delete