Hi i would go through steps of flow in backing bean using a method:
transition(FacesContext context, Flow sourceFlow, Flow targetFlow, FlowCallNode outboundCallNode, String toViewId);
of
javax.faces.flow.FlowHandler
or some other way
for example:
public void startFlow(){
// in this example we dont use jsf tags
// (<h:commandButton /> and <h:commandLink />) to navigate user through flow steps
FlowHandler handler = context.getApplication().getFlowHandler();
Flow targetFlow = handler.getFlow(context, "", "registerFlow");
boolean isAdmin = checkIfAdmin();
if(isAdmin){
// here we forward user to viewNode of flow that name step1
handler.transition(context, null, targetFlow, null, "step1");
}
else{
// here we forward user to viewNode of flow that name step1ForAdmin
handler.transition(context, null, targetFlow, null, "step1ForAdmin");
}
}
It is possible to do that in backing bean? or meaby is other way to do that?