public static void notifyBeforeListeners(PhaseId phaseId, Lifecycle lifecycle, FacesContext context) {
PhaseEvent beforePhaseEvent = new PhaseEvent(context, phaseId, lifecycle);
for (int i = 0; i < lifecycle.getPhaseListeners().length; i++) {
PhaseListener listener = lifecycle.getPhaseListeners()[i];
if (listener.getPhaseId() == phaseId || listener.getPhaseId() == PhaseId.ANY_PHASE) {
listener.beforePhase(beforePhaseEvent);
}
}
}
public static boolean isFlowRequest() {