I want to use my application's existing user and group management together with activiti. After reading the user guide and these threads [1] I hoped to be able to provide a custom lookup hook that is called whenever a group-to-user resolution and similar tasks need to be done.
I provided a custom IdentitySession as suggested and it gets called when querying tasks with TaskQuery#taskCandidateUser(). However, when looking at the executed sql statements, the internal activiti user tables are still used for lookup. Example: Executing: select distinct T.* from ACT_RU_TASK T inner join ACT_RU_IDENTITYLINK I on I.TASK_ID_ = T.ID_ WHERE …
What's the best practice here? I don't want to duplicated all my users, groups and relations to the activiti user management.
As an alternative I thought of post-processing a task query, however, attributes like candidateGroups doesn't seem to be stored in the TaskEntity.
The only thing I can think of is extending the TaskServiceImpl (and returning custom impl of the TaskQuery) which uses your own logic to determine the task id's based on candidate group (if possible). The candidate groups are stored in an identityLink btw, not sure if you can go around this quite easy (without rewriting half of activiti )