Class ProcessUtils

There are two common scenarios for processes,
"Plus One" and "Max Visited" which are explained below.

"Plus One" - from the current step the user can
navigate to any previous page and the next page.
If the user is on the 5th step of a process
and goes back to step 2, then the user can only
navigate from step 2 to step 1 and step 3.

"Max Visited" - the user can navigate to the max
visited page. If the user is currently on the max
visited page then the user can also navigate to
the next page. If the user is on the 5th step of a
process and goes back to step 2, then the user can
navigate from step 2 to steps 1, 2, 3, 4, and 5.

A node in a process should be readOnly
if that step of the process is not reachable from the current
step.

A node in a process should be immediate if the values
in the current step don't need to be validated.

Constructor Detail

ProcessUtils

Method Detail

isImmediate

Determines immediate for a "plus one" process.
Immediate will be true for any previous step, and false otherwise.
For example if the user is on step 5
and goes back to step 2, the user will have to come back
to step 5 again, so the fields on page 5 don't need to
be validated when going back to steps 1,2,3,4, but should be
validated when going to step 6.

Parameters:

model - the model instance to use.
When the model is passed in a call to model.getPath should return the
path for the "current" node.

defaultReturnValue - if the current and focus nodes aren't
siblings in the tree, this value will be returned.

isImmediate

Determines immediate for a "max visited" process.
When the current step and the max step are the same
immediate will be true for any previous step, and false otherwise.
If the current step is before the max step,
immediate will be false.

Parameters:

model - the model instance to use.
When the model is passed in a call to model.getRowKey should return the
rowKey for the "current" node.

maxVisitedRowKey - the rowKey to use to determine the max node

defaultReturnValue - if the current, max, and focus nodes aren't
siblings in the tree, this value will be returned.

Returns:

whether or not the current node should be immediate.

isReadOnly

Determines readOnly for a "max visited" process.
When the current step and the max step are the same,
readOnly will be true for any step past the next available step.
If the current step is before the max step,
then readOnly will be true for any step past the max step.

Parameters:

model - the model instance to use.
When the model is passed in a call to model.getRowKey should return the
rowKey for the "current" node.

maxVisitedRowKey - the rowKey to use to determine the max node

defaultReturnValue - if the current, max, and focus nodes aren't
siblings in the tree, this value will be returned.

getMaxVisitedRowKey

Get the rowKey of the max visited node in the respective process.
If null set maxVisitedRowKey to be the focus rowKey.
If set but the focus rowKey is after maxVisitedRowKey,
set maxVisitedRowKey to the focus rowKey.

Parameters:

model - the model instance to use.
When the model is passed in a call to model.getRowKey should return the
key for the "current" node.

maxPathKey - this key is used to store the maxVisitedRowKey in both the
session and request map.