如何在自定义执行监听器中查询组,用户?

时间:2019-04-15 12:31:07

标签: java alfresco activiti

我创建了一个新的自定义执行侦听器,并想查询用户所属的使用服务的组

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());

   }

}

我希望有group.size()= 2,但执行列表器始终显示group.size()= 0

0 个答案:

没有答案