1 2 Previous Next 15 Replies Latest reply on Jul 6, 2006 1:39 PM by jcalvert

    Stateful behaviour jPDL [Back button error!]

    simonbb

      I read Seam and jPDL are providing stable workflows without the problems
      other technologies have.

      According to the doc:
      >....Seam transparently detects the use of the back button, and blocks any
      attempt to perform an action from a previous, "stale" page....[http://docs.jboss.com/seam/1.0.1.GA/reference/en/html/jbpm.html]

      The back-end of DVD-Store demo and the number-guessing example are using
      JPDL, i played around but the back button still works the old way and within
      10 seconds i crashed the application..

      DVD-Store-Demo:
      If I click "Ship" -> and after that -> I click the back button and click
      again "Ship" I get a Server Error.

      Even the DVD-store demo on the jboss Site crashes with this behaviour (so
      it's not the fault of my Server :)
      http://dvdstore.demo.jboss.com/

      The same behaviour occurs with the simple NumberGuess Example on clicking
      back and enter a new guess (server error)

      So could somebody provide me an example wehre I could see the "disabled"
      back-Button behaviour?
      Or how statefulness should be implemented with Seam and jPDL/jBPM?

      Simon

        • 1. Re: Stateful behaviour jPDL [Back button error!]
          theute

          I just fixed the problem you faced in the number guess example.

          You can see the back-button disabled in any conversation, try the DVD registration or the booking example.

          • 2. Re: Stateful behaviour jPDL [Back button error!]
            simonbb

            But whats about the other problem DVD-Store back-end (also a bug)? e.g. on your demo-website:
            http://dvdstore.demo.jboss.com

            -Do an order with e.g. user1

            -Go to the back-end
            -choose order-management3
            -assign an open order
            - click ship
            - enter a tracking number and click ship
            and after that click back.. and it's still possible to go back and click
            ship ... after that following happens: see Error below

            And I don't understand.. this should not be possible ..
            Per Default back button actions are disabled in JPDL /JBPM workflows or
            not?

            As long I don't use back="enabled" it should work? or is there a back="disabled" (I don't see a disabled in the Documentation).


            exception

            javax.servlet.ServletException: /ship.xhtml @54,101 value="#{ship.track}":
            $Proxy370
            org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:58)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


            root cause

            javax.servlet.ServletException: /ship.xhtml @54,101 value="#{ship.track}":
            $Proxy370
            javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
            org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
            org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

            ...


            • 3. Re: Stateful behaviour jPDL [Back button error!]
              theute

              Yes there is a bug that you found on the DVDdemo store, please report it on Jira. It seems related on back button when a conversation ends on a stateful session bean.

              There is no back="enabled" in that example, so if a user click on back and try to ship again, it should bring the user to the page he was before clicking back (without "shipping" again). But again, there is a bug on that particular case that we need to fix.

              By default back is disabled.

              • 4. Re: Stateful behaviour jPDL [Back button error!]

                Actually, the back button is working ok in this case. The actual fundamental problem here is that BusinessProcessInterceptor and the @EndTask annotation. The EndTask throws an exception because there is no task associated with that method, even though though the conversational interceptor did the right thing and redirected. I opened JBSEAM-287 for this issue.

                There are some other things in the ship task that don't play nicely with the back button. I'll fix up the DVD store examples tonight to illustrate how to better deal with back button.

                • 5. Re: Stateful behaviour jPDL [Back button error!]
                  gavin.king

                  Actually, I think we have several related issues here, eg:

                  http://jira.jboss.com/jira/browse/JBSEAM-284

                  • 6. Re: Stateful behaviour jPDL [Back button error!]
                    gavin.king

                     

                    "thomas.heute@jboss.com" wrote:
                    I just fixed the problem you faced in the number guess example.

                    You can see the back-button disabled in any conversation, try the DVD registration or the booking example.


                    This actually resulted from a Bad bug in Seam where redirects that occurred during the RESTORE_VIEW phase (such as illegal navigation redirects) were causing Seam to not clean up properly after itself. Very Bad!

                    Anyway, fixed now in CVS. Hopefully I did not break something else ;-)

                    • 7. Re: Stateful behaviour jPDL [Back button error!]
                      gavin.king

                      This thread motivated me to go off and fix a bunch of related problems. I think if you try out the CVS version of the DVD store, you'll be much happier with how it handles backbuttoning ;-)

                      Thanks :)

                      • 8. Re: Stateful behaviour jPDL [Back button error!]
                        marcobuss

                        I`m also very interesting in handling the backbuttoning.

                        How is Seam recognisees the use of the Back-Button?

                        • 9. Re: Stateful behaviour jPDL [Back button error!]
                          jcalvert

                          I built the HEAD from CVS of Seam and rebuilt the DVD store application. I was in fact able to produce a bug:

                          1) Add two different titles to the cart.
                          2) Open the cart in two different windows/tabs.
                          3) In the first window/tab, check 'Remove' on the top title, then click the update button.
                          4) Go to the second window/tab where both titles still show. Set the quantity of the first title, (the one that was just deleted) to some value, IE 10, and click update.
                          5) The page refreshes showing the second product with the quantity you just attempted to set on the first.

                          Perhaps this sounds like bizzare behavior to execute on the application. However I'm evaluating Seam as a framework for a re-write of a very workflow oriented web app. The thing that caught my interest was the idea of conversationing to prevent odd things from happening due to back button use as we have many non-savvy users that don't listen to "don't do that". Bizzare things like that happen daily.

                          I understand part of it is that the DVD store application is supposed to be a simple demo, but if there's some way I could modify it such that the application was smart as to the illegality of the action, and handled it properly, that would be great. A big challenge for the application I'm developing on is going back and coding for each individual illegal type action. If it could somehow sense "this person tried to step back in the conversation" elegantly, that would be great!

                          • 10. Re: Stateful behaviour jPDL [Back button error!]
                            theute

                            That's the expected behavior in that scenario since the shopping cart is bound to the Session. (not in a conversation).

                            If you look at other places (like the registration part or the booking demo) where it is using a conversation this would not happen.

                            If it could somehow sense "this person tried to step back in the conversation" elegantly


                            It does it.

                            • 11. Re: Stateful behaviour jPDL [Back button error!]
                              jcalvert

                              Would it be reasonable to make the shopping cart (or any other actionable list of items) conversational as opposed to session bound? In other words such that each hit to the shopping cart is part of a single conversation. Is there a reason why one would not want to do this?

                              There's a similar behavior in the booking demo, as far as having two windows open looking at "Current Bookings" and then canceling one, and then in the other window attempting to cancel that same booking inadvertantly cancels the other. However, the code shows the BookingListAction to be SESSION scope, so I assume that's why.

                              • 12. Re: Stateful behaviour jPDL [Back button error!]
                                theute

                                 

                                "jcalvert" wrote:
                                Would it be reasonable to make the shopping cart (or any other actionable list of items) conversational as opposed to session bound? In other words such that each hit to the shopping cart is part of a single conversation. Is there a reason why one would not want to do this?


                                You could

                                "jcalvert" wrote:
                                There's a similar behavior in the booking demo, as far as having two windows open looking at "Current Bookings" and then canceling one, and then in the other window attempting to cancel that same booking inadvertantly cancels the other. However, the code shows the BookingListAction to be SESSION scope, so I assume that's why


                                Unless i misunderstand the scenario, that would be the expected behavior no ?

                                • 13. Re: Stateful behaviour jPDL [Back button error!]
                                  jcalvert

                                  It might bear adding that the problem I'm thinking of is users in a web application using the back button to go to a previously rendered page that no longer accurately reflects the state of the data. This would be simple enough by simply stamping the page with a sequence to make sure it's not stale, but it's required that we not prohibit the user to make a valid action from that stale page.

                                  • 14. Re: Stateful behaviour jPDL [Back button error!]
                                    theute

                                    Try this: http://dvdstore.demo.jboss.com/new_account.seam

                                    You can see there that if a user press back button (go to a stale page) and try to resubmit the form, Seam detects it and we display an error message (for the sake of showing this in an example)

                                    You can also accept that a user uses the back button in the pageflow (to correct himself), look at the documentation.

                                    1 2 Previous Next