cancel
Showing results for 
Search instead for 
Did you mean: 

Auto claim a pooled task

mduduzi
Confirmed Champ
Confirmed Champ
Hi,

I have a requirement from client to auto claim a pooled task when opening that task i.e when a pooled task is opened it is claimed as well(update the owner of the task)

Kind regards
4 REPLIES 4

romschn
Star Collaborator
Star Collaborator
You can take a look at out-of-the-box implementation for functioning of claim button - how it is rendered and what it does on the button click - for a task that is assigned to a group. Take a look at task-edit-header.js available at tomcat\webapps\share\components\workflow, what it basically does is - if a task is claimable, it renders the Claim button and once claim button is clicked, it updates the owner. I think you will require to make a customization here that if task is claimable then update the owner. Please check, if it works for you or not.

Hope this helps.

Hi,
Just saw your reply,thanks. I tried this and below is the code:
<javascript>
if (task.isClaimable)
{
     this._updateTaskProperties({"cm_owner": Alfresco.constants.USERNAME}, "claim");         
     Dom.removeClass(Selector.query(".actions .claim", this.id), "hidden");
     Dom.removeClass(Selector.query(".unassigned-message", this.id), "hidden");
}
</javascript>

I updated and minimized the javascript file but it looks like its not executing this part.
Kind regards
Mdu

romschn
Star Collaborator
Star Collaborator
You can put up an alert to see if the control is coming to this condition or not. Just take a look at how alert popup is displayed under task editable if logic, just above this if condition in task-edit-header.js. Also, try removing the later two Dom.removeClass statements above and see if it works for you or not.

Hope this helps.

Hi,

I have installed Alvex and found that it has another client-side javascript file which is an extension of the task-edit-header.js. I changed both those files as below but the behavior is still the same. It doesn't even show the popup.

<javascript>
if (task.isClaimable)
         {
            //MBP - pop for testing         
       this._updateTaskProperties({"cm_owner": Alfresco.constants.USERNAME}, "claim");
            Alfresco.util.PopupManager.displayMessage(
            {
               text: this.msg("executing isClaimable method"),
               displayTime: 2
            });
         }
</javascript>

I think I am missing something. Your help is appreciated.

Kind regards