Announcement Announcement Module
Collapse
No announcement yet.
Question about subflows, flowExecutionIds and eventIds Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about subflows, flowExecutionIds and eventIds

    Just a question regarding how flowExecutionIds and eventIds are handled within subflows. I have a fairly simple situation where I'm going from a list view to a detail view. The detail view is already modelled as it's own flow, so I'm trying to get the list -> detail transition as a subflow. In the hyperlink from the list view to the detail view, I have the flowExecutionId and an eventId from the 'parent' flow in the querystring. When I get to the detail screen, there is a hidden field which contains the flowExecutionId.

    Now the first query: is the flowExecutionId in that hidden field supposed to be the same flowExecutionId of the 'parent' flow? In my little test app, it always is. However, in the flowlauncher sample app, it never is. I am having some trouble getting the flowlauncher app working properly though (see http://forum.springframework.org/showthread.php?t=15818), so I'm not sure what the behaviour is supposed to be.

    One other thing: the eventId triggering the subflow (i.e. the one in the hyperlink on the list page) is 'select', and the eventId for making changes on the detail page is 'submit'. However, when I do a submit having come from the list page, I get a ClassCastException in the getFlowExecutionId method in the FlowExecutionManager class. While the framework is getting the value of the _eventId parameter, it is getting an array containing 'select' and 'submit'. It is then trying to cast that to a String.

    What behaviour is supposed to happen here? Am I doing something incorrectly?

    Geoff
    Last edited by robyn; May 16th, 2006, 03:50 AM.

  • #2
    Now the first query: is the flowExecutionId in that hidden field supposed to be the same flowExecutionId of the 'parent' flow? In my little test app, it always is. However, in the flowlauncher sample app, it never is.
    There are different behaviours if you are using different storages , flowlauncher - HttpSessionContinuationFlowExecutionStorage and your application may be HttpSessionFlowExecutionStorage ... ...once you use continuation , it seems "the flow" have to record every stages you went b4 ...

    moon

    Comment


    • #3
      OK, after playing around with the configuration of the FlowController, I can get the same result as the flowlauncher example if I use the HttpSessionContinuationFlowExecutionStorage implementation. Thanks for pointing me in the right direction. However, this still doesn't answer my query about the ClassCastException that I am getting because both the eventId from the parent flow and the subflow are being returned in an array. Is there any way around that?

      Geoff

      Comment


      • #4
        Usually, whenever I get a ClassCastException is because I am trying to force a casting between incompatible objects. So somewhere within your code (perhaps, when you are getting an attribute/parameter from the flow scope ) you are casting an object to the wrong type.

        Anyway, all this is mere speculation. Difficult to help if the forum cannot see your stacktrace or the code in your action classes.

        _CJ

        Comment


        • #5
          Can you provide the stack trace and more context about when it happens?

          Comment


          • #6
            Certainly. Here is the stack trace:

            Code:
            java.lang.ClassCastException: [Ljava.lang.String;
            	at org.springframework.web.flow.execution.FlowExecutionManager.getFlowExecutionId(FlowExecutionManager.java:357)
            	at org.springframework.web.flow.execution.FlowExecutionManager.onEvent(FlowExecutionManager.java:260)
            	at org.springframework.web.flow.execution.FlowExecutionManager.onEvent(FlowExecutionManager.java:245)
            	at org.springframework.web.flow.execution.servlet.ServletFlowExecutionManager.handle(ServletFlowExecutionManager.java:77)
            	at org.springframework.web.flow.mvc.FlowController.handleRequestInternal(FlowController.java:137)
            	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:128)
            	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
            	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
            	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
            	at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386)
            	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:355)
            	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172)
            	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
            	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
            	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
            	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
            	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
            	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
            	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
            	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
            	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
            	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
            	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
            	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            	at java.lang.Thread.run(Thread.java:595)
            Debugging through shows that it is trying to convert an array of Strings to a String. It occurs when I trigger an event in the subflow. At some point while processing that event, the framework tries to get the value of the _eventId parameter. By design or otherwise, there are two values for the _eventId parameter returned: the _eventId value from the 'parent' flow (in my case, it is 'select') and the _eventId just triggered from the subflow (in my case, 'submit'). These two values are returned in an array which the framework then attempts to cast to a String.

            I've tried this with both the HttpSessionFlowExecutionStorage and the HttpSessionContinuationFlowExecutionStorage with the same result.

            Geoff

            Comment


            • #7
              This problem should be fixed in CVS. There is only one "last event" the web flow system reasons on at any point (of the Event class) which has a single ID parameter.

              Comment


              • #8
                Thanks Keith. Is the CVS repository still in a state of flux?

                Geoff

                Comment


                • #9
                  The core webflow system should be stable in CVS in spring-projects/spring-webflow and that will be its permanent home. Things to note though: we still have portlets to add back (now that we've nearly decided where the Portlet integration where be hosted) and some of the samples as well.

                  Comment

                  Working...
                  X