/** * Factory method that creates a new action state, a state where a system action is executed. This method is an * atomic operation that returns a fully initialized state. It encapsulates the selection of the action state * implementation as well as the state assembly. * @param id the identifier to assign to the state, must be unique to its owning flow (required) * @param flow the flow that will own (contain) this state (required) * @param entryActions any state entry actions; may be null * @param actions the actions to execute when the state is entered (required) * @param transitions any transitions (paths) out of this state; may be null * @param exceptionHandlers any exception handlers; may be null * @param exitActions any state exit actions; may be null * @param attributes attributes to assign to the State, which may also be used to affect state construction; may be * null * @return the fully initialized action state instance */ public State createActionState(String id, Flow flow, Action[] entryActions, Action[] actions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap<?> attributes) { ActionState actionState = new ActionState(flow, id); actionState.getActionList().addAll(actions); configureCommonProperties(actionState, entryActions, transitions, exceptionHandlers, exitActions, attributes); return actionState; }
@Override public ActionState createActionState(final Flow flow, final String name, final Action... actions) { if (containsFlowState(flow, name)) { LOGGER.trace("Flow [{}] already contains a definition for state id [{}]", flow.getId(), name); return getTransitionableState(flow, name, ActionState.class); } val actionState = new ActionState(flow, name); LOGGER.trace("Created action state [{}]", actionState.getId()); actionState.getActionList().addAll(actions); LOGGER.trace("Added action to the action state [{}] list of actions: [{}]", actionState.getId(), actionState.getActionList()); return actionState; }
/** * Create action state. * * @param flow the flow * @param name the name * @param actions the actions * @return the action state */ protected ActionState createActionState(final Flow flow, final String name, final Action... actions) { final ActionState actionState = new ActionState(flow, name); logger.debug("Created action state {}", actionState.getId()); actionState.getActionList().addAll(actions); logger.debug("Added action to the action state {} list of actions: {}", actionState.getId(), actionState.getActionList()); return actionState; }
/** * Factory method that creates a new action state, a state where a system action is executed. This method is an * atomic operation that returns a fully initialized state. It encapsulates the selection of the action state * implementation as well as the state assembly. * @param id the identifier to assign to the state, must be unique to its owning flow (required) * @param flow the flow that will own (contain) this state (required) * @param entryActions any state entry actions; may be null * @param actions the actions to execute when the state is entered (required) * @param transitions any transitions (paths) out of this state; may be null * @param exceptionHandlers any exception handlers; may be null * @param exitActions any state exit actions; may be null * @param attributes attributes to assign to the State, which may also be used to affect state construction; may be * null * @return the fully initialized action state instance */ public State createActionState(String id, Flow flow, Action[] entryActions, Action[] actions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap<?> attributes) { ActionState actionState = new ActionState(flow, id); actionState.getActionList().addAll(actions); configureCommonProperties(actionState, entryActions, transitions, exceptionHandlers, exitActions, attributes); return actionState; }
/** * Factory method that creates a new action state, a state where a system action is executed. This method is an * atomic operation that returns a fully initialized state. It encapsulates the selection of the action state * implementation as well as the state assembly. * @param id the identifier to assign to the state, must be unique to its owning flow (required) * @param flow the flow that will own (contain) this state (required) * @param entryActions any state entry actions; may be null * @param actions the actions to execute when the state is entered (required) * @param transitions any transitions (paths) out of this state; may be null * @param exceptionHandlers any exception handlers; may be null * @param exitActions any state exit actions; may be null * @param attributes attributes to assign to the State, which may also be used to affect state construction; may be * null * @return the fully initialized action state instance * @throws FlowArtifactLookupException an exception occured creating the state */ public State createActionState(String id, Flow flow, Action[] entryActions, Action[] actions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap attributes) throws FlowArtifactLookupException { ActionState actionState = new ActionState(flow, id); actionState.getActionList().addAll(actions); configureCommonProperties(actionState, entryActions, transitions, exceptionHandlers, exitActions, attributes); return actionState; }
/** * Factory method that creates a new action state, a state where a system action is executed. This method is an * atomic operation that returns a fully initialized state. It encapsulates the selection of the action state * implementation as well as the state assembly. * @param id the identifier to assign to the state, must be unique to its owning flow (required) * @param flow the flow that will own (contain) this state (required) * @param entryActions any state entry actions; may be null * @param actions the actions to execute when the state is entered (required) * @param transitions any transitions (paths) out of this state; may be null * @param exceptionHandlers any exception handlers; may be null * @param exitActions any state exit actions; may be null * @param attributes attributes to assign to the State, which may also be used to affect state construction; may be * null * @return the fully initialized action state instance */ public State createActionState(String id, Flow flow, Action[] entryActions, Action[] actions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap attributes) { ActionState actionState = new ActionState(flow, id); actionState.getActionList().addAll(actions); configureCommonProperties(actionState, entryActions, transitions, exceptionHandlers, exitActions, attributes); return actionState; }
final ActionState actionState = new ActionState(flow, "mfaTicketGrantingTicketExistsCheck"); LOGGER.debug("Created action state {}", actionState.getId()); actionState.getActionList().add(createEvaluateAction("validateInitialMfaRequestAction"));
public void setUp() { flow = new Flow("myFlow"); state = new ActionState(flow, "actionState"); new EndState(flow, "finish"); context = new MockRequestControlContext(flow); }