How to reuse existing user/group data in Activiti?

activiti, integration

Solution

I don't know what version you are currently using, but I used your second option successfully with version 5.5, overriding some Activiti classes:

Extend `GroupManager` and `UserManager` (from package `org.activiti.engine.impl.persistence.entity`), and implement the methods you need, using the required DAOs/EntityManager/whatever pointing to your database. Code here: GroupManager / UserManager.

Implement `org.activiti.engine.impl.interceptor.SessionFactory.SessionFactory`, for groups and users. Check out code here: ActivitiGroupManagerFactory / ActivitiUserManagerFactory.

Finally, in your activity config you have to set your new SessionFactory classes. I was using spring, so there is my activiti-config bean code: activiti-config.xml (check line 14)

Hope this helps in some way :)

Problem

I have a webapp which has user/group functions, and existing user/group data. I want to use Activiti the process engine, however, it seems Activiti manage user/group info itself. Should I: - Refactor my existing webapp, to reuse the user/group data from Activiti, or - Write some adapter code, to make Activiti reuse user/group data in my existing database? Maybe, another implmentation of `RepositoryService`, `IdentityService`, etc., and recompile? It seems `RepositionServiceImpl` is hard coded in the Activiti sources, and there isn't a `setRepositionService()` method in `ProcessEngine`. I can't rename the existing db tables, because there are some other apps using them. I have read the user guide, but I didn't found any information on how to integrate Activiti with existing apps.

Original source