How do I display the name of the approver for last task?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member II

How do I display the name of the approver for last task?

Jump to solution

I am trying to get the names of the reviewers who approved a review task so I can display along the with the task data. On the complete event of the task I would like to record the approver's name so I can have the workflow send an email to the initiator with the list of who approved and who rejected.

On the "Complete Event" with the task, I am trying to use task.actorId but this is returning a null.  I have been searching the forum for similar scenario and found https://community.alfresco.com/thread/195673-ottenere-lo-username-dellutente-che-esegue-un-task-di-u....  

I am very new to Alfresco, so if there is a tutorial that I should read, please direct me there.  I am trying to understand what is available to me to use.  Thanks.

1 Solution

Accepted Solutions
Highlighted
Intermediate

Re: How do I display the name of the approver for last task?

Jump to solution

Use task.getAssignee() rather than actorId().

This will give you the id of the user who acted on (and claimed if using candidates) the task.

If you have multiple approvers, then use a map to store the id and identity object so you have all approvers in a single object.

Greg

View solution in original post

2 Replies
Highlighted
Active Member II

Re: How do I display the name of the approver for last task?

Jump to solution

I'm new to Activiti as wellSmiley Happy

If the approval steps are not parallel and if you got a form for each step you could write the current user (that would be become the approver) to a form field using JavaScript. Having it in a form field it should be available for further usage throughout the process.

Javascript sample (first three rows):

Highlighted
Intermediate

Re: How do I display the name of the approver for last task?

Jump to solution

Use task.getAssignee() rather than actorId().

This will give you the id of the user who acted on (and claimed if using candidates) the task.

If you have multiple approvers, then use a map to store the id and identity object so you have all approvers in a single object.

Greg

View solution in original post