cancel
Showing results for 
Search instead for 
Did you mean: 

[Share] How to control the task reassignment

theoryoflinkin
Champ on-the-rise
Champ on-the-rise
Hi everyone,

In my projet, I need to activate the "Reassign" button on a workflow task only for a group of users.

Furthermore, I also need to check that the reassignment of the task is good. I mean if the task belongs to the group X, the new user selected for assignment need to be a member of group X.

For this, I have made some modifications inside the "task-edit-header.js" file.

But when I try to access to all the groups of the user selected I always get some errors.

For example, when I try this:

people.getPerson(args[1].userName);


In fact, it seems that I can't access to the library People.


So, here is my questions:

1) How can I access to the groups of the user selected?

2) How can I get the userName of current user (to check if this user can access to the "reassign" button or not)?

3) Is there a better way than this to achieve what I need?


Thanks in advance
4 REPLIES 4

theoryoflinkin
Champ on-the-rise
Champ on-the-rise
Nobody can help me? 😞

theoryoflinkin
Champ on-the-rise
Champ on-the-rise
Is there a way to control the reassignment or is it just impossible?

romschn
Star Collaborator
Star Collaborator
If I understand your requirement correctly then - the main goal is, you don't want to display reassign button in each workflow task. Instead you want to show it only when the task has been assigned to certain groups. Is that correct?

In that case, one approach would be - you must be knowing the workflow task name for the tasks those will be assigned to the particular group based on your workflow process definition file. Modify task-edit-header.js, to only display the reassign button when the workflow task is one of the group tasks based on the workflow task name. I think, onTaskDetailedData renders the reassign button in task-edit-header.js.
You can add logic something like below -

if (task.isReassignable)
         {
            //Condition for showing Reassign Button only to speicific group of users.
            if(task.name == "customwf:mygroupTask")
            {
               //Task is reassignable
               this.widgets.reassignButton = Alfresco.util.createYUIButton(this, "reassign", this.onReassignButtonClick);
               Dom.removeClass(Selector.query(".actions .reassign", this.id), "hidden");
            }
         }


Hope this helps.

theoryoflinkin
Champ on-the-rise
Champ on-the-rise
Hi,

Thank you for the answer.

I appreciate a lot.

But, unfortunately, it's more complicate than that.

My client want that all users can see all tasks (even if it's not assigned to their group).

If they belong to the group of the task, they can update it. If not, they only have a read-only access.

If the user belongs to the group "GROUP_Managers", he can use the reassigment. If not, the buton, need to be disabled.

When the reassignment is made, I have to make sur that the reassignment is ok. For example, I can't reassign a task that belongs to "GROUP_X" to a user of "GROUP_Y".

So, as ingenious as it's your solution, I'm afraid that it can't help me. 😞

But thanks again.