cancel
Showing results for 
Search instead for 
Did you mean: 

Use own User/Group-tables

antje
Champ in-the-making
Champ in-the-making
Is there a possibility to use our own user/role-tables and check the tasklist against those tables instead the activiti-tables?

Best regards
Antje
20 REPLIES 20

arashmarzi
Champ in-the-making
Champ in-the-making
Here's probably a really basic question but Im a beginner to using Activiti both programmatically and through explorer. I am trying to achieve the same goal as discussed in this thread (essentially adding a custom authentication system to replace ldap and hardcoding users), though apart from like creating a java project and writing up the code for it I am not sure how to deploy it in explorer. For example, if i was to use the code from mondhs's project then how would I use it in coordination with activiti explorer?

Thanks for any guidance

frederikherema1
Star Contributor
Star Contributor
Not sure what "mondhs's" project is, but here is my 2 cents:
- The identity-managent integration is actually done in the activiti-engine itself, not in the activiti-explorer.
- Since activiti-explorer uses the engine, any "custom" identity-management configured in the engine will be used by the explorer.
- If you have an external system that does the user/group management that is not accessible through a Java-api, you should create the solution as described above, using java-code that does REST/HTTP or whatever calls you need to communicate with the system.

arashmarzi
Champ in-the-making
Champ in-the-making
"mondhs's project" is in reference to the git project posted by user mondhs earlier in this thread https://github.com/mondhs/activiti-CustomUserManagement

Ok, I understand that activiti engine and activiti explorer are 2 different components. Are you implying that if i want to create my own identity management component via Activiti Designer in Eclipse then I have to change activiti engine, But then how do I incorporate that into the original activiti engine? After which, how to i incorporate that into explorer? How do would I follow through with the basics? The user guide is clear and comprehensive on the necessary code but not 100% clear of the integration of new code into the existing activiti engine/explorer. If you can give me a generic step by step as to integrate new projects into the engine or pinpoint the section in the user guide that states it, that would be extremely helpful.

frederikherema1
Star Contributor
Star Contributor
Activiti explorer is just a webapp, containing the activiti engine. The engine is configured using a spring-context file (src/main/webapp/WEB-INF/applicationContext.xml). Any customisations to core-services (like the user-management) should be plugged into that configuration.

So just take the activiti-explorer web app, add your custom jar's in it and wire everything in in the config-file and you're ready to go.

franck102
Champ in-the-making
Champ in-the-making
Trying to solve the same issue, I understand how to create the proper ProcessEngine but how can I get it picked up by the ProcessEngines static class?

ProcessEngines.getDefaultProcessEngine is used all over the place, and I don't see how to override its default engine.
The best I can come up with is

ProcessEngines.init()
myEngine = <build my own engine>
ProcessEngines.registerProcessEngine(myEngine);

… and I will need to duplicate quite a bit of the code in ProcessEngines.init() to "<build my own engine>"

Any better suggestion?
Thanks!
Franck

frederikherema1
Star Contributor
Star Contributor
Any process engine you create (using the build()) registers itself with the ProcessEngines static class. This is usefull in case you bootstrap your engine using Spring or programatically. This can be done before or after a call to the init(), it doesn't matter, as long as there is no activiti.cfg.xml file on your class path.

In case you're using a plain processEngine, bootstrapped from the activiti.cfg.xml file, it's best to give the process engine the name "default". This way, when calling ProcessEngines.init(), the classpath will be scanned for the config file, and your config will be used. So IMHO, there is no need to call the register yourself, nor is it needed to duplicate any init() code…

cicpa
Champ in-the-making
Champ in-the-making
I'm using activiti 5.14 engine and i need to custom identityService.
I don't need activiti explore and i want to use only
ManagementService, RepositoryService, TaskService and RuntimeService
My goal is to override many methods as possible.
From my investigation i have noted that when i call

taskCandidateUser("kermit")

the findGroupsByUser(String userId) was called.

There are other points in the services ManagementService, RepositoryService, TaskService and RuntimeService when an Identity (UserIdentityManager/GroupIdentityManager) service was called.

trademak
Star Contributor
Star Contributor
And what's your question? taskCandidateUser is the only special case where it also looks for groups of a user. The other ones are really straightforward lookups of a user or group.

cicpa
Champ in-the-making
Champ in-the-making
Thanks for your reply.
Yes my question was if taskCandidateUser are the only case where identity service is used in runtime and task service.

harishashim
Champ in-the-making
Champ in-the-making
This question is very popular with Activiti. So I am proud the be the first guy in 2016 to ask this question again!

All my codes relevant to this question is in https://github.com/jbarrez/spring-boot-with-activiti-example/issues/5#issuecomment-168306116

In short I tried the codes as in mondhs solution in this (Activiti Forum) thread. Basically doing injection using XML configuration file for spring. Does not work for me. And then I find discussion in the above github link. So instead of using XML, I tried to do the bean injection using code. Still does not work.

My question:

If I configure my activiti-spring-boot with XML as in mondhs
https://github.com/mondhs/activiti-CustomUserManagement/blob/master/src/main/resources/META-INF/spri...

And then implemented all the user and group manager, factory, classes etc. Not that much different than mondhs implementation of them.

And then I use this code to manually create user and group.

    @Bean
    InitializingBean usersAndGroupsInitializer(
            final IdentityService identityService) {

        final Logger log = LoggerFactory.getLogger(this.getClass());

        return new InitializingBean() {
            public void afterPropertiesSet() throws Exception {

                Group group = identityService.newGroup("user");
                group.setName("users");
                group.setType("security-role");
                identityService.saveGroup(group);

                User admin = identityService.newUser("rootadmin");
                admin.setPassword("admin");
                identityService.saveUser(admin);

            }
        };
    }

And then discovered that the above code create user and group in  act_id_user and act_id_group table.

What should then be my conclusion? Can I conclude that my customized identity service using own user and group table is not working?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.