use of org.springframework.webflow.action.EvaluateAction in project cas by apereo.
the class AbstractCasWebflowConfigurer method addActionsToActionStateExecutionListAt.
/**
* Add actions to action state execution list at.
*
* @param flow the flow
* @param actionStateId the action state id
* @param position the position
* @param actions the actions
*/
public void addActionsToActionStateExecutionListAt(final Flow flow, final String actionStateId, final int position, final EvaluateAction... actions) {
val actionState = getState(flow, actionStateId, ActionState.class);
val actionList = actionState.getActionList();
val currentActions = new ArrayList<Action>(actionList.size() + actions.length);
actionList.forEach(currentActions::add);
val index = position < 0 || position == Integer.MAX_VALUE ? currentActions.size() : position;
currentActions.forEach(actionList::remove);
Arrays.stream(actions).forEach(a -> currentActions.add(index, a));
actionList.addAll(currentActions.toArray(Action[]::new));
}
use of org.springframework.webflow.action.EvaluateAction in project cas by apereo.
the class CasWebflowConfigurerTests method verifyExpression.
@Test
public void verifyExpression() {
val registry = mock(FlowDefinitionRegistry.class);
val fbs = mock(FlowBuilderServices.class);
when(fbs.getConversionService()).thenReturn(mock(ConversionService.class));
val cfg = new AbstractCasWebflowConfigurer(fbs, registry, new StaticApplicationContext(), new CasConfigurationProperties()) {
};
val action = new EvaluateAction(cfg.createExpression("example"), cfg.createExpression("result"));
assertNotNull(cfg.getExpressionStringFromAction(action));
}
Aggregations