org.springframework.webflow.engine
Class DecisionState

java.lang.Object
  extended by org.springframework.webflow.engine.AnnotatedObject
      extended by org.springframework.webflow.engine.State
          extended by org.springframework.webflow.engine.TransitionableState
              extended by org.springframework.webflow.engine.DecisionState
All Implemented Interfaces:
Annotated, StateDefinition, TransitionableStateDefinition

public class DecisionState
extends TransitionableState

A simple transitionable state that when entered will execute the first transition whose matching criteria evaluates to true in the context of the current request.

A decision state is a convenient, simple way to encapsulate reusable state transition logic in one place.

Author:
Keith Donald

Field Summary
 
Fields inherited from class org.springframework.webflow.engine.State
logger
 
Fields inherited from class org.springframework.webflow.engine.AnnotatedObject
CAPTION_PROPERTY, DESCRIPTION_PROPERTY
 
Constructor Summary
DecisionState(Flow flow, java.lang.String stateId)
          Creates a new decision state.
 
Method Summary
protected  ViewSelection doEnter(RequestControlContext context)
          Specialization of State's doEnter template method that executes behaviour specific to this state type in polymorphic fashion.
 
Methods inherited from class org.springframework.webflow.engine.TransitionableState
appendToString, exit, getExitActionList, getRequiredTransition, getTransitions, getTransitionSet, onEvent, reenter
 
Methods inherited from class org.springframework.webflow.engine.State
enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, toString
 
Methods inherited from class org.springframework.webflow.engine.AnnotatedObject
getAttributeMap, getAttributes, getCaption, getDescription, setCaption, setDescription
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.webflow.definition.StateDefinition
getId, getOwner
 
Methods inherited from interface org.springframework.webflow.definition.Annotated
getAttributes, getCaption, getDescription
 

Constructor Detail

DecisionState

public DecisionState(Flow flow,
                     java.lang.String stateId)
              throws java.lang.IllegalArgumentException
Creates a new decision state.

Parameters:
flow - the owning flow
stateId - the state identifier (must be unique to the flow)
Throws:
java.lang.IllegalArgumentException - when this state cannot be added to given flow, e.g. because the id is not unique
Method Detail

doEnter

protected ViewSelection doEnter(RequestControlContext context)
                         throws FlowExecutionException
Specialization of State's doEnter template method that executes behaviour specific to this state type in polymorphic fashion.

Simply looks up the first transition that matches the state of the context and executes it.

Specified by:
doEnter in class State
Parameters:
context - the control context for the currently executing flow, used by this state to manipulate the flow execution
Returns:
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


Copyright © 2004-2007. All Rights Reserved.