Support Article
Exception in modal window when setting page message
SA-54632
Summary
A modal window is used to enter data. Validation rules are used to ensure that the data meets a set criteria and are triggered when the modal window is submitted.
When executing a Validation rule, the below generic error message displays instead of the Validation error:
Status: Fail.
There has been an issue; please consult your system administrator.
Error Messages
[WebContainer : 1] [TABTHREAD3] [ ] [xxxx:01.01.01] (xxxx.When) ERROR prpchost|xx.xx.xx.xx XXXX - Exception caught while evaluating when
java.lang.NullPointerException
at com.pegarules.generated.when.ra_when__55a6ae0baebfbccc191949c431e2f002.evaluate(ra_when_mywhenrule_55a6ae0baebfbccc191949c431e2f002.java:51) ~[?:?]
at com.pega.pegarules.session.internal.mgmt.Executable.evaluateWhen(Executable.java:4326) ~[prprivate.jar:?]
at com.pega.pegarules.session.internal.mgmt.Executable.invokeWhen(Executable.java:10823) ~[prprivate.jar:?]
at com.pega.pegarules.generation.internal.stream.StreamToolsImpl.evaluateWhenCondition(StreamToolsImpl.java:1329) ~[prprivate.jar:?]
at com.pega.pegarules.generation.internal.stream.StreamToolsImpl.evaluateWhenCondition(StreamToolsImpl.java:1314) ~[prprivate.jar:?]
at com.pega.pegarules.generation.internal.stream.StreamToolsImpl.evaluateCondition(StreamToolsImpl.java:1597) ~[prprivate.jar:?]
at com.pega.pegarules.generation.internal.stream.StreamToolsImpl.evaluateWhen(StreamToolsImpl.java:1627) ~[prprivate.jar:?]
at com.pega.pegarules.session.internal.mgmt.autostreams.AutoStreamRuntimeImpl.evaluateWhen(AutoStreamRuntimeImpl.java:1149) ~[prprivate.jar:?]
at com.pega.pegarules.generation.internal.assembly.jspwhen.ProcessWhenExpression.evaluateCompiledWhen(ProcessWhenExpression.java:254) ~[prprivate.jar:?]
[...]
2018-03-23 12:23:09,450 [ WebContainer : 1] [TABTHREAD3] [ ] [ xxxx:01.01.01] (xxxx.Stream) ERROR prpchost|xx.xx.xx.xx XXXX - Section 'MySection' execution error on page '' of class 'XXXX-XXXX-XXXX-XXXX'.
java.lang.RuntimeException: Component stack mismatch { [...] }
at com.pega.pegarules.session.internal.mgmt.autostreams.uicomponent.json.UIComponentRuntimeImpl.finishProcess(UIComponentRuntimeImpl.java:169) ~[prprivate.jar:?]
[...]
Steps to Reproduce
- Create a When rule which accepts a parameter of type 'Page Name'.
- Reference this When rule on a section (for example, to control Visibility).
- In a flow, do not set the parameter required for the When rule (to force the error).
- Start the flow on a User portal.
Root Cause
An issue in the custom application code or rules. The issue occurred due to the following reasons:
- A When rule was setup that accepted a parameter of 'Page Name'.
- The Required parameter was not provided (or an incorrect parameter was provided; where the underlying named page did not exist).
- If the When rule was used on a Stream rule (such as a section); the issue manifested as a 'Component stack mismatch'.
Resolution
Perform the following local-change:
Provide the correct Page Name for any When rule that requires a parameter of type 'Page Name'.
On the When Rule, check for the existence of the Page using the out-of-the-box @PageExists function before testing the Properties.
For example, add a new test in the When rule (set this as the first test) to ensure that the page exists using the below expression:
@PageExists(Param.PageReference) -> true
Published August 19, 2019 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.