2 Replies Latest reply: Dec 19, 2012 11:53 PM by Rajan.Panchal RSS

    Passing httpRequest Parameters to question screen

    963664
      Is it possible to pass a custom http request parameter to a question screen.vm from Summary screen.vm or any custom JSP.
        • 1. Re: Passing httpRequest Parameters to question screen
          Frank.Hampshire-Oracle
          I don't believe this is possible. Http request parameters are not accessible from the templates.
          • 2. Re: Passing httpRequest Parameters to question screen
            Rajan.Panchal
            Hi,
            You can pass a parameter in query string in any of the link for a questionscreen.
            example:http://localhots:8080/App/investigate/App/en-GB/Procedural~f55%40BR2_Screens%7bglobal~global~%7d/qs%24history_cases%24global%24global?user=guest&value=parameter

            Now this value can be accessed via HttpServletRequest object (by implementing OnRequestEventHandler, ServletRequestListener interface )from where you can access the value parameter and set into an OPA attribute.

            After the value is set in the attribute, this value can be accessed in a template using below line:

            $screen.getInterviewSession().getRuleSession().getGlobalEntityInstance().getEntity().getAttribute("Public_name_of_attribute").getValue($screen.getInterviewSession().getRuleSession().getGlobalEntityInstance()).toString()

            However, please note that the method of request handler is called for each and every request. So you need some guard that will prevent the value from being modified.


            Hope this helps.

            Thanks,
            Rajan