Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
5 subscribers
Views
1477 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Hi I am trying to to add users to the Appian system groups namely &qu
sivananthag
over 9 years ago
Hi
I am trying to to add users to the Appian system groups namely "Document Administrators", "Portal Administrators","Application Users" through Appian Group Service API.
I checked the group details in People tab and confimed that Group type for these groups is mentioned as "Custom".
So I am using the below code to find the group using group name and adding user to it:
GroupSearch grpSearch = new GroupSearch();
grpSearch.setGroupName("Document Administrators");
grpSearch.setGroupTypeName("Custom");
Group[] grpArray111 = grpService.findGroups(grpSearch,false);
When tested, I got only zero length array returned as grpArray111. i.e the group could not be found.
When i searched some other custom groups ( not system group), i could see the group array populated with results.
Does findGroups() method not appropriate for finding System Groups?
If so, Please suggest how to find a system group from Group name?
Thanks
Jhothi
...
OriginalPostID-130331
OriginalPostID-130331
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 9 years ago
I think the issue is with names that have a space. If you try with the system group Designers you get a result, correct?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sivananthag
over 9 years ago
yes, the code works For Designers. I could find Designers group with findGroup method. For other groups it didnt work.
Thanks,
Jhothi
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
I couldn't find a way to find this specific group "Document Administrators" by name. You can find others even if their names have spaces and are system groups
GroupSearch grpSearch = new GroupSearch();
grpSearch.setGroupName("Application Users");
grpSearch.setOperatorGroupName(GroupSearch.Operators.EQUALS);
ResultPage allGroupsResultPage = new ResultPage();
allGroupsResultPage = gs.findGroupsPaging(grpSearch, false, startIndex, batchSize,
Group.SORT_BY_GROUP_NAME, Constants.SORT_ORDER_ASCENDING);
Group[] groups = (Group[]) allGroupsResultPage.getResults();
or
GroupSearch grpSearch = new GroupSearch();
grpSearch.setGroupName("Portal*Administrators");
grpSearch.setOperatorGroupName(GroupSearch.Operators.LIKE);
ResultPage allGroupsResultPage = new ResultPage();
allGroupsResultPage = gs.findGroupsPaging(grpSearch, false, startIndex, batchSize,
Group.SORT_BY_GROUP_NAME, Constants.SORT_ORDER_ASCENDING);
Group[] groups = (Group[]) allGroupsResultPage.getResults();
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 9 years ago
Therefore if you really need the system groups you better create constants to point to them and if you need them in the API use
ProcessDesignService.evaluateExpression()
to get the value of the constant
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel