I've got a basic flow example working:
src/main/webapp
|
|- index.xhtml
|- flow1
|- flow1-flow.xml
|- flow1.xhtml
index.xhtml has a simple form that enters the flow with a parameter:
<h:form>
Click to enter flow1
<h:commandButton action="flow1" value="Flow 1">
<f:param name="testInput" value="hi there"/>
</h:commandButton>
</h:form>
flow1.xhtml displays the param and lets you enter a value into flow scope:
<h:form>
Hi this is page 1.
<h:inputText label="Enter something:" value="#{flowScope.testOutput}"/><br/>
Request parameter: #{param['testInput']}<br/>
<h:commandButton action="returnFromFlow1"/>
</h:form>
flow1-flow.xml just defines the return node as "returnFromFlow1" and sets it to /index.xhtml.
This seems to be working. I want to implement post-redirect-get when entering the flow so that the browser address bar stays in sync with the view. So I naturally tried action="flow1?faces-redirect=true". This change prevents the flow from executing.. it simply reloads index.xhtml when the button is clicked.
Then I tried action="flow1/flow1.xhtml?faces-redirect=true". This loads the page and redirects as expected, but the flow is not initialized. When I submit the form in the flow, I get an error about flowScope resolving to null.
Doing a little research, I found a tip to set the "to-flow-document-id" to force it to initialize the flow. So I added to my commandbutton. No change.
Any ideas about how to accomplish this?