cancel
Showing results for 
Search instead for 
Did you mean: 

Pooled groups and assignments

ale_carraro
Champ in-the-making
Champ in-the-making
Hi, I had a problem with pooled groups, but (fortunately) I found a trick that solves. I ask what I understood badly:

if I have this definition everything works fine (note that corrector and publisher are defined intentionally the same way):
   <swimlane name="commdirection">
      <assignment actor-id="admin"/><!– To be the direction group –>
   </swimlane>

  <swimlane name="corrector">
    <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
      <pooledactors>GROUP_quality</pooledactors>
    </assignment>   
  </swimlane>
 
  <swimlane name="publisher">
    <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
      <pooledactors>GROUP_quality</pooledactors>
    </assignment>   
  </swimlane>

   <start-state name="start">
      <task name="bw:rcStartTask" swimlane="initiator" />
      <transition name="Send to corrector" to="correcting" />
   </start-state>

   <task-node name="correcting">
      <task name="bw:rcCorrectingTask" swimlane="corrector" />
      <transition name="sendToApprover" to="techapproving" />
   </task-node>

   <task-node name="techapproving">
      <task name="bw:rcApproving" swimlane="techdirection"/>
      <transition name="reject" to="correcting" />
      <transition name="approve" to="commapproving"/>
   </task-node>
   <task-node name="commapproving">
      <task name="bw:rcApproving" swimlane="techdirection"/>
      <transition name="reject" to="correcting" />
      <transition name="approve" to="publishing"/>
   </task-node>

   <task-node name="publishing">
      <task name="bw:rcPublishing" swimlane="publisher"/>
      <transition name="publish" to="startSigning" >
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               for (var i = 0; i &lt; bpm_package.children.length; i++) {
            bpm_package.children[i].move(bw_rcDestFolder);
           }
            </script>
         </action>
         </transition>
   </task-node>


If I 'merge' corrector and publisher swimlanes, however, when I go to 'publishing' task, no task is listed on the pooled group.

If I use users instead of groups, everything works.

What I miss?

Thanks Alex
6 REPLIES 6

ale_carraro
Champ in-the-making
Champ in-the-making
I also noted that if you return to a task that has a swimlane defined as a pooledactor for the second time, the 'error' applies, too.

ie.
A is a group,
1,2 are tasks
1 is a task with A as a swimlane.

if I do the following transitions: 0->1->2->1 at the end nobody in A see the task n.1

if I do the following: 0->1,take ownership->2->1 at the end the task is a personal (not pooled) and owned by the one that owned after step 1

I'm going to think it is a bug…

davidc
Star Contributor
Star Contributor
A is a group,
1,2 are tasks
1 is a task with A as a swimlane.

if I do the following transitions: 0->1->2->1 at the end nobody in A see the task n.1

if I do the following: 0->1,take ownership->2->1 at the end the task is a personal (not pooled) and owned by the one that owned after step 1

I've confirmed this is a bug - it'll be fixed in 2.1.

However, I haven't been able to reproduce your first case - I'm guessing it's caused by the same issue.  Can you send your full process definition please?

ale_carraro
Champ in-the-making
Champ in-the-making
I tried 2.1 and both are solved. Very good job!

Now a (I hope) simple question: is there a way to 'force' a user to take ownership before going on the next step?
When the task is on the pool, I have both the buttons <Next step> and Get Ownership. The problem is that if I click on Next Step the task does not show in the My completed tasks dashboard….

thanks for your marvelous work

Alex

davidc
Star Contributor
Star Contributor
Unfortunately not - that's a feature to be done in a future release.

To workaround the "My Completed Tasks" issue (yes, it's probably bug), you can extend your process definition to add the following event to your pooled task:

            <event type="task-end">
               <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                  <script>
                     <expression>
                        if (taskInstance.actorId == null)
                           taskInstance.actorId = person.properties.userName;
                     </expression>
                  </script>
               </action>
            </event>

Hopefully, that helps.

ale_carraro
Champ in-the-making
Champ in-the-making
thank you! It works, but now I have to make another question: I tried to put those 2 lines in the transition script, but I got this error: "taskInstance" not defined.

Since what I know about the JBoss workflow is from the alfresco's wiki, I wonder where can I find documentation on the subject, for example a list of the variable defined in "event" tag

Can anybody address me on this? thanks

Alex

davidc
Star Contributor
Star Contributor
http://docs.jboss.com/jbpm/v3/userguide/

If you've attached your event to a task-node, that script should work.  Can you paste your process definition xml.

is there a way to 'force' a user to take ownership before going on the next step?

BTW, a fix has gone into 2.1 Enterprise for this, it will make its way to HEAD.