public class ProcessUtils extends Object
There are two common scenarios for processes, "Plus One" and "Max Visited" which are explained below.
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 and Description |
---|
ProcessUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
clearMaxPath(String maxPathKey) |
static Object |
getMaxVisitedRowKey(MenuModel model,
String maxPathKey)
Get the rowKey of the max visited node in the respective process.
|
static boolean |
isImmediate(MenuModel model,
boolean defaultReturnValue)
Determines immediate for a "plus one" process.
|
static boolean |
isImmediate(MenuModel model,
Object maxVisitedRowKey,
boolean defaultReturnValue)
Determines immediate for a "max visited" process.
|
static boolean |
isReadOnly(MenuModel model,
boolean defaultReturnValue)
Determines readOnly for a "plus one" process.
|
static boolean |
isReadOnly(MenuModel model,
Object maxVisitedRowKey,
boolean defaultReturnValue)
Determines readOnly for a "max visited" process.
|
static boolean |
isVisited(MenuModel model,
boolean defaultReturnValue)
For the Plus One case, a stop is considered visited if,
- it's before the current or,
- is the current stop itself
|
static boolean |
isVisited(MenuModel model,
Object maxVisitedRowKey,
boolean defaultReturnValue)
For the Max Visited case, a stop is considered visited if
- a stop is before the active stop
- or is the active stop
|
public static boolean isImmediate(MenuModel model, boolean defaultReturnValue)
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.
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.public static boolean isReadOnly(MenuModel model, boolean defaultReturnValue)
Determines readOnly for a "plus one" process. ReadOnly will be true for any step past the next available step
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.public static boolean isImmediate(MenuModel model, Object maxVisitedRowKey, boolean defaultReturnValue)
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.
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 nodedefaultReturnValue
- if the current, max, and focus nodes aren't
siblings in the tree, this value will be returned.public static boolean isReadOnly(MenuModel model, Object maxVisitedRowKey, boolean defaultReturnValue)
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.
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 nodedefaultReturnValue
- if the current, max, and focus nodes aren't
siblings in the tree, this value will be returned.public static boolean isVisited(MenuModel model, boolean defaultReturnValue)
model
- the menuModel instance to use. When the model is passed in,
a call to model.getRowKey should return the rowKey for the "current" node.defaultReturnValue
- if the current and focus nodes aren't
siblings in the tree, this value will be returned.public static boolean isVisited(MenuModel model, Object maxVisitedRowKey, boolean defaultReturnValue)
model
- the menuModel 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 visited nodedefaultReturnValue
- if the current, maxVisited and focus nodes aren't
siblings in the tree, this value will be returned.public static Object getMaxVisitedRowKey(MenuModel model, String maxPathKey)
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.public static void clearMaxPath(String maxPathKey)
Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.