The code for the <linklinkend="chapter_ldap">LDAP integration</link> contains full examples of how to implement this.
Check out the code on Github, specifically the following classes
<ulinkurl="https://github.com/Activiti/Activiti/blob/master/modules/activiti-ldap/src/main/java/org/activiti/ldap/LDAPGroupManager.java">LDAPGroupManager</ulink> and