Class FlowState
java.lang.Object
com.aquima.interactions.flow.model.FlowState
- All Implemented Interfaces:
IFlowState
,Serializable
This object is used to hold the position of a flow request. The flow state contains the result node that was reached,
but also the complete path that was followed to reach the result node.
- Since:
- 7.0
- Author:
- F. van der Meer, O. Kerpershoek
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionFlowState
(INodeDetails[] nodes, ExitState exitState, String exitEvent, FlowEvaluatorType flowEvaluatorType, VisitedPages visitedPages) Constructs the flow state with an array of nodes that should be used to initialize the internal flow path with.protected
FlowState
(FlowPath path, ExitState exitState, String exitEvent, FlowEvaluatorType flowEvaluatorType, VisitedPages visitedPages) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Method used to determine if the flowEngine will allow flowing even if there page-errorsThis method returns a deep copy (clone) of itself.This method returns the flow result node at which the flow process stopped.This method returns the exit event which designates the exit-state label of the flow structure, the method will only return an exit event when the flow structure is completely traversed and {IFlowState.isComplete()
is true.This method returns the exit type of the flow exit, it contains information whether the flow has either completed asReturns the type of the flow-evaluator used is the current started flow in the current session.String[]
This method returns the names of the flows that were traversed.getPath()
This method returns the flow path containing information about the flow nodes that have been processed during the flow.The return value is an instance of VisitedPages, a class that defines the state of every flow of type SinglePageFlow visited during the active session.boolean
This method returns true if the entire flow structure has been traversed and the flow is complete.boolean
Method to determine if field errors should be included when expanding a page.toString()
-
Constructor Details
-
FlowState
public FlowState(INodeDetails[] nodes, ExitState exitState, String exitEvent, FlowEvaluatorType flowEvaluatorType, VisitedPages visitedPages) Constructs the flow state with an array of nodes that should be used to initialize the internal flow path with. This constructor is used when restoring a session from XML.- Parameters:
nodes
- The nodes that should be used to initialize the flow path.exitState
- The exit type if applicable. A null pointer otherwise.exitEvent
- the exit event label if applicable A null pointer otherwise.flowEvaluatorType
- value from enum FlowEvaluatorType specifying which type of flow evaluator to usevisitedPages
- an objects that contains information about the pages that have been visited. Nullable.
-
FlowState
protected FlowState(FlowPath path, ExitState exitState, String exitEvent, FlowEvaluatorType flowEvaluatorType, VisitedPages visitedPages)
-
-
Method Details
-
getActiveNode
Description copied from interface:IFlowState
This method returns the flow result node at which the flow process stopped. The result node will always be the last node in the flow path.- Specified by:
getActiveNode
in interfaceIFlowState
- Returns:
- The current result node of the flow state.
-
getPath
Description copied from interface:IFlowState
This method returns the flow path containing information about the flow nodes that have been processed during the flow.- Specified by:
getPath
in interfaceIFlowState
- Returns:
- The flow path of the current flow state.
-
getVisitedPages
Description copied from interface:IFlowState
The return value is an instance of VisitedPages, a class that defines the state of every flow of type SinglePageFlow visited during the active session.- Specified by:
getVisitedPages
in interfaceIFlowState
- Returns:
- instance of VisitedPages
-
getFlowNames
Description copied from interface:IFlowState
This method returns the names of the flows that were traversed.- Specified by:
getFlowNames
in interfaceIFlowState
- Returns:
- Array containing all the names of the flows that have been traversed.
-
getExitLabel
Description copied from interface:IFlowState
This method returns the exit event which designates the exit-state label of the flow structure, the method will only return an exit event when the flow structure is completely traversed and {IFlowState.isComplete()
is true. It will return a null pointer otherwise.- Specified by:
getExitLabel
in interfaceIFlowState
- Returns:
- The ExitEvent label which is the ExitEvent of the root flow, when the flow has ended.
-
getExitState
Description copied from interface:IFlowState
This method returns the exit type of the flow exit, it contains information whether the flow has either completed asok
,cancel
orexception
.- Specified by:
getExitState
in interfaceIFlowState
- Returns:
- The exit type of the exit of the root flow, when the flow has ended. Otherwise a null pointer is returned.
-
getFlowEvaluatorType
Description copied from interface:IFlowState
Returns the type of the flow-evaluator used is the current started flow in the current session. THe type is determined on basis of the flowtype of the exposed flow.- Specified by:
getFlowEvaluatorType
in interfaceIFlowState
- Returns:
- one of the values of enum FlowEvaluatorType
-
isComplete
public boolean isComplete()Description copied from interface:IFlowState
This method returns true if the entire flow structure has been traversed and the flow is complete.- Specified by:
isComplete
in interfaceIFlowState
- Returns:
- A boolean indicating that the entire flow structure has been traversed and the flow is complete.
-
duplicate
Description copied from interface:IFlowState
This method returns a deep copy (clone) of itself.- Specified by:
duplicate
in interfaceIFlowState
- Returns:
- A deep copy of the flow state.
-
continueOnError
public boolean continueOnError()Description copied from interface:IFlowState
Method used to determine if the flowEngine will allow flowing even if there page-errors- Specified by:
continueOnError
in interfaceIFlowState
- Returns:
- true if flowing can continue, false otherwise
-
preValidateFields
public boolean preValidateFields()Description copied from interface:IFlowState
Method to determine if field errors should be included when expanding a page. For standard flowing this is false ( errors are only included after submit/refresh )- Specified by:
preValidateFields
in interfaceIFlowState
- Returns:
- true if current page should show field errors when it is expanded, false otherwise
-
toString
-