Query Groups, Users in Custom Execution Listener

Showing results for 
Search instead for 
Did you mean: 

Query Groups, Users in Custom Execution Listener


I created a new custom execution listener and wanted to query the groups where the user is member of using the services

public class CustomExecutionListener implements ExecutionListener {

private static Logger logger = LoggerFactory.getLogger(CustomExecutionListener.class);

public void notify(DelegateExecution execution) throws Exception {

String userID = (String) execution.getVariable("initiator");
logger.error("userID = " + userID);

List<Group> groups = execution.getEngineServices().getIdentityService().createGroupQuery().groupMember(userID).list();
logger.info("groups.size() = " + groups.size());



when I call the execution listener from my process I always see that group.size() = 0