How to access assignee inside multi instance userTask
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2012 05:34 AM
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:
In the userTask I have added the activiti:assignee parameter to map the process (username property) value of reviewAssignee to the task's assignee:
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.):
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?
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?
Labels:
- Labels:
-
Archive
activiti_mi_review.jpg
12 KB
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2012 05:19 AM
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,
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,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2012 03:38 PM
Thanks Tijs for the answer, this was exactly the push in the right direction I needed!
