on 04-25-2013 10:52 AM
Hi, all,
when using getUserFactory mathod,my customer gets smaller number of users then from User Management UI.
Is there any control field in database which effect the return of the getUserFactory function?
any suggestion?
Attached the code from my customer:
public List<Map<String, String>> getBpmUsers(String userName){
List<Map<String, String>> users = new ArrayList<Map<String, String>>();
try {
IUserFactory userFactory = UMFactory.getUserFactory();
IUserSearchFilter userSearchFilter = userFactory.getUserSearchFilter();
userSearchFilter.setUniqueName(userName, ISearchAttribute.LIKE_OPERATOR, false);
ISearchResult searchUsers = userFactory.searchUsers(userSearchFilter);
while(searchUsers.hasNext()){
IUser user = userFactory.getUser(searchUsers.next().toString());
Map<String, String> userMap = new HashMap<String, String>();
userMap.put("userId", user.getUniqueName());
userMap.put("userName", user.getDisplayName());
users.add(userMap);
}
} catch (UMException e) {
e.printStackTrace();
}
return users;
}
Hi Wei-min Shan,
What are u passing in userName in below code?
userSearchFilter.setUniqueName(userName,ISearchAttribute.LIKE_OPERATOR, false);
if you are using setUniqueName(), then you've to pass userID (getUniqueName) not userName (getDisplayName).
I may be wrong, as I don't know what are passing in userName. So please check your code and give another try!
Hope it helps,
MS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. why you expect the same number? how do you know the code for user management UI is the same as yours?
2. you have to check the state of search result, they have different state, like SIZE_LIMIT_EXCEEDED
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.