/** * Factory method that creates a new end state, a state where an executing flow session terminates. This method is * an atomic operation that returns a fully initialized state. It encapsulates the selection of the end 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 viewSelector the state confirmation view selector strategy; may be null * @param outputMapper the state output mapper; may be null * @param exceptionHandlers any exception handlers; 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 subflow state instance * @throws FlowArtifactLookupException an exception occured creating the state */ public State createEndState(String id, Flow flow, Action[] entryActions, ViewSelector viewSelector, AttributeMapper outputMapper, FlowExecutionExceptionHandler[] exceptionHandlers, AttributeMap attributes) throws FlowArtifactLookupException { EndState endState = new EndState(flow, id); if (viewSelector != null) { endState.setViewSelector(viewSelector); } if (outputMapper != null) { endState.setOutputMapper(outputMapper); } configureCommonProperties(endState, entryActions, exceptionHandlers, attributes); return endState; }