01-03-2018 11:03 PM
I am trying to use custom identity management with Activiti 6.0
The example i user guide is not matching with the one in Activiti 6.0
public class MyGroupManagerFactory implements SessionFactory {
@Override
public Class<?> getSessionType() {
return GroupIdentityManager.class;
}
@Override
public Session openSession() {
return new MyCompanyGroupManager();
}
}
public class UserManagerFactory implements SessionFactory{
@Override
public Class<?> getSessionType() {
}
@Override
public Session openSession(CommandContext commandContext) {
}
}
The CommandContext seems to be the parameter for openSession(). Anybody dealt with the discrepancy and got it working..?
01-21-2018 04:10 AM
Probably, I think that you can use custom identity management with Activiti 6.0 with the following procedure.
1. Implement the GroupDataManager interface. Or, extend MybatisGroupDataManager.class
2. ProcessEngineConfigurationImpl.setGroupDataManager(GroupDataManager groupDataManager)
Activiti/ProcessEngineConfigurationImpl.java at 6.x · Activiti/Activiti · GitHub
Certainly, Activiti user guide is wrong.
Reference
https://community.alfresco.com/community/bpm/blog/2017/06/01/activiti-6-is-here
12-23-2018 08:12 PM
I am having the same issue. Does this work? Does the SessionFactory interface no longer need to be implemented? And what about groupEntityManager?
When I try this, when claiming or unclaiming a task, the AbstractEntityManager.findById method is called, not my implemented findById method. My method is overriding this one, so it should be called?
My code is like this:
public class SpringSecurityUserManager extends UserEntityManagerImpl {
private static final Logger logger = LoggerFactory.getLogger(SpringSecurityUserManager.class);
@Autowired
AuthUserService authUserService;
@Autowired
public SpringSecurityUserManager(ProcessEngineConfigurationImpl processEngineConfiguration, UserDataManager userDataManager,
AuthUserService authUserService) {
super(processEngineConfiguration, userDataManager);
this.authUserService = authUserService;
}
@Override
public UserEntity findById(String userId) {
logger.info("findById for userId:{} ", userId);
UserEntityImpl user = new UserEntityImpl();
user.setId(authUserService.getCurrentUserName());
return user;
}
Thanks
01-02-2019 02:27 PM
Can somebody please look at this? I am having issues with custom identity management on Activiti 6.0. From the above code, I tried to extend MybatisGroupDataManager instead of GroupEntityManagerImpl and that didn't work. I also tried to implement GroupDataManager and that didn't work either. (also tried with MybatisUserDataManager and UserEntityManagerImpl) When I debug, the breakpoint keeps stopping inside AbstractDataManager.findById instead of SpringSecurityUserManager.findById.
I am also setting appropriate SpringProcessEngineConfiguration, I believe.
Explore our Alfresco products with the links below. Use labels to filter content by product module.