Search code examples
guidewiregosuclaimcenter

Is there a way to persist gw.api.util.LocationUtil.addRequestScopedWarningMessage() on a pcf until page navigation out in Guidewire ClaimCenter?


This class method is helpful for bubbling up warning messages to the user regardless of location.

I want to persist this warning message past a page reload and wonder if there is an out of box way to do it.

ex: user updates info on a claim and I want to display a warning message from a triggered rule set after the transaction is completed.

If not, what is the convention to have a generic warning message handler that can display banners to the user? I would prefer to not have to tie core business login in the pcf directly.

I tried the gw.api.util.LocationUtil.addRequestScopedWarningMessage("displayed text") and it does not persist past a transaction. Options would be to put it in the pcf ex: afterCommit() or a page entity that displays when populated. I really don't want to do this since it's not generic.


Solution

  • InsuranceSuite is a JEE based application and utilizes the HTTPSerletRequest for UI queries. HTTPServletRequest has a 'session' which stores various elements related to the users session server side. Guidewire lets developers leverage the Servlet Session with SessionVar.

    Create your SessionVar with a static new SessionVar() instruction. Set your value with .set() Use your value with .get().

    You might look at this page in the Guidewire docs about SessionVar. Note that a login is required to view the documentation.

    https://docs.guidewire.com/is/gosu/gosu/topics/c_kj1443367.html?hl=sessionvar