Java Doc for Flow.java in  » Workflow-Engines » spring-webflow-1.0.4 » org » springframework » webflow » engine » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » spring webflow 1.0.4 » org.springframework.webflow.engine 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.webflow.engine.AnnotatedObject
      org.springframework.webflow.engine.Flow

Flow
public class Flow extends AnnotatedObject implements FlowDefinition(Code)
A single flow definition. A Flow definition is a reusable, self-contained controller module that provides the blue print for a user dialog or conversation. Flows typically orchestrate controlled navigations within web applications to guide users through fulfillment of a business process/goal that takes place over a series of steps, modeled as states.

A simple Flow definition could do nothing more than execute an action and display a view all in one request. A more elaborate Flow definition may be long-lived and execute across a series of requests, invoking many possible paths, actions, and subflows.

Especially in Intranet applications there are often "controlled navigations" where the user is not free to do what he or she wants but must follow the guidelines provided by the system to complete a process that is transactional in nature (the quinessential example would be a 'checkout' flow of a shopping cart application). This is a typical use case appropriate to model as a flow.

Structurally a Flow is composed of a set of states. A State is a point in a flow where a behavior is executed; for example, showing a view, executing an action, spawning a subflow, or terminating the flow. Different types of states execute different behaviors in a polymorphic fashion.

Each TransitionableState type has one or more transitions that when executed move a flow to another state. These transitions define the supported paths through the flow.

A state transition is triggered by the occurence of an event. An event is something that happens the flow should respond to, for example a user input event like ("submit") or an action execution result event like ("success"). When an event occurs in a state of a Flow that event drives a state transition that decides what to do next.

Each Flow has exactly one start state. A start state is simply a marker noting the state executions of this Flow definition should start in. The first state added to the flow will become the start state by default.

Flow definitions may have one or more flow exception handlers. A FlowExecutionExceptionHandler can execute custom behavior in response to a specific exception (or set of exceptions) that occur in a state of one of this flow's executions.

Instances of this class are typically built by org.springframework.webflow.engine.builder.FlowBuilder implementations but may also be directly instantiated.

This class and the rest of the Spring Web Flow (SWF) engine have been designed with minimal dependencies on other libraries. Spring Web Flow is usable in a standalone fashion (as well as in the context of other frameworks like Spring MVC, Struts, or JSF, for example). The engine system is fully usable outside an HTTP servlet environment, for example in portlets, tests, or standalone applications. One of the major architectural benefits of Spring Web Flow is the ability to design reusable, high-level controller modules that may be executed in any environment.

Note: flows are singleton definition objects so they should be thread-safe. You can think a flow definition as analagous somewhat to a Java class, defining all the behavior of an application module. The core behaviors Flow.start(RequestControlContext,MutableAttributeMap) start , Flow.onEvent(RequestControlContext) on event , and Flow.end(RequestControlContext,MutableAttributeMap) end each accept a RequestContext request context that allows for this flow to access execution state in a thread safe manner. A flow execution is what models a running instance of this flow definition, somewhat analgous to a java object that is an instance of a class.
See Also:   org.springframework.webflow.engine.State
See Also:   org.springframework.webflow.engine.TransitionableState
See Also:   org.springframework.webflow.engine.ActionState
See Also:   org.springframework.webflow.engine.ViewState
See Also:   org.springframework.webflow.engine.SubflowState
See Also:   org.springframework.webflow.engine.EndState
See Also:   org.springframework.webflow.engine.DecisionState
See Also:   org.springframework.webflow.engine.Transition
See Also:   org.springframework.webflow.engine.FlowExecutionExceptionHandler
author:
   Keith Donald
author:
   Erwin Vervaet
author:
   Colin Sampaleanu



Field Summary
final protected  Loglogger
     Logger, can be used in subclasses.

Constructor Summary
public  Flow(String id)
     Construct a new flow definition with the given id.

Method Summary
protected  voidadd(State state)
     Add given state definition to this flow definition.
public  voidaddInlineFlow(Flow flow)
     Adds an inline flow to this flow.
public  voidaddVariable(FlowVariable variable)
     Adds a flow variable.
public  voidaddVariables(FlowVariable[] variables)
     Adds flow variables.
public  booleancontainsInlineFlow(String id)
     Tests if this flow contains an in-line flow with the specified id.
public  booleancontainsState(String stateId)
    
public  voidend(RequestControlContext context, MutableAttributeMap output)
     Inform this flow definition that an execution session of itself has ended.
public  booleanequals(Object o)
    
public  ActionListgetEndActionList()
     Returns the list of actions executed by this flow when an execution of the flow ends.
public  FlowExecutionExceptionHandlerSetgetExceptionHandlerSet()
     Returns the set of exception handlers, allowing manipulation of how exceptions are handled when thrown during flow execution.
public  TransitionSetgetGlobalTransitionSet()
     Returns the set of transitions eligible for execution by this flow if no state-level transition is matched.
public  StringgetId()
    
public  FlowgetInlineFlow(String id)
     Returns the inline flow with the provided id, or null if no such inline flow exists.
public  intgetInlineFlowCount()
     Returns the count of registered inline flows.
public  String[]getInlineFlowIds()
     Returns the list of inline flow ids.
public  Flow[]getInlineFlows()
     Returns the list of inline flows.
public  AttributeMappergetInputMapper()
     Returns the configured flow input mapper, or null if none.
public  AttributeMappergetOutputMapper()
     Returns the configured flow output mapper, or null if none.
public  ActionListgetStartActionList()
     Returns the list of actions executed by this flow when an execution of the flow starts.
public  StateDefinitiongetStartState()
    
public  StateDefinitiongetState(String stateId)
    
public  intgetStateCount()
     Returns the number of states defined in this flow.
public  String[]getStateIds()
     Convenience accessor that returns an ordered array of the String ids for the state definitions associated with this flow definition.
public  StategetStateInstance(String stateId)
     Lookup the identified state instance of this flow.
public  TransitionableStategetTransitionableState(String stateId)
     Return the TransitionableState with given stateId.
public  FlowVariable[]getVariables()
     Returns the flow variables.
public  ViewSelectionhandleException(FlowExecutionException exception, RequestControlContext context)
     Handle an exception that occured during an execution of this flow.
public  inthashCode()
    
public  ViewSelectiononEvent(RequestControlContext context)
     Inform this flow definition that an event was signaled in the current state of an active flow execution.
protected  voidsetId(String id)
     Set the unique id of this flow.
public  voidsetInputMapper(AttributeMapper inputMapper)
     Sets the mapper to map flow input attributes.
public  voidsetOutputMapper(AttributeMapper outputMapper)
     Sets the mapper to map flow output attributes.
public  voidsetStartState(String stateId)
     Set the start state for this flow to the state with the provided stateId; a state must exist by the provided stateId.
public  voidsetStartState(State state)
     Set the start state for this flow to the state provided; any state may be the start state.
public  ViewSelectionstart(RequestControlContext context, MutableAttributeMap input)
     Start a new session for this flow in its start state.
public  StringtoString()
    

Field Detail
logger
final protected Log logger(Code)
Logger, can be used in subclasses.




Constructor Detail
Flow
public Flow(String id)(Code)
Construct a new flow definition with the given id. The id should be unique among all flows.
Parameters:
  id - the flow identifier




Method Detail
add
protected void add(State state) throws IllegalArgumentException(Code)
Add given state definition to this flow definition. Marked protected, as this method is to be called by the (privileged) state definition classes themselves during state construction as part of a FlowBuilder invocation.
Parameters:
  state - the state to add
throws:
  IllegalArgumentException - when the state cannot be added to theflow; for instance if another state shares the same id as the oneprovided or if given state already belongs to another flow



addInlineFlow
public void addInlineFlow(Flow flow)(Code)
Adds an inline flow to this flow.
Parameters:
  flow - the inline flow to add



addVariable
public void addVariable(FlowVariable variable)(Code)
Adds a flow variable.
Parameters:
  variable - the variable



addVariables
public void addVariables(FlowVariable[] variables)(Code)
Adds flow variables.
Parameters:
  variables - the variables



containsInlineFlow
public boolean containsInlineFlow(String id)(Code)
Tests if this flow contains an in-line flow with the specified id.
Parameters:
  id - the inline flow id true if this flow contains a inline flow with that id, falseotherwise



containsState
public boolean containsState(String stateId)(Code)
Is a state with the provided id present in this flow?
Parameters:
  stateId - the state id true if yes, false otherwise



end
public void end(RequestControlContext context, MutableAttributeMap output) throws FlowExecutionException(Code)
Inform this flow definition that an execution session of itself has ended. As a result, the flow will do the following:
  1. Execute all registered end actions ( Flow.getEndActionList() ).
  2. Map data available in the flow execution control context into provided output map using a registered output mapper ( Flow.setOutputMapper(AttributeMapper) ).

Parameters:
  context - the flow execution control context
Parameters:
  output - initial output produced by the session that is eligible formodification by this method
throws:
  FlowExecutionException - when an exception occurs ending this flow



equals
public boolean equals(Object o)(Code)



getEndActionList
public ActionList getEndActionList()(Code)
Returns the list of actions executed by this flow when an execution of the flow ends. The returned list is mutable. the end action list



getExceptionHandlerSet
public FlowExecutionExceptionHandlerSet getExceptionHandlerSet()(Code)
Returns the set of exception handlers, allowing manipulation of how exceptions are handled when thrown during flow execution. Exception handlers are invoked when an exception occurs at execution time and can execute custom exception handling logic as well as select an error view to display. Exception handlers attached at the flow level have an opportunity to handle exceptions that aren't handled at the state level. the exception handler set



getGlobalTransitionSet
public TransitionSet getGlobalTransitionSet()(Code)
Returns the set of transitions eligible for execution by this flow if no state-level transition is matched. The returned set is mutable. the global transition set



getId
public String getId()(Code)



getInlineFlow
public Flow getInlineFlow(String id) throws IllegalArgumentException(Code)
Returns the inline flow with the provided id, or null if no such inline flow exists.
Parameters:
  id - the inline flow id the inline flow
throws:
  IllegalArgumentException - when an invalid flow id is provided



getInlineFlowCount
public int getInlineFlowCount()(Code)
Returns the count of registered inline flows. the count



getInlineFlowIds
public String[] getInlineFlowIds()(Code)
Returns the list of inline flow ids. a string array of inline flow identifiers



getInlineFlows
public Flow[] getInlineFlows()(Code)
Returns the list of inline flows. the list of inline flows



getInputMapper
public AttributeMapper getInputMapper()(Code)
Returns the configured flow input mapper, or null if none. the input mapper



getOutputMapper
public AttributeMapper getOutputMapper()(Code)
Returns the configured flow output mapper, or null if none. the output mapper



getStartActionList
public ActionList getStartActionList()(Code)
Returns the list of actions executed by this flow when an execution of the flow starts. The returned list is mutable. the start action list



getStartState
public StateDefinition getStartState()(Code)



getState
public StateDefinition getState(String stateId)(Code)



getStateCount
public int getStateCount()(Code)
Returns the number of states defined in this flow. the state count



getStateIds
public String[] getStateIds()(Code)
Convenience accessor that returns an ordered array of the String ids for the state definitions associated with this flow definition. the state ids



getStateInstance
public State getStateInstance(String stateId) throws IllegalArgumentException(Code)
Lookup the identified state instance of this flow.
Parameters:
  stateId - the state id the state
throws:
  IllegalArgumentException - if the identified state cannot be found



getTransitionableState
public TransitionableState getTransitionableState(String stateId) throws IllegalArgumentException, ClassCastException(Code)
Return the TransitionableState with given stateId.
Parameters:
  stateId - id of the state to look up the transitionable state
throws:
  IllegalArgumentException - if the identified state cannot be found
throws:
  ClassCastException - when the identified state is nottransitionable



getVariables
public FlowVariable[] getVariables()(Code)
Returns the flow variables.



handleException
public ViewSelection handleException(FlowExecutionException exception, RequestControlContext context) throws FlowExecutionException(Code)
Handle an exception that occured during an execution of this flow.
Parameters:
  exception - the exception that occured
Parameters:
  context - the flow execution control context the selected error view, or null if no handlermatched or returned a non-null view selection



hashCode
public int hashCode()(Code)



onEvent
public ViewSelection onEvent(RequestControlContext context) throws FlowExecutionException(Code)
Inform this flow definition that an event was signaled in the current state of an active flow execution. The signaled event is the last event available in given request context ( RequestContext.getLastEvent ).
Parameters:
  context - the flow execution control context the selected view
throws:
  FlowExecutionException - when an exception occurs processing theevent



setId
protected void setId(String id)(Code)
Set the unique id of this flow.



setInputMapper
public void setInputMapper(AttributeMapper inputMapper)(Code)
Sets the mapper to map flow input attributes.
Parameters:
  inputMapper - the input mapper



setOutputMapper
public void setOutputMapper(AttributeMapper outputMapper)(Code)
Sets the mapper to map flow output attributes.
Parameters:
  outputMapper - the output mapper



setStartState
public void setStartState(String stateId) throws IllegalArgumentException(Code)
Set the start state for this flow to the state with the provided stateId; a state must exist by the provided stateId.
Parameters:
  stateId - the id of the new start state
throws:
  IllegalArgumentException - when no state exists with the id youprovided



setStartState
public void setStartState(State state) throws IllegalArgumentException(Code)
Set the start state for this flow to the state provided; any state may be the start state.
Parameters:
  state - the new start state
throws:
  IllegalArgumentException - given state has not been added to thisflow



start
public ViewSelection start(RequestControlContext context, MutableAttributeMap input) throws FlowExecutionException(Code)
Start a new session for this flow in its start state. This boils down to the following:
  1. Create (setup) all registered flow variables ( Flow.addVariable(FlowVariable) ) in flow scope.
  2. Map provided input data into the flow execution control context. Typically data will be mapped into flow scope using the registered input mapper ( Flow.setInputMapper(AttributeMapper) ).
  3. Execute all registered start actions ( Flow.getStartActionList() ).
  4. Enter the configured start state ( Flow.setStartState(State) )

Parameters:
  context - the flow execution control context
Parameters:
  input - eligible input into the session
throws:
  FlowExecutionException - when an exception occurs starting the flow



toString
public String toString()(Code)



Fields inherited from org.springframework.webflow.engine.AnnotatedObject
final public static String CAPTION_PROPERTY(Code)(Java Doc)
final public static String DESCRIPTION_PROPERTY(Code)(Java Doc)

Methods inherited from org.springframework.webflow.engine.AnnotatedObject
public MutableAttributeMap getAttributeMap()(Code)(Java Doc)
public AttributeMap getAttributes()(Code)(Java Doc)
public String getCaption()(Code)(Java Doc)
public String getDescription()(Code)(Java Doc)
public void setCaption(String caption)(Code)(Java Doc)
public void setDescription(String description)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.