嗨,我将使用一种方法完成支持 bean 的流程步骤:
transition(FacesContext context, Flow sourceFlow, Flow targetFlow, FlowCallNode outboundCallNode, String toViewId);
的
javax.faces.flow.FlowHandler
或其他方式
例如:
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");
}
}
可以在支持bean中做到这一点吗?或者 meaby 是其他方法吗?