Java Reference
In-Depth Information
Faces Flow
If we take, for example, the case of online registration, the registration form can be
split over several pages, each representing a step. In our case we have: the accept-
ance conditions, entering identification information, contact information, medical in-
formation, school information, and finally the validation. To implement this type of ap-
plication with previous versions of JSF, it was necessary to use beans with session
scope and declare hard links between pages that formed the flow. This reduces the
usability of the flow in another application and does not give the possibility to open
the same flow in many windows.
A flow is made up of an entry called the starting point, an exit point called a return
node and zero, or many other nodes. A node can be a JSF page ( ViewNode ), a nav-
igation decision ( SwitchNode ), an application logic invocation ( MethodCallNode ),
acalltoanotherflow( FlowCallNode ),orareturntothecallingflow( ReturnNode ).
A flow can be configured either with an XML configuration file or programmatically. It
can be packaged in a JAR file or folder. The following example demonstrates how to
implement an online preregistration website with Faces Flow (our flow is configured
with an XML configuration file; for program configuration, please consult the Java EE
7 tutorial.)
In the case of a flow packaged in a folder, the following conventions are followed by
• The package folder of the flow has the same name as the flow
• The starting node of the flow has the same name as the flow
• All pages of the flow are assumed to be in the same folder except the exit
• For a flow that is configured with an XML configuration file, the configuration
file is a faces-config whose name is <name_of_flow>-flow.xml
Search WWH ::

Custom Search