Question

2
Replies
77
Views
SM928K Member since 2019 6 posts
P
Posted: June 26, 2020
Last activity: September 11, 2020
Solved

Java code transformed in a function throwing error when getting invoked from data transform

Followed below PDN article to achieve the dynamic role addition:

https://community.pega.com/knowledgebase/articles/security/how-dynamically-add-roles-during-user-authentication

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***  

Pega Platform 8.3 Data Integration Java and Activities
Share this page LinkedIn