Search in sources :

Example 1 with SubflowAttributeMapper

use of org.springframework.webflow.engine.SubflowAttributeMapper in project cas by apereo.

the class AbstractCasWebflowConfigurer method registerMultifactorProviderAuthenticationWebflow.

/**
     * Register multifactor provider authentication webflow.
     *
     * @param flow      the flow
     * @param subflowId the subflow id
     * @param registry  the registry
     */
protected void registerMultifactorProviderAuthenticationWebflow(final Flow flow, final String subflowId, final FlowDefinitionRegistry registry) {
    final SubflowState subflowState = createSubflowState(flow, subflowId, subflowId);
    final ActionState actionState = (ActionState) flow.getState(CasWebflowConstants.TRANSITION_ID_REAL_SUBMIT);
    final String targetStateId = actionState.getTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS).getTargetStateId();
    final List<DefaultMapping> mappings = new ArrayList<>();
    final Mapper inputMapper = createMapperToSubflowState(mappings);
    final SubflowAttributeMapper subflowMapper = createSubflowAttributeMapper(inputMapper, null);
    subflowState.setAttributeMapper(subflowMapper);
    subflowState.getTransitionSet().add(createTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS, targetStateId));
    LOGGER.debug("Retrieved action state [{}]", actionState.getId());
    createTransitionForState(actionState, subflowId, subflowId);
    registerFlowDefinitionIntoLoginFlowRegistry(registry);
    final TransitionableState state = flow.getTransitionableState(CasWebflowConstants.TRANSITION_ID_INITIAL_AUTHN_REQUEST_VALIDATION_CHECK);
    createTransitionForState(state, subflowId, subflowId);
}
Also used : DefaultMapper(org.springframework.binding.mapping.impl.DefaultMapper) SubflowAttributeMapper(org.springframework.webflow.engine.SubflowAttributeMapper) GenericSubflowAttributeMapper(org.springframework.webflow.engine.support.GenericSubflowAttributeMapper) Mapper(org.springframework.binding.mapping.Mapper) SubflowAttributeMapper(org.springframework.webflow.engine.SubflowAttributeMapper) GenericSubflowAttributeMapper(org.springframework.webflow.engine.support.GenericSubflowAttributeMapper) ArrayList(java.util.ArrayList) SubflowState(org.springframework.webflow.engine.SubflowState) DefaultMapping(org.springframework.binding.mapping.impl.DefaultMapping) TransitionableState(org.springframework.webflow.engine.TransitionableState) ActionState(org.springframework.webflow.engine.ActionState)

Aggregations

ArrayList (java.util.ArrayList)1 Mapper (org.springframework.binding.mapping.Mapper)1 DefaultMapper (org.springframework.binding.mapping.impl.DefaultMapper)1 DefaultMapping (org.springframework.binding.mapping.impl.DefaultMapping)1 ActionState (org.springframework.webflow.engine.ActionState)1 SubflowAttributeMapper (org.springframework.webflow.engine.SubflowAttributeMapper)1 SubflowState (org.springframework.webflow.engine.SubflowState)1 TransitionableState (org.springframework.webflow.engine.TransitionableState)1 GenericSubflowAttributeMapper (org.springframework.webflow.engine.support.GenericSubflowAttributeMapper)1