Custom IDM configuration

For some reason or another it seems like the custom implementation of idm has stopped working. I really dont see what is wrong as it has worked in past and is similar to the LDAP example.

Here is Engine configuration:

class FlowableConfigurationConfigurer implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> {
    void configure(SpringProcessEngineConfiguration engineConfiguration) {
        //IDM Service
        engineConfiguration.setIdmEngineConfigurator(new CustomIdentityConfigurator())

class CustomIdentityConfigurator extends IdmEngineConfigurator {
    public void configure(AbstractEngineConfiguration engineConfiguration) {
                .setIdmIdentityService(new CustomIdentityService());

    protected static IdmEngineConfiguration getIdmEngineConfiguration(AbstractEngineConfiguration engineConfiguration) {
        return (IdmEngineConfiguration) engineConfiguration.getEngineConfigurations().

class CustomIdentityService extends IdmIdentityServiceImpl {
    GroupQuery createGroupQuery() {
        new CustomGroupQuery()

class CustomGroupQuery extends GroupQueryImpl {
    long executeCount(CommandContext commandContext) {
        return executeQuery().size()
    List<Group> executeList(CommandContext commandContext) {
        return executeQuery()
    static List<Group> executeQuery() {"Gettting authorities for user: ${SecurityContextHolder.getContext().getAuthentication().getPrincipal()}")
        def groups = []
        def authorities = SecurityContextHolder.getContext().getAuthentication().authorities
        authorities.each {
            GrantedAuthority grantedAuthority ->
                log.debug("authority: ${grantedAuthority.authority}")
                groups.add(new GroupEntityImpl(id: grantedAuthority.authority))

The configure method is be called and the engineConfiguration.setIdmEngineConfigurator(new CustomIdentityConfigurator()) is being executed. But the it never fires the CustomGroupQuery as I was expecting when working with taskService. The executeQuery method at one time was being called when getting task, but now I cannot figure out why it is not.

I was expecting that the CustomGroupQuery to be executed when the following API is called:

def tasksQuery = taskService.createTaskQuery().

Hi @tjmac

Your CustomGroupdQuery is not called, because the Groups of the passed User Id are fetched directly within SQL query.

Have a look here: