@Override
    public Map<String, List<Object>> getPersonAttributesFromMultivaluedAttributes(final Map<String, List<Object>> attributes,
                                                                                  final Set<PersonAttributes> resultPeople) {
        val username = usernameAttributeProvider.getUsernameFromQuery(attributes);
        val results = new HashMap<String, List<Object>>();
        if (StringUtils.isNotBlank(username)) {
            FunctionUtils.doAndHandle(__ -> {
                val allAttributes = new HashMap<>(attributes);
                if (resultPeople != null && !resultPeople.isEmpty()) {
                    allAttributes.put("people", new ArrayList<>(resultPeople));
                }
                val args = new Object[]{username, allAttributes, LOGGER, casProperties, applicationContext};
                val scriptFactory = ExecutableCompiledScriptFactory.getExecutableCompiledScriptFactory();

                val script = scriptFactory.fromResource(groovyPrincipalAttributesProperties.getLocation());
                val finalAttributes = (Map<String, ?>) script.execute(args, Map.class, true);
                LOGGER.debug("Groovy-based attributes found are [{}]", finalAttributes);

                finalAttributes.forEach((key, v) -> {
                    val values = new ArrayList<Object>(CollectionUtils.toCollection(v));
                    LOGGER.trace("Adding Groovy-based attribute [{}] with value(s) [{}]", key, values);
                    results.put(key, values);
                });
            });
        }
        return results;
    }
This is {@link InternalGroovyScriptDao}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-person-directory-core/src/main/java/org/apereo/cas/persondir/groovy/InternalGroovyScriptDao.java