The highlighted error suggests that line 28 ends with + e; — that’s likely the issue.Always use e.getMessage() or e.toString() for better output when logging or printing exceptions.
The for loop is malformed as pointed out by @LarryG . There are also problems with the approach.
Identities must be locked before being modified.
There may also be metadata associated with the identity attributes (such as email). Modifying the Identity attributes directly is probably not the right way to do things if this is a production environment.
reader.close() should be in a finally clause like: try { ... } finally { if (null != reader) { reader.close(); } }
Instead of using for (int i = 0; i @lt identityNames.size(); i++) use for (String identityName : identityNames).
The code should call context.commitTransaction() at some point, to persist the Identity changes.
You can put this logic in any one of the IDE , Create a method there . Replace & etc . Put the CDATA while creating rule . It will automatically parse with correct format .
Yes, @harsh_gupta4 but since the entire time we have been discussing their code, I wanted to make sure they understood that it would not be a direct paste of the current code that we had been discussing. Not everyone immediately picks up on those subtle differences and I didn’t want them to be frustrated if they added in <![CDATA[ and it suddenly broke in a new way.
Hi @LarryG , I got your point and it dont make any changes in your core Logic . Its just the way of parsing the expression . Just to avoid this kind of parse error which takes unnecessary time for debugging etc . Also this is the recommended way from SailPoint as well.
**Sudheer Pathuri -**While fixing the issue, I also took time to understand the code. I haven’t seen anyone take this kind of approach to safeguard identities. What is the main objective behind your code?