AnsweredAssumed Answered

SelectUsersPopupWindow searchPeople should not put % around the name

Question asked by olegpavliv on Jul 23, 2015
Latest reply on Jul 28, 2015 by olegpavliv
SelectUsersPopupWindow searchPeople() puts percent % around the name. Maybe it was done to do a search in a DB table.

But it is used in the LDAP search in activity-webapp-explorer. After inserting the % symbol the search result is empty in LDAP.

Here is a correct version of searchPeople() method


  protected void searchPeople(String searchText) {
    if (searchText.length() >= 2) {
      matchingUsersTable.removeAllItems();
     
      List<User> results = ProcessEngines.getDefaultProcessEngine()
              .getIdentityService()
              .createUserQuery()
//              .userFullNameLike("%" + searchText + "%")    // this code is incorrect
              .userFullNameLike(searchText)
              .list();
     
      for (User user : results) {
        if (!multiSelect || !selectedUsersTable.containsId(user.getId())) {
          if (ignoredUserIds == null || !ignoredUserIds.contains(user.getId())) {
            addMatchingUser(user.getId(), user.getFirstName() + " " + user.getLastName());
          }
        }
      }
    }
  }

Outcomes