我创建了一个新的自定义执行侦听器,并想查询用户所属的使用服务的组
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