cancel
Showing results for 
Search instead for 
Did you mean: 

How to access assignee inside multi instance userTask

mrvanes1
Champ in-the-making
Champ in-the-making
I have been racking my brains over the following problem the last couple of days and can't find any documentation about how to go forward. I have made slight changes to the activiti parallel review task in Alfresco, which works like a charm, accept for the fact that I can't seem to accesss that "local" assignee in the multi instance review task.

As far as I understand it, the flow of the vars is as follows:
- bpm_assignees contains a collection of the selected users which is broken down into assignees using the multiInstanceLoopCharacteristics element:
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="bpm_assignees" activiti:elementVariable="reviewAssignee"></multiInstanceLoopCharacteristics>
Each member of the bpm_assignees collection is then assigned to the process variable reviewAssignee.
In the userTask I have added the activiti:assignee parameter to map the process (username property) value of reviewAssignee to the task's assignee:
<userTask id="alfrescoUsertask1" name="Review" activiti:assignee="${reviewAssignee.properties.userName}" activiti:formKey="wf:activitiReviewTask">

Now, after the multi-instance userTask I have a mailTask with a script to send a mail to the iniator about the outcome in which I'd like to use the assignee's name (John Doe said: Approve e.g.):
mail.parameters.text = assignee + " said: " + wf_reviewOutcome + "\n"

No matter what I do, I allways end up with an error saying "ReferenceError: "assignee" is not defined" (or whatever variable I substitute assignee for, like reviewAssignee or bpm_assignee e.g.)

How can the assignee (process) variable be transported from the multi-instance userTask to the mailTask?
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Hi,

I think what you're looking for is a multi-instance sub process.
In that sub process you can then include a user task and the mail task.
Because they are in the same multi-instance sub process you can share local variables.

Best regards,

mrvanes1
Champ in-the-making
Champ in-the-making
Thanks Tijs for the answer, this was exactly the push in the right direction I needed!