Search in sources :

Example 1 with DecisionState

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

the class AbstractCasWebflowConfigurer method createDecisionState.

@Override
public DecisionState createDecisionState(final Flow flow, final String id, final String testExpression, final String thenStateId, final String elseStateId) {
    if (containsFlowState(flow, id)) {
        LOGGER.debug("Flow [{}] already contains a definition for state id [[{}]]", flow.getId(), id);
        return (DecisionState) flow.getTransitionableState(id);
    }
    final DecisionState decisionState = new DecisionState(flow, id);
    final Expression expression = createExpression(testExpression, Boolean.class);
    final Transition thenTransition = createTransition(expression, thenStateId);
    decisionState.getTransitionSet().add(thenTransition);
    final Transition elseTransition = createTransition("*", elseStateId);
    decisionState.getTransitionSet().add(elseTransition);
    return decisionState;
}
Also used : Expression(org.springframework.binding.expression.Expression) LiteralExpression(org.springframework.binding.expression.support.LiteralExpression) Transition(org.springframework.webflow.engine.Transition) DecisionState(org.springframework.webflow.engine.DecisionState)

Example 2 with DecisionState

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

the class OpenIdWebflowConfigurer method doInitialize.

@Override
protected void doInitialize() throws Exception {
    final Flow flow = getLoginFlow();
    if (flow != null) {
        final String condition = getOpenIdModeCondition();
        final DecisionState decisionState = createDecisionState(flow, "selectFirstAction", condition, OPEN_ID_SINGLE_SIGN_ON_ACTION, getStartState(flow).getId());
        final ActionState actionState = createActionState(flow, OPEN_ID_SINGLE_SIGN_ON_ACTION, createEvaluateAction(OPEN_ID_SINGLE_SIGN_ON_ACTION));
        actionState.getTransitionSet().add(createTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS, CasWebflowConstants.TRANSITION_ID_SEND_TICKET_GRANTING_TICKET));
        actionState.getTransitionSet().add(createTransition(CasWebflowConstants.TRANSITION_ID_ERROR, getStartState(flow).getId()));
        actionState.getTransitionSet().add(createTransition(CasWebflowConstants.TRANSITION_ID_WARN, CasWebflowConstants.TRANSITION_ID_WARN));
        actionState.getExitActionList().add(createEvaluateAction("clearWebflowCredentialsAction"));
        registerMultifactorProvidersStateTransitionsIntoWebflow(actionState);
        setStartState(flow, decisionState);
    }
}
Also used : DecisionState(org.springframework.webflow.engine.DecisionState) ActionState(org.springframework.webflow.engine.ActionState) Flow(org.springframework.webflow.engine.Flow)

Example 3 with DecisionState

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

the class Pac4jWebflowConfigurer method createSaml2ClientLogoutAction.

private void createSaml2ClientLogoutAction() {
    final Flow logoutFlow = getLogoutFlow();
    final DecisionState state = (DecisionState) logoutFlow.getState(CasWebflowConstants.STATE_UD_FINISH_LOGOUT);
    state.getEntryActionList().add(saml2ClientLogoutAction);
}
Also used : DecisionState(org.springframework.webflow.engine.DecisionState) Flow(org.springframework.webflow.engine.Flow)

Aggregations

DecisionState (org.springframework.webflow.engine.DecisionState)3 Flow (org.springframework.webflow.engine.Flow)2 Expression (org.springframework.binding.expression.Expression)1 LiteralExpression (org.springframework.binding.expression.support.LiteralExpression)1 ActionState (org.springframework.webflow.engine.ActionState)1 Transition (org.springframework.webflow.engine.Transition)1