3 Replies Latest reply on Feb 21, 2008 5:50 PM by Pete Muir

    LR conversation flow: response.sendRedirect + resume on GET

    Przemyslaw Jaskierski Newbie

      I cannot deal with the following scenario, please share your thoughts:


      I have a JPDL pageflow in a LR conversation. On last page of the pageflow I have an action that in a decision node performs DB flush and needs to do the following:


      1. Redirect to an external site using a response.sendRedirect
      2. External site verifies then some data and
      3. Redirect to exactly the same conversation/pageflow that request originated, allowing to fix input data stored in that conversation.


      Without this response.sendRedirect I think this would be trivial using CID parameter or natural conversation but I really need to invoke something on my side just before going to the external site. But invoking response.sendRedirect leads (not surprisingly) to the JPDL exception that pageflow is not at page node. Is there any way to accomplish my scenario? Some way to suspend/resume the pageflow above? Another approach to this problem?


      TIA

        • 1. Re: LR conversation flow: response.sendRedirect + resume on GET
          Pete Muir Master

          As ever, you need to post code and stack traces and a clear flow that we are taking through your app.

          • 2. Re: LR conversation flow: response.sendRedirect + resume on GET
            Przemyslaw Jaskierski Newbie

            Pete, I described an idea I was prototyping and then dropped due to this exception some time ago. So I have no adequate code to illustrate this. I hoped that this flow is a generic problem, please bear with me:


            1. start LR conversation


            2. go through a multipage wizard


            3. present confirmation page


            4. after OK action is executed we invoke a checkAndFlushAndRedirect() method in a decision block.
            This method either:


            4a. throws ERROR outcome, resulting in JPDL redirection to step 3.


            4b. or send to user's browser a HttpServletResponse.sendRedirect() to the payment service site URL


            5. After processing, payment service site GET-redirects to one of the two URLs in Seam application: urlOK for OK, urlREJECT for REJECT.


            6. both urlOK and urlERROR resumes the conversation (basing on its ID?) and allow finishing conversation or fixing the data
            in the context of this conversation.



            But step 4b. was causing a pageflow is not at page node exception because I was apparently interfering with JPDL flow processing. So doing some kind of suspend/leave on this JPDL flow
            could help me to deal with this.
            Is it possible somehow? Or should I do it in another way?














            • 3. Re: LR conversation flow: response.sendRedirect + resume on GET
              Pete Muir Master

              Hmm. So you get an exception when you send the redirect? Not sure without a stack trace.


              This should work - but you will have to restore the pageflow manually when you return. Might be nice to make it easy for you to do this in Seam. File a feature request.