Java code transformed in a function throwing error when getting invoked from data transform
Followed below PDN article to achieve the dynamic role addition:
It asks to write a java code. We moved that java code in a function.
This function when gets called from activity gives no issue but when called from a data transform, getting below error in log:
Caused by: com.pega.pegarules.pub.context.PRSecurityException: Activity class must be Code-Security when invoking setRoles()
Can someone help me here, why this is happening?
Also the article explicitly says, the code will update "pxThread.pxSecuritySnapshot..pxUserRoles" property.
Then why can't we directly append the values to this property in Data transform? Why we need java code?
***Edited by Moderator: Pallavi to update platform capability tags***