af:trainButtonBar components to render the
train model in the UI.
Expand the sample application’s View
Controller project in the Application
Navigator. Open the Web Content folder and
its WEB-INF folder, and then double-click
employees-btf.xml to open it in the task
flow visual editor.
Next, open the Oracle JDeveloper
Structure window (Ctrl-Shift-S). Under ADF
Task Flow, select task-flow-definition –
employees-btf. Open Oracle JDeveloper’s
Property Inspector feature (Ctrl-Shift-I),
and scroll to the Behavior section. You can
see that the Train property is set to true to
expose the task flow train model at runtime.
(The default value is false.)
DEFINING TRAIN STOPS AND THE
After enabling a bounded task flow to
expose a train model, you need to define
view activities and task flow call activities as
train stops. To add an existing view or task
flow call activity to the train model, select
the activity in the visual editor, right-click,
and then select the Train option to create
(or, later, to change) the train stop setting.
Any view and task flow call activities you add
to the task flow diagram are automatically
added to the sequence of train stops.
The navigation sequence is defined initially by the order in which view activities
and task flow call activities are added as
train stops. You can easily change this order
via the Train option in the context menu
associated with each activity.
Train stops are further configured with
the Property Inspector. To see how, select
the EmployeeDetails view activity in the
sample application’s employees-btf.xml
task flow and open the Property Inspector.
Scroll to the Train Stop section to see the
train stop properties, as shown in Figure 3.
The Train Stop section appears in the
Property Inspector only if the bounded task
flow’s Train property is set to true and the
selected activity is either a view activity or a
task flow activity.
Figure 3: Train stop configuration properties for the EmployeeDetails view activity
TRAIN STOP PROPER TIES
As you can see in Figure 3, train stops are
configured with five properties:
1. The Train Stop property is set to false by
default. When set to true, it indicates
that the view or task flow call activity is a
train stop. You set this property at design
time and cannot change it at runtime.
2. The Outcome property enables you to
associate a control flow name with a
train stop to define an alternative navigation case. The Outcome property can
be read from Java code at runtime but
not changed then.
3. The Sequential property defines the
order in which users navigate the train
stops. If a train stop’s Sequential property is set to true, users can access that
stop only if they have already visited the
preceding stop. A value of false defines
nonsequential navigation, enabling the
user to select any train stop whose Skip
property is not set to true. You can use
Expression Language (EL) to define the
Sequential property value for a train stop
dynamically. The sample application for
this column demonstrates this usage.
4. The Skip property disables a train stop so
that users cannot navigate to it. Like the
Sequential property, the Skip property
can be dynamically changed at runtime.
5. The Ignore property prevents a train stop
from rendering in the UI. Although you
can use EL to set the Ignore property
value dynamically at runtime, it can be
changed only upon task flow initializa-
tion. Once a task flow is rendered, the
Ignore property is immutable.
BUILDING THE TRAIN USER INTERFACE
Oracle ADF Faces provides two UI components for displaying train models in
your JavaServer Faces pages and page
1. The train component, af:train, displays
the train model as a horizontal or vertical
line with icons indicating the stops. The
train component is used for both sequential and nonsequential navigation.
To define display names for each stop,
you edit the task flow. If it’s not open
already, double-click the
employees-btf.xml file in the Application Navigator
and expand the EmployeeDetails view
activity node in the Structure window.
Expand the train-stop node, as shown in
Figure 4, to see the Display Name configuration. You add the display name element
by using the right-click context menu on
the train-stop node and selecting Insert
inside train-stop -> Display Name. You
then edit the Display Name value with the
You can also use EL to read the
display-name value from a message bundle to