Jul 1st, 2009, 05:06 PM
Access external site
I have created a webflow application, site1, that goes through 5 states.
Between states 4 and 5, the application needs to redirect to an external site, site2. My application does this by a form, with an action url defined as follows
The user will interact with the external site and then click a button on the external site to return to the state 5 of the previous site, site1. The external site, site2, redirects using a POST and sends across information in the POST that needs to be used by site1.
1. What is the best way of accessing site 2, subflow or just a normal flow
2. Also what is the best way of retrieiving the posted data from site1
Jul 3rd, 2009, 03:51 AM
No one answers these questions
There seems to be a great reluctance in answering queries with regards to webflow and access to external sites. Is this on purpose or just that people do not know the answer
Jul 6th, 2009, 12:25 PM
To me, at least, it seems to be an unusual case. SWF is designed to encapsulate an entire flow. Breaking out in the middle and returning would strike me as a design smell.
Your approach also depends on what other framework you're using with SWF. If you're using JSF, it may be somewhat ugly, especially if you're trying to bind submitted values to your backing beans. I would imagine using SWF with Spring MVC would be easier for this.
As for getting to site 2, that's also somewhat tricky. I don't think subflows will work, since you will have no control over the flow of things on the external site. You'll need to stay in a view-state somehow, since that's the only state where user interaction is allowed. My suggestion would be to not deal with site 2 in your flow at all. Instead, I would redirect to site 2 from page 4 (I'm assuming this is in a view-state), passing along any parameters it needs, including the postback URL. That way SWF doesn't even need to know of the existance of an external site.