Class FlowState

java.lang.Object
com.aquima.interactions.flow.model.FlowState
All Implemented Interfaces:
IFlowState, Serializable

public class FlowState extends Object implements IFlowState
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 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 use
      visitedPages - 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

      public IResultNodeDetails 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 interface IFlowState
      Returns:
      The current result node of the flow state.
    • getPath

      public IFlowPath 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 interface IFlowState
      Returns:
      The flow path of the current flow state.
    • getVisitedPages

      public VisitedPages 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 interface IFlowState
      Returns:
      instance of VisitedPages
    • getFlowNames

      public String[] getFlowNames()
      Description copied from interface: IFlowState
      This method returns the names of the flows that were traversed.
      Specified by:
      getFlowNames in interface IFlowState
      Returns:
      Array containing all the names of the flows that have been traversed.
    • getExitLabel

      public String 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 interface IFlowState
      Returns:
      The ExitEvent label which is the ExitEvent of the root flow, when the flow has ended.
    • getExitState

      public ExitState 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 as
       ok
       
      ,
       cancel
       
      or
       exception
       
      .
      Specified by:
      getExitState in interface IFlowState
      Returns:
      The exit type of the exit of the root flow, when the flow has ended. Otherwise a null pointer is returned.
    • getFlowEvaluatorType

      public FlowEvaluatorType 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 interface IFlowState
      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 interface IFlowState
      Returns:
      A boolean indicating that the entire flow structure has been traversed and the flow is complete.
    • duplicate

      public IFlowState duplicate()
      Description copied from interface: IFlowState
      This method returns a deep copy (clone) of itself.
      Specified by:
      duplicate in interface IFlowState
      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 interface IFlowState
      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 interface IFlowState
      Returns:
      true if current page should show field errors when it is expanded, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object