/** * Specialization of State's <code>doEnter</code> template method that executes behaviour specific to this state * type in polymorphic fashion. * <p> * Entering this state, creates the subflow input map and spawns the subflow in the current flow execution. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ protected void doEnter(RequestControlContext context) throws FlowExecutionException { MutableAttributeMap<Object> flowInput; if (subflowAttributeMapper != null) { flowInput = subflowAttributeMapper.createSubflowInput(context); } else { flowInput = new LocalAttributeMap<>(); } Flow subflow = (Flow) this.subflow.getValue(context); if (logger.isDebugEnabled()) { logger.debug("Calling subflow '" + subflow.getId() + "' with input " + flowInput); } context.start(subflow, flowInput); }
/** * Specialization of State's <code>doEnter</code> template method that executes behaviour specific to this state * type in polymorphic fashion. * <p> * Entering this state, creates the subflow input map and spawns the subflow in the current flow execution. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ protected void doEnter(RequestControlContext context) throws FlowExecutionException { MutableAttributeMap<Object> flowInput; if (subflowAttributeMapper != null) { flowInput = subflowAttributeMapper.createSubflowInput(context); } else { flowInput = new LocalAttributeMap<>(); } Flow subflow = (Flow) this.subflow.getValue(context); if (logger.isDebugEnabled()) { logger.debug("Calling subflow '" + subflow.getId() + "' with input " + flowInput); } context.start(subflow, flowInput); }
/** * Specialization of State's <code>doEnter</code> template method that executes behaviour specific to this state * type in polymorphic fashion. * <p> * Entering this state, creates the subflow input map and spawns the subflow in the current flow execution. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ protected void doEnter(RequestControlContext context) throws FlowExecutionException { MutableAttributeMap flowInput; if (subflowAttributeMapper != null) { flowInput = subflowAttributeMapper.createSubflowInput(context); } else { flowInput = new LocalAttributeMap(); } Flow subflow = (Flow) this.subflow.getValue(context); if (logger.isDebugEnabled()) { logger.debug("Calling subflow '" + subflow.getId() + "' with input " + flowInput); } context.start(subflow, flowInput); }
/** * Specialization of State's <code>doEnter</code> template method that executes behaviour specific to this state * type in polymorphic fashion. * <p> * Entering this state, creates the subflow input map and spawns the subflow in the current flow execution. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @return a view selection containing model and view information needed to render the results of the state * execution * @throws FlowExecutionException if an exception occurs in this state */ protected ViewSelection doEnter(RequestControlContext context) throws FlowExecutionException { if (logger.isDebugEnabled()) { logger.debug("Spawning subflow '" + getSubflow().getId() + "' within flow '" + getFlow().getId() + "'"); } return context.start(getSubflow(), createSubflowInput(context)); }
public ViewSelection start(MutableAttributeMap input, ExternalContext externalContext) throws FlowExecutionException { Assert.state(!isActive(), "This flow is already executing -- you cannot call 'start()' more than once"); if (logger.isDebugEnabled()) { logger.debug("Starting execution with input '" + input + "'"); } RequestControlContext context = createControlContext(externalContext); getListeners().fireRequestSubmitted(context); try { try { // launch a flow session for the root flow ViewSelection selectedView = context.start(flow, input); return pause(context, selectedView); } catch (FlowExecutionException e) { return pause(context, handleException(e, context)); } catch (Exception e) { return pause(context, handleException(wrapException(e), context)); } } finally { getListeners().fireRequestProcessed(context); } }