cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing ACT_ID_USER table

wesley
Champ in-the-making
Champ in-the-making
I'd like to get a push to the right direction. What i'm trying to achieve is to customize activiti to use my own users table instead of the default ACT_ID_USER table. My question is around how far in customizing everything should I go?

I've been thinking to

1. replace mappings.xml (and initializing this from custom configuration class extending StandaloneProcessEngineConfiguration) to include my own SQL for User.xml entity, and pretty much keeping everything else as they are

2. replace mappings.xml to include my own entity called the Identity.xml for a new IdentityEntity class (implementing User and PersistentObject) and then extend UserManager with my own code that works with the IdentityEntity instances

3. replace mappings.xml to include my own entity together with my own IdentityEntity class but instead of extending UserManager I would create a new IdentityManager that extends AbstractManager (to get my own api more aligned with my DB table). This option means that I also need to extend IdentityServiceImpl and many of the commands to reflect the new IdentityManager class.

4. do one of the above, but not mess with mappings.xml and custom configuration class that initializes the sqlSessionFactory – dunno what would be a good alternative though

So which way should I go? Would option #3 even work? Any other suggestions?

I have searched the forums and modifying mappings.xml is not mentioned, only changing the UserManager. However, I see this as the only way to go if I want to reuse the DB session and use my own tables to do the queries.
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
The best way to do it, is to write your own implementation of User/GroupManager, and inject them into the Activiti engine.
This way, you can simply delete the ACT_ID tables.

wesley
Champ in-the-making
Champ in-the-making
So what you are suggesting is the #2 without modifications to mappings.xml. How can I then create the DB queries by reusing the ibatis sql session that Activiti uses to the same database in order to query my own tables? Or do I need to create another sql session for my own queries and use my own mappings.xml for my own entities? Or another solution altogether?

jbarrez
Star Contributor
Star Contributor
If you plug in your own impl of the managers, you can do whatever you want: ibatis, jpa, plain jdbc.
Take what is the easiest for you 😉