return result;
}
public String evaluate(final String expression, final AbstractAttributable attributable) {
final JexlContext jexlContext = new MapContext();
if (attributable instanceof SyncopeUser) {
SyncopeUser user = (SyncopeUser) attributable;
jexlContext.set("username", user.getUsername() != null
? user.getUsername()
: StringUtils.EMPTY);
jexlContext.set("creationDate", user.getCreationDate() != null
? user.getDateFormatter().format(user.getCreationDate())
: StringUtils.EMPTY);
jexlContext.set("lastLoginDate", user.getLastLoginDate() != null
? user.getDateFormatter().format(user.getLastLoginDate())
: StringUtils.EMPTY);
jexlContext.set("failedLogins", user.getFailedLogins() != null
? user.getFailedLogins()
: StringUtils.EMPTY);
jexlContext.set("changePwdDate", user.getChangePwdDate() != null
? user.getDateFormatter().format(user.getChangePwdDate())
: StringUtils.EMPTY);
}
addAttrsToContext(attributable.getAttributes(), jexlContext);