Customizing user/groups queries

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2011 03:41 AM
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).
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?
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?
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2011 01:16 PM
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,
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,
