0
votes

I have a web application where a user can start a search from almost all pages of the application.

Every time a user searches I would like to start a new flow, so basically I have:

<p:commandLink action="#{myBean.startNewSearch}" .../>

public void startNewSearch(){
    //Some validations and pre-conditions
    Faces.navigate("exitSearchFlow");
    //Perform search
    return "startSearchFlow";
}

I can see with the loggers that the flow is started and the flow is finished but jfwid never changes (I'm using faces-redirect=true, the form parameter does not change either).

How can I do that?

1

1 Answers

0
votes

You must define the sub flows inside your main flow. Define a Flow for search, and inside your search-flow define the other flows, using the flow-call. ex:

 <flow-definition id="searchFlow">
        <flow-call id="subFlowA">
        <flow-reference>
            <flow-id>subFlowA-File-ID</flow-id>
        </flow-reference>
        </flow-call>
        <flow-call id="subFlowB">
        </flow-call>
 </flow-definition>

You can pass parameters to the sub flow. To call the sub flows use the Id of the Flow-Call. Ex:

<h:commandButton value="Call Flow A" action="subFlowA"/>

You can find details in the following link:

JSF Flows