Get organisation users userNames in combobox

1
0
-1

I want to get all my users Usernames in a combobox , i wrote the follow code :

  1. import org.bonitasoft.engine.identity.UserCriterion;
  2. import org.bonitasoft.engine.identity.User;
  3.  
  4. int nb = apiAccessor.getIdentityAPI().getNumberOfUsers();
  5. ArrayList<User> listUsersSe = apiAccessor.identityAPI.getUsers(0, nb, UserCriterion.USER_NAME_ASC);
  6. ArrayList<String> listMailSe = new ArrayList<String>();
  7.  
  8. for (User uSe : listUsersSe) {
  9. String eMailSe = BonitaUsers.getUser(apiAccessor, uSe.getId()).getUserName();
  10. listMailSe.add(eMailSe);
  11. }
  12. return listMailSe;

But my list is empty ?

Comments

Submitted by sylvain.bailly on Tue, 07/15/2014 - 14:16

Strange because it works for me:

import org.bonitasoft.engine.identity.UserCriterion; import org.bonitasoft.engine.identity.User;

int nb = apiAccessor.getIdentityAPI().getNumberOfUsers(); ArrayList listUsersSe = apiAccessor.identityAPI.getUsers(0, nb, UserCriterion.USER_NAME_ASC); ArrayList listUsers = new ArrayList();

for (User uSe : listUsersSe) { String eUSe = BonitaUsers.getUser(apiAccessor, uSe.getId()).getUserName(); listUsers.add(eUSe); } return listUsers;

No answers yet.
Notifications