I may add another thing I just found out which may be helpful. And that is that some of the examples of using custom session factories, that can be found by googling, return the UserEntityManager.class and GroupEntityManager.class abstract classes in getSessionType() instead of the interface UserIdentityManager, GroupIdentityManager. So if you started from that code it won't work.
After changing this my custom group + user managers are called:
<java>
package com.example.workflow.identity;
import org.activiti.engine.impl.interceptor.Session;
import org.activiti.engine.impl.interceptor.SessionFactory;
import org.activiti.engine.impl.persistence.entity.UserIdentityManager;
public class CustomUserManagerFactory implements SessionFactory {
@Override
public Class<?> getSessionType() {
return UserIdentityManager.class;
}
@Override
public Session openSession() {
return new CustomUserManager();
}
}
</java>