cancel
Showing results for 
Search instead for 
Did you mean: 

Customizing user/groups queries

miljanmk
Champ in-the-making
Champ in-the-making
Querying user task by candidate user returns tasks assigned to candidate user or group that candidate user belongs to. In order to execute such query activiti creates TaskQueryImpl that contains information about candidateUser, end then, when executes query, fetches all groups for that user (see code snippet below - copied from org.activiti.engine.impl.TaskQueryImpl).

  protected List<String> getGroupsForCandidateUser(String candidateUser) {    List<Group> groups = Context      .getCommandContext()      .getGroupManager()      .findGroupsByUser(candidateUser);    List<String> groupIds = new ArrayList<String>();    for (Group group : groups) {      groupIds.add(group.getId());    }    return groupIds;  }‍‍‍‍‍‍‍‍‍‍‍

I wonder what should i do in order to fetch groups for particular user? As long as i can see, one of solutions is to override task service and provide it with own implementation of getGroupsForCandidateUser task query's function, the other one is to override org.activiti.engine.impl.persistence.entity.GroupManager?

I want to use my own user management tables. I thought the only thing that should be done in order to use own user manager implementation was to override org.activiti.engine.IdentityService, but I came to this problem. So, for some things I need to override IdentityService, for the others TaskService . . .
Why are functions needed to implement this feature spreaded over more than one interfaces? Maybe i am wrong?
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi,

Please search the user forum on LDAP and you'll find some answers.
You shouldn't be overriding the identityservice, but instead you should implement a UserManager and a GroupManager.

Best regards,