File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes how to come enter web flow at a specific point Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "how to come enter web flow at a specific point" Watch "how to come enter web flow at a specific point" New topic
Author

how to come enter web flow at a specific point

VenkataPrasad Regula
Ranch Hand

Joined: Jun 30, 2011
Posts: 63
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.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
VenkataPrasad Regula
Ranch Hand

Joined: Jun 30, 2011
Posts: 63
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
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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
Kerry Baer
Ranch Hand

Joined: Jun 23, 2010
Posts: 39
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:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to come enter web flow at a specific point
 
Similar Threads
Handle multiple jsp pages in session : Spring app
How to pass an object between MVC controllers?
Spring Web Flow 2 Web Development
How exactly controller controls the flow
making sense of MVC