• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to come enter web flow at a specific point

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an application in which I come across a page which populates the data and then goes to the next page. As i am using web flow, to populate the date in the page I have redirected to a controller from the web flow which takes care of displaying the page. Once that page is done and as I click submit it need to move to the next page describe in the web flow. As i redirected to the controller I came out of web flow. How do I reenter the webflow at the specific point where I exited.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't re-enter. You could create a subflow and that subflow can be a flow in and of itself too. So that your start in the subflow. That is one way to simulate entering at a specific point.

But the point of webflow is that you start at the start and end at the end.

Why is the Controller throwing you out of the flow? I would actually try to fix that configuration. It shouldn't take you to the end of the flow, or out of the flow.

Mark
 
VenkataPrasad Regula
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to display the results on the page for which I used a controller. To execute the controller, I used the command
<view-state id="custList" view="externalRedirect:/customerList.html"/>
To my knowledge this transfers the control from the web flow to controller(web MVC). So I started doubting how to come back to flow again at that specific point after the list is being displayed.
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

VenkataPrasad Regula wrote:I want to display the results on the page for which I used a controller. To execute the controller, I used the command
<view-state id="custList" view="externalRedirect:/customerList.html"/>
To my knowledge this transfers the control from the web flow to controller(web MVC). So I started doubting how to come back to flow again at that specific point after the list is being displayed.



Can't be done. Basically a Flow is one single URL. There is an execution code in the URL that Spring WebFlow keeps track of it. Also so that if you were to try to get into the flow other than the beginning, Spring Web Flow will take you to the beginning of the flow.

To me, redirecting out the flow is an end of the flow. Logically it makes no sense to re-enter in the middle if you are done with the flow. You can break your flow into two flows and one be a subflow of the other, so that if you do go out of the flow, you can start a brand new flow being just the subflow. Then the subflow just becomes a single flow by itself, which is like starting at the middle.

Otherwise, you will not be able to leave the flow in the middle and come back.

Mark
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's been a while since this post has been touched, but I thought I might add to the discussion as I was looking for a more elegant solution than what I have come up with...

I have created decision-states that run at the start of the parent flow and the sub-flow. These decision states look at flowScope variables that I have configured to be passed between the two flows. These variables tell the code which view-state within the flow should be the start of the flow.

Here is a snippet of my code:



Action class:



And in case you're curious about the "super.getObjectFromFlowScope", here's the code that it runs:

 
reply
    Bookmark Topic Watch Topic
  • New Topic