Please be sure you’ve read the docs and API specs before asking for help. Also, please be sure you’ve searched the forum for your answer before you create a new topic.
Please consider addressing the following when creating your topic:
- What have you tried?
- What errors did you face (share screenshots)?
- Share the details of your efforts (code / search query, workflow json etc.)?
- What is the result you are getting and what were you expecting?
We are having a cloud rule to generate unique username for the user. While generating the username we need to replace the accent characters and ligature characters from the first and last name with English characters and then proceed with the user name generation.
I have added the below code to replace the ligature characters. This code works fine when I try to run it on my local machine, but when I merge it with the cloud rule and run the SailPoint validator I get Failure message.
public String removeDiacritics(String inputString) {
HashMap<Integer, String> ligatureMap = new HashMap<>();
ligatureMap.put(0x00C6, “AE”);
ligatureMap.put(0x00D0, “Dh”);
ligatureMap.put(0x00F0, “dh”);
ligatureMap.put(0x0110, “Dj”);
ligatureMap.put(0x0111, “dj”);
ligatureMap.put(0x0126, “H”);
ligatureMap.put(0x0127, “h”);
ligatureMap.put(0x0130, “I”);
ligatureMap.put(0x0131, “i”);
ligatureMap.put(0x0141, “L”);
ligatureMap.put(0x013F, “L”);
ligatureMap.put(0x0142, “l”);
ligatureMap.put(0x0140, “l”);
ligatureMap.put(0x014A, “Ng”);
ligatureMap.put(0x014B, “ng”);
ligatureMap.put(0x00D8, “O”);
ligatureMap.put(0x0152, “OE”);
ligatureMap.put(0x00F8, “o”);
ligatureMap.put(0x0153, “o”);
ligatureMap.put(0x0138, “q”);
ligatureMap.put(0x00DE, “Th”);
ligatureMap.put(0x00FE, “th”);
ligatureMap.put(0x00DF, “ss”);
ligatureMap.put(0x00E6, “a”);
for (Map.Entry<Integer, String> entry : ligatureMap.entrySet()) {
int codePoint=entry.getKey();
char[] chars = Character.toChars(codePoint);
String character = new String(chars);
inputString = inputString.replace(character, entry.getValue());
}
String normalized = Normalizer.normalize(inputString, Normalizer.Form.NFD);
Pattern pattern = Pattern.compile(“\p{M}”);
return pattern.matcher(normalized).replaceAll(“”);
}
If I remove the above code the validator returns SUCCESS, but after adding the code it FAILS saying that
No beanshell method called ‘removeDiacritics’ was found with signature: (java.lang.String)
