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..?
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
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
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.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.