UserCriterion Error When I try to fetch/return list of users

1
0
-1

in Select field , i write one groovy script to fetch initial value : list of available users

  1. List<User> Users= apiAccessor.getIdentityAPI().getUsers(0, 200, UserCriterion.FIRST_NAME_ASC);
  2. Map<String,Long> usercombolist=new HashMap<String,Long>();
  3. for (User user:Users)
  4. {
  5. usercombolist.put(user.getPath(), user.getId());
  6. }
  7. usercombolist;

But It just say "UserCriterion cannot be resolved. It may lead to runtime errors."

when i triy with Group , roles it all perfact just in user , in groovy script editor give warning as above and give error when run process

Comments

Submitted by haris.subasic on Wed, 04/16/2014 - 13:47

Would it help if you add

  1. import org.bonitasoft.engine.identity.UserCriterion

at the beginning of your script?

1 answer

1
0
-1

This is a known limitation of the Groovy script editor. You have to manually import the class UserCriterion at the beginning of your script by typing:

  1. import org.bonitasoft.engine.identity.UserCriterion
Notifications