Hello…I would explain how I use Activiviti with my corporative LDAP. Maybe this is not the best way, but for me is working and it would be a start point for others…First of all, I choose a framework for work with LDAP, I consider these:- jndi- spring ldap- UnboundID LDAP SDK- Novell ldap frameworkFinally I get Novell ldap framework (jldapv2.0.1.jar) because I worked with it in old projects.Then… let's go…1) Create a own ProcessEngineConfiguration OPTIONAL: ONLY IF YOU NEED A SPECIFIC IDENTITY SERVICE.. NOT MANDATORYpublic class LDAPStandaloneProcessEngineConfiguration extends StandaloneProcessEngineConfiguration
{
protected IdentityService identityService = new IdentityServiceLDAPImpl();
}
2) Change Activiti.cfg.xml ( note: class should be you ProcessEngineConfiguration class… maybe StandaloneProcessEngineConfiguration ) <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.ldap.LDAPStandaloneProcessEngineConfiguration">
<property name="customSessionFactories">
<list>
<bean class="org.activiti.engine.impl.ldap.LDAPUserManagerFactory" />
<bean class="org.activiti.engine.impl.ldap.LDAPGroupManagerFactory" />
</list>
</property>
3) Create an own IdentityService OPTIONAL: ONLY IF YOU NEED A SPECIFIC IDENTITY SERVICE.. NOT MANDATORYpublic class IdentityServiceLDAPImpl extends ServiceImpl implements IdentityService
In some methods may be you can do this:throw new LDAPOperationNotSupportedException("This action is not implemented under LDAP");4) Create LDAPUserManagerFactory public class LDAPUserManagerFactory implements SessionFactory
{
@Override
public Class<?> getSessionType()
{
return UserManager.class;
}
@Override
public Session openSession()
{
return new LDAPUserManager();
}
}5) Create LDAPGroupManagerFactory public class LDAPGroupManagerFactory implements SessionFactory
{
@Override
public Class<?> getSessionType()
{
return GroupManager.class;
}
@Override
public Session openSession()
{
return new LDAPGroupManager();
}
}6) Create your LDAPUserManager implementing your queries to LDAP using you LDAP frameworkpublic class LDAPUserManager extends org.activiti.engine.impl.persistence.entity.UserManager
7) Create your LDAPGroupManager implementing your queries to LDAP using you LDAP frameworkpublic class LDAPGroupManager extends org.activiti.engine.impl.persistence.entity.GroupManager
And I think… that's all folks