AnsweredAssumed Answered

Query Groups, Users in Custom Execution Listener

Question asked by makram.baaziz@planetgroupint.com on Apr 15, 2019

Hello,

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

Outcomes