cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced workflow bpm:groupAssignee problem

rhofkens
Champ in-the-making
Champ in-the-making
Hello,

I'm trying to implement an extended ad-hoc workflow:

- user A can assign a workflow task to user B
- user B manages the task. He can close it or forward to user C
- user C manages the task. He can close it or forward it to user A, D, …

The number of "task forward" steps is not predefined, it simply depends on the documents being processed.

My process definition looks like this:


<?xml version="1.0" encoding="UTF-8"?>

<process-definition
  xmlns="urn:jbpm.org:jpdl-3.1"  name="bnotkwf:extended">

   <swimlane name="initiator"></swimlane>

   <swimlane name="assignee">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{bpm_groupAssignee}</pooledactors>
      </assignment>
   </swimlane>

   <swimlane name="repeat-assignee">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <pooledactors>#{bpm_groupAssignee}</pooledactors>
      </assignment>
   </swimlane>



   <start-state name="start">
        <task name="bnotkwf:submitAdhocTask" swimlane="initiator" />
      <transition name="handle" to="handle-document"></transition>
   </start-state>

   <task-node name="handle-document">
        <task name="bnotkwf:handleDocument" swimlane="assignee">
         <event type="task-create">
            <script>
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>
         </event>
     </task>
      <transition name="forward" to="repeat-handle-document">
      </transition>
      <transition name="end-task" to="end"></transition>
   </task-node>

   <task-node name="repeat-handle-document">
        <task name="bnotkwf:repeat-handleDocument" swimlane="repeat-assignee">
         <event type="task-create">
            <script>
               if (bpm_workflowDueDate != void) taskInstance.dueDate = bpm_workflowDueDate;
               if (bpm_workflowPriority != void) taskInstance.priority = bpm_workflowPriority;
            </script>
         </event>
     </task>
      <transition name="forward" to="handle-document">
      </transition>
      <transition name="end-task" to="end"></transition>
   </task-node>


   <end-state name="end"></end-state>
</process-definition>

The problem I have now occurs in this test scenario

- User A assigns a Task to group B
- User B (member of group B) sees the task in his list, manages it and assigns the task to group C
- User C (member of group C) sees the task in his list, manages it and assigns the task to group D

Strangely enough, the task ends up in the task lists of group B again. The users in group D never see the task.
It seems like the workflow instance has remembered that the first bpm:groupAssignee for the "handle-document" task was group B…

Is this by design? Can I override that behaviour? Is there another way to implement this?

Cheers,
Roeland.
2 REPLIES 2

rhofkens
Champ in-the-making
Champ in-the-making
* bump *.  Anyone??

ebell
Champ in-the-making
Champ in-the-making
Note that despite the name of this thread, the correct syntax for the groupAssignee variable in the code is bpm_groupAssignee, not bpm:groupAssignee.