Search in sources :

Example 1 with FlowExecutionExceptionHandler

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

the class AbstractCasWebflowConfigurer method cloneActionState.

/**
 * Clone action state.
 *
 * @param source the source
 * @param target the target
 */
public void cloneActionState(final ActionState source, final ActionState target) {
    source.getActionList().forEach(a -> target.getActionList().add(a));
    source.getExitActionList().forEach(a -> target.getExitActionList().add(a));
    source.getAttributes().asMap().forEach((k, v) -> target.getAttributes().put(k, v));
    source.getTransitionSet().forEach(t -> target.getTransitionSet().addAll(t));
    final Field field = ReflectionUtils.findField(target.getExceptionHandlerSet().getClass(), "exceptionHandlers");
    ReflectionUtils.makeAccessible(field);
    final List<FlowExecutionExceptionHandler> list = (List<FlowExecutionExceptionHandler>) ReflectionUtils.getField(field, target.getExceptionHandlerSet());
    list.forEach(h -> source.getExceptionHandlerSet().add(h));
    target.setDescription(source.getDescription());
    target.setCaption(source.getCaption());
}
Also used : Field(java.lang.reflect.Field) FlowExecutionExceptionHandler(org.springframework.webflow.engine.FlowExecutionExceptionHandler) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 FlowExecutionExceptionHandler (org.springframework.webflow.engine.FlowExecutionExceptionHandler)1