cancel
Showing results for 
Search instead for 
Did you mean: 

set groupAssignee as contributor

e-no91
Champ in-the-making
Champ in-the-making
In my javascript file I pass the groupAssignee as

workflow.parameters["bpm:groupAssignee"]="GROUP_A";


In the workflow, I wanted to assign the groupAssignee as a coordinator of the document, so in the workflow I want to add


bpm_package.children[0].setPermission("Coordinator",bpm_groupAssignee);


but this returns error.
I've replaced bpm_groupAssignee with bpm_groupAssignee.properties["cm:name"], this returns some node,
and replacing with
people.getGroup(bpm_groupAssignee) gives null.

How is the syntax for me to get string "GROUP_A" from the workflow?
Thanks in advance!

EDIT:
using
bpm_groupAssignee.get(0).properties["cm:name"]
also gives error..

My mistake, the resolution I posted below only works in javascript, not in workflow xml.

EDIT SOLVED:
I'm not sure if there is a correct way to do it. but so far I got what I wanted by:

javascript


workflow.parameters["bpm:assignTo"]="GROUP_A";



processdefinition.xml


bpm_package.children[0].setPermission("Coordinator",bpm_assignTo);

2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
You need to use "bpm_groupAssignees" rather than "bpm_groupAssignee"

bpm_groupAssignee is for single user that is the reason it is not able to hold group.

e-no91
Champ in-the-making
Champ in-the-making
I think I may have not written my question properly.
However, I have it resolved using the "authorityName" property.

All I have to do in workflow xml is

var group = (people.getGroup(bpm_groupAssignee)).properties["cm:authorityName"];
bpm_package.children[0].setPermission("Coordinator",group);