Pattern pattern = Pattern.compile(patternString);
if (!pattern.matcher(alias).matches()) {
String msg = "The alias " + alias + " can contain only alpha-numeric lowercase characters. Please enter a valid alias.";
log.error(msg);
throw new InvalidCartridgeAliasException(msg, tenantId, cartridgeType, alias);
}
boolean isAliasTaken = false;
try {
isAliasTaken = isAliasTaken(tenantId, alias);