private void ensureEndStateTransitionExists(final TransitionableState state,
                                                final Flow mfaProviderFlow,
                                                final String transId,
                                                final String stateId) {
        if (!containsTransition(state, transId)) {
            createTransitionForState(state, transId, stateId);
            if (!containsFlowState(mfaProviderFlow, stateId)) {
                createEndState(mfaProviderFlow, stateId);
            }
        }
    }
Register flow definition into flow registry.
core/cas-server-core-webflow-mfa-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasMultifactorWebflowConfigurer.java