Posted: 21 Aug 2015 11:07 EDT Last activity: 14 Oct 2016 12:09 EDT
Correction in cLSA materal - Custom Gaurdrail Warnings
In the section, Tips On Developing An Application for topic Custom Guardrail Warnings, the courseware states the use of the function addWarning which is depreciated. Furthermore the exercise specifically states the use of pxAddGaurdrailMessage. Unfortunately the function itself does not explain its usage through the expression builder. The function leverages a Message rule which in turn required a parameter to be passed. Would be nice if this was aligned.
In the first step we check if the description property has a value. If it does we exit the activity, otherwise we set the properties for the warning. The warning is added in the second step using the standard function rule called addWarning. The addWarning function does not have a return value and must therefore be called from a Java step.
Let’s have a look at the parameters for the addWarning function:
strWarningName – short name of the warning, which appears on the guardrails landing page
strWarningMessage – actual warning message shown on the rule form
strWarningDetails – extra details shown on the guardrails landing page
strWarningType – group warnings together in reports (Performance, BestPractice, DataIntegrity, Deprecated, and Logic)
nSeverity – defines the severity from 1 to 3 where 1 is most serious
myStepPage – page the warnings are added to, pass in the primary page here
That is the activity not the function!. If you refer to the original post, it talks about the coruse ware referencing a function called addWarning and in the exercise it uses the function pzAddGuardrailWarning. If you can not find it then I can Lync you to show you directly.
It is an correct observation that the lesson describes AddWarning and then the text and exercise steps over to pxAddGuardrailMessage. The correct way for Pega 7.1.x is to use the pxAddGuardrailMessage. This should be corrected in the lesson material.
Yes this has been confirmed as being inconsistent from the development environment where we had the pxAddGuardrail message as I have indicated in the post. We will be updating the content in the PegaAcademy lesson for everyone to see this change, thanks.