Support Article
Check for custom warnings
SA-16113
Summary
When importing rule warnings from PRPC 6 platform to Pega 7 platform, they no longer work. Running an out-of-the-box check message to see if it resolves in CheckForCustomWarnings, the messages do not trigger.
Error Messages
Not Applicable
Steps to Reproduce
Insert "com.pegarules.generated.pega_wb_default.pxAddGuardrailMessage(null,"VALIDATE-NONSTREAMCLASS",null); " in a custom CheckForCustomWarnings Activity.Root Cause
An issue in the custom application code. All parameters to a message rule are mandatory. In this case the parameter value is not included, as a result the activity does not save.
Resolution
Follow the below steps (local-change) to fix the issue:
1. Delete the CheckForCustomWarnings activity created in custom ruleset.2. Create activity again with same name CheckForCustomWarnings.
3. Save the activity without any steps.
4. Add a java step and add code as below (provide parameters required for the message or it would fail) and save.
HashStringMap params = new HashStringMap();
params.putString("ClassName", "Activity");
com.pegarules.generated.pega_wb_default.pxAddGuardrailMessage(null,"VALIDATE-NONSTREAMCLASS",params);
5. Create an instance of new rule type (for which CheckForCustomWarnings was created) and save it, you will see the custom warning.Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.