Hi @MVKR7T thank you very much for always being there!
Looking the cloud rule, it brought me an idea that worked fine without using the BP cloud rule. It works fine for me, I will share so it remains here for other to use.
First thing is that the Before Provisioning cloud rule comes with a message that establish that it should be not used to add attributes to plan, so they suggest to use a create provisioning policy instead:
This is when I have the idea of see what happens if I use an UPDATE provisioning policy, and then account attributes begging to appear at the Modify Operation level in the rule.
So first thing I did is call the GET to obtain the CREATE provisioning policy:
Then I simply paste the same code, changing usageType to UPDATE:
Some weird thing I noticed, is that fields that has the identity attribute direct transform does not apper in the Modify Operation, other accoun attributes with static transform, or other transform (I had a random number transform) indeed appears when Modify Operation occurs.
So as a workaround, in the CREATE provisioning policy (the Create Account in the UI), I mapped some XXX attribute with the desired Identity attribute, and then use the Account Attribute transform in the UPDATE provisioning policy:
Now, before entering the operation evaluating plan, I create a Map with account attribute/value like this:
Map accountAttributes = new HashMap();
List attributesRequestList = account.getAttributeRequests();
Iterator attributesRequesIterator = attributesRequestList.iterator();
while (attributesRequesIterator.hasNext()) {
AttributeRequest attributeRequest = (AttributeRequest) attributesRequesIterator.next();
log.warn("attribute##" + attributeRequest.getName() + "##" + attributeRequest.getValue() + "##" + attributeRequest.getDisplayValue());
accountAttributes.put(attributeRequest.getName(), attributeRequest.getValue());
}
if (AccountRequest.Operation.Create.equals(account.getOperation())) {
........................................................
Finally, I just revised Map and found the value I needed:
On log, when adding an entitlement: