/** * Builds any start actions to execute when the flow starts. * @throws FlowBuilderException an exception occurred building the flow */ public void buildStartActions() throws FlowBuilderException { getFlow().getStartActionList().addAll(parseActions(flowModel.getOnStartActions())); }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap<?> attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Builds any end actions to execute when the flow ends. * @throws FlowBuilderException an exception occurred building the flow */ public void buildEndActions() throws FlowBuilderException { getFlow().getEndActionList().addAll(parseActions(flowModel.getOnEndActions())); }
/** * 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; }
/** * Configure common properties for a state. */ private void configureCommonProperties(State state, Action[] entryActions, FlowExecutionExceptionHandler[] exceptionHandlers, AttributeMap<?> attributes) { state.getEntryActionList().addAll(entryActions); state.getExceptionHandlerSet().addAll(exceptionHandlers); state.getAttributes().putAll(attributes); } }
/** * Factory method that creates a new view state, a state where a user is allowed to participate in the flow. This * method is an atomic operation that returns a fully initialized state. It encapsulates the selection of the view * 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 viewFactory the state view factory strategy * @param redirect whether to send a flow execution redirect before rendering * @param popup whether to display the view in a popup window * @param renderActions any 'render actions' to execute on entry and refresh; may be null * @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 view state instance */ public State createViewState(String id, Flow flow, ViewVariable[] variables, Action[] entryActions, ViewFactory viewFactory, Boolean redirect, boolean popup, Action[] renderActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap<?> attributes) { ViewState viewState = new ViewState(flow, id, viewFactory); viewState.addVariables(variables); viewState.setRedirect(redirect); viewState.setPopup(popup); viewState.getRenderActionList().addAll(renderActions); configureCommonProperties(viewState, entryActions, transitions, exceptionHandlers, exitActions, attributes); return viewState; }
private FlowExecutionExceptionHandler parseTransitionExecutingExceptionHandler(TransitionModel transition) { TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler(); Class<Throwable> exceptionClass = toClass(transition.getOnException(), Throwable.class); TargetStateResolver targetStateResolver = (TargetStateResolver) fromStringTo(TargetStateResolver.class) .execute(transition.getTo()); handler.add(exceptionClass, targetStateResolver); handler.getActionList().addAll(parseActions(transition.getActions())); return handler; }
private void parseAndAddEndActions(Element element, Flow flow) { Element endElement = getChildElementByTagName(element, END_ACTIONS_ELEMENT); if (endElement != null) { flow.getEndActionList().addAll(parseAnnotatedActions(endElement)); } }
@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; }
/** * Builds any end actions to execute when the flow ends. * @throws FlowBuilderException an exception occurred building the flow */ public void buildEndActions() throws FlowBuilderException { getFlow().getEndActionList().addAll(parseActions(flowModel.getOnEndActions())); }
/** * Builds any start actions to execute when the flow starts. * @throws FlowBuilderException an exception occurred building the flow */ public void buildStartActions() throws FlowBuilderException { getFlow().getStartActionList().addAll(parseActions(flowModel.getOnStartActions())); }
/** * Builds any end actions to execute when the flow ends. * @throws FlowBuilderException an exception occurred building the flow */ public void buildEndActions() throws FlowBuilderException { getFlow().getEndActionList().addAll(parseActions(flowModel.getOnEndActions())); }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Configure common properties for a transitionable state. */ private void configureCommonProperties(TransitionableState state, Action[] entryActions, Transition[] transitions, FlowExecutionExceptionHandler[] exceptionHandlers, Action[] exitActions, AttributeMap<?> attributes) { configureCommonProperties(state, entryActions, exceptionHandlers, attributes); state.getTransitionSet().addAll(transitions); state.getExitActionList().addAll(exitActions); }
/** * Builds any start actions to execute when the flow starts. * @throws FlowBuilderException an exception occurred building the flow */ public void buildStartActions() throws FlowBuilderException { getFlow().getStartActionList().addAll(parseActions(flowModel.getOnStartActions())); }
/** * Configure common properties for a state. */ private void configureCommonProperties(State state, Action[] entryActions, FlowExecutionExceptionHandler[] exceptionHandlers, AttributeMap<?> attributes) { state.getEntryActionList().addAll(entryActions); state.getExceptionHandlerSet().addAll(exceptionHandlers); state.getAttributes().putAll(attributes); } }
private FlowExecutionExceptionHandler parseTransitionExecutingExceptionHandler(TransitionModel transition) { TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler(); Class<Throwable> exceptionClass = toClass(transition.getOnException(), Throwable.class); TargetStateResolver targetStateResolver = (TargetStateResolver) fromStringTo(TargetStateResolver.class) .execute(transition.getTo()); handler.add(exceptionClass, targetStateResolver); handler.getActionList().addAll(parseActions(transition.getActions())); return handler; }
private FlowExecutionExceptionHandler parseTransitionExecutingExceptionHandler(TransitionModel transition) { TransitionExecutingFlowExecutionExceptionHandler handler = new TransitionExecutingFlowExecutionExceptionHandler(); Class exceptionClass = toClass(transition.getOnException()); TargetStateResolver targetStateResolver = (TargetStateResolver) fromStringTo(TargetStateResolver.class) .execute(transition.getTo()); handler.add(exceptionClass, targetStateResolver); handler.getActionList().addAll(parseActions(transition.getActions())); return handler; }