Urgent - Extending TaskManager

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2013 10:29 AM
Hi All,
Could someone let me know the best way to extend the TaskManager behavior? Is it allowed to extend this class (Keeping Activiti's future versions upgrade). How would i specify the new taskManager in my spring context.
Could you please suggest on the below aswell.
- We have users, groups in our own database with a different table structure.
- We dont use Activiti explorer to create users groups etc. We already have a different database table set for that. We only want to integrate those tables with Activiti's Identity Management. Out tables should be used as read-only when activiti queries the information to check the ACLs.
- How would it help overriding the below classes in this type of integration?
Thanks in advance,
Raj
Could someone let me know the best way to extend the TaskManager behavior? Is it allowed to extend this class (Keeping Activiti's future versions upgrade). How would i specify the new taskManager in my spring context.
Could you please suggest on the below aswell.
- We have users, groups in our own database with a different table structure.
- We dont use Activiti explorer to create users groups etc. We already have a different database table set for that. We only want to integrate those tables with Activiti's Identity Management. Out tables should be used as read-only when activiti queries the information to check the ACLs.
- How would it help overriding the below classes in this type of integration?
ConnectionParams.javaGroupManager.javaGroupManagerFactory.javaUserManager.javaUserManagerFactory.java
Thanks in advance,
Raj
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2013 12:22 PM
Sorry to loose my patience too quickly. Could someone please reply to my questions?
Many thanks,
Raj
Many thanks,
Raj

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2013 02:58 PM
Hi Raj,
What behaviour do you want to add to TaskManager?
From what you describe it seems that you want have to support for your own user/group tables. For that you don't need to extend TaskManager; you only need to implement your own GroupManager.findGroupsByUser. Here's an example:
What behaviour do you want to add to TaskManager?
From what you describe it seems that you want have to support for your own user/group tables. For that you don't need to extend TaskManager; you only need to implement your own GroupManager.findGroupsByUser. Here's an example:
public class MyGroupEntityManager extends GroupManager {
@Inject
private MyIdentityService myIdentityService;
@Override
public List<Group> findGroupsByUser(String userId) {
MyUser user = myIdentityService.findUserByName(userId);
List<Group> result = new ArrayList<Group>();
for (MyGroup group : user.getGroups()) {
result.add(new GroupWrapper(group));
}
return result;
}
}
And then add a SessionFactory for this GroupManager in your ProcessEngineConfiguration.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2013 06:29 AM
Thanks.
I did almost the same In my GroupManager class i overrode the below method as similar implementation.
And I was hoping that the task is assigned to userLogin. But no tasks assigned to that user.
I have tried with taskCandidateUser and it calls my findGroupByUser (above) but still the task is not assigned to the user.
Could you let me know what I am doing wrong here?
Thanks,
Raj
I did almost the same In my GroupManager class i overrode the below method as similar implementation.
@Override
public List<Group> findGroupsByUser(String userLogin) {
Group singleGroup = new GroupEntity();
singleGroup.setId("INCIDENT1");
singleGroup.setName("Incident Name");
List<Group> list = new ArrayList<Group>();
list.add(singleGroup);
return list;
}
And I was hoping that the task is assigned to userLogin. But no tasks assigned to that user.
taskService.createTaskQuery().
processInstanceId(processInstanceId)
.taskAssignee(userId)
.list ()
The above does not give me any tasks.I have tried with taskCandidateUser and it calls my findGroupByUser (above) but still the task is not assigned to the user.
taskService.createTaskQuery().
processInstanceId(processInstanceId)
.taskCandidateUser(userId)
.list ()
Could you let me know what I am doing wrong here?
Thanks,
Raj

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2013 07:55 AM
1) What version of Activiti do you use?
2) Are you sure that the tasks have the right group assignments (i.e. including "INCIDENT1" in your example)?
3) Does it work if you use TaskQuery.taskCandidateGroupIn(groupIds) like this:
2) Are you sure that the tasks have the right group assignments (i.e. including "INCIDENT1" in your example)?
3) Does it work if you use TaskQuery.taskCandidateGroupIn(groupIds) like this:
taskService
.createTaskQuery()
.taskCandidateGroupIn("INCIDENT1")
.list();
