private void createTransitionToInjectSurrogateIntoFlow(final Flow flow) {
        val actionState = getState(flow, CasWebflowConstants.STATE_ID_REAL_SUBMIT, ActionState.class);

        LOGGER.debug("Locating transition id [{}] to for state [{}", CasWebflowConstants.TRANSITION_ID_SUCCESS, actionState.getId());
        val targetSuccessId = actionState.getTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS).getTargetStateId();

        val loadSurrogatesAction = createActionState(flow, CasWebflowConstants.STATE_ID_LOAD_SURROGATES_ACTION,
            CasWebflowConstants.ACTION_ID_LOAD_SURROGATES_LIST_ACTION);
        createTransitionForState(loadSurrogatesAction, CasWebflowConstants.TRANSITION_ID_SUCCESS, targetSuccessId);
        createTransitionForState(loadSurrogatesAction, CasWebflowConstants.TRANSITION_ID_SURROGATE_VIEW, CasWebflowConstants.STATE_ID_SURROGATE_VIEW);
        createTransitionForState(loadSurrogatesAction, CasWebflowConstants.TRANSITION_ID_SURROGATE_WILDCARD_VIEW, CasWebflowConstants.STATE_ID_SURROGATE_WILDCARD_VIEW);
        createTransitionForState(loadSurrogatesAction, CasWebflowConstants.TRANSITION_ID_SKIP_SURROGATE, targetSuccessId);
        createTransitionForState(loadSurrogatesAction, CasWebflowConstants.TRANSITION_ID_ERROR, CasWebflowConstants.STATE_ID_VIEW_LOGIN_FORM);
        createTransitionForState(actionState, CasWebflowConstants.TRANSITION_ID_SUCCESS, loadSurrogatesAction.getId(), true);

    }
Create surrogate list view state.

@param flow the flow
support/cas-server-support-surrogate-webflow/src/main/java/org/apereo/cas/web/flow/SurrogateWebflowConfigurer.java