0

In normal way to enter to flow or go from some page to next page in flow we use

   <h:commandButton> or <h:commandLink>

But how is it possible to enter to flow or go to the next page in flow (if we currently are in flow) from backing bean?

I try to dispatch from faces context but it doesn't work. Do you know how to do it?

I use only viewnode pages. I configure a flow using a

      @FlowDefinition
      @Producent
      @Flowdefinition
               public Flow defineFlow(@FlowbuilderParameter FlowBuilder FlowBuilder){ 
     flowBuilder.id("","registerFlow");
          flowBuilder.viewNode("registerStart","/faces/start.xhtm").Markasstartnode();
flowBuilder.viewNode("step2","/faces/step2.xhtm");
     …
     }

And now i would enter to flow from backing bean. Something like

      FacesContext.getCurrenInstance().getExternalContext().dispatch("registerFlow");

I think possible i have to use FlowHandler from context

   FlowHandler handler = FacesContext.getApplication().getFlowHandler();
   handler.transition(); // and what next?

    how here i can redirect user to some viewnode of flow?
JanPl
  • 794
  • 6
  • 19
Michał Ziembiński
  • 1,124
  • 2
  • 10
  • 31
  • 1
    It depends. You need to provide more info in order we can help you. What type of flow are you using: view nodes, method call, ...? Can you provide what configuration do you have? – malaguna Sep 22 '15 at 09:45
  • Regardless of the problem and solution, never use `ExternalContext#dispatch()`. That method is a leftover from JSF 1.x and should never have existed in JSF. – BalusC Sep 22 '15 at 10:48
  • But i still dont know how i can navigate through flow under backing bean. I know how to do it in jsf view but not in backing bean – Michał Ziembiński Sep 22 '15 at 10:51

0 Answers0