java.lang.Object
com.aquima.interactions.portal.model.session.FlowHandler
All Implemented Interfaces:
IFlowHandler

public class FlowHandler extends Object implements IFlowHandler
Flow handler implementation of the portal engine. This flow handler is responsible for transaction management based on flow state.
Since:
5.0
Author:
O. Kerpershoek
  • Constructor Details

    • FlowHandler

      public FlowHandler(PortalContext context, String currentPage, String currentFlowName, EventErrors errors, IServiceFactory serviceFactory, IModule appModel, ITimeTracker timeTracker, boolean allowUnExposedFlows, String[] events)
      Constructs the flow handler with the required parameters.
      Parameters:
      context - The current transaction-aware portal context.
      currentPage - The name of the current page.
      currentFlowName - The name of the current flow.
      errors - Object that can be used to add service errors to.
      serviceFactory - Service factory that can provide service implementations for service flow nodes.
      appModel - The applicationModel.
      timeTracker - The time tracker that is used go gather timing information about service execution times.
      allowUnExposedFlows - Boolean indicating if unexposed flows are allowed.
  • Method Details

    • process

      public ExitEvent process(IActionNodeDetails action)
      Description copied from interface: IFlowHandler
      This method will be invoked when the flow engine encounters an action node in the flow. The implementation of this method is responsible for the actual execution of the action based on the information provided by the action node.
      Specified by:
      process in interface IFlowHandler
      Parameters:
      action - The action node that should be processed by the client.
      Returns:
      The exit event which will map to an edge in the flow.
    • doProcess

      public ExitEvent doProcess(IActionNodeDetails action)
    • isPageCommitNeeded

      protected boolean isPageCommitNeeded()
      This method will return a boolean indicating if a page commit will be needed. In certain cases we need to commit the page, even though we're at the same page we came from. Normally this is treated as refresh, but when we have entered/completed/aborted (sub) flows it might actually be another instance of the same page (NOT the same one).
      Returns:
      boolean indicating if a page commit will be needed.
    • processEvent

      public void processEvent(IEventNodeDetails event)
      Description copied from interface: IFlowHandler
      This method will be invoked when the flow engine encounters an event node in the flow. The implementation of this method is responsible for the actual execution of the event based on the information provided by the event node.
      Specified by:
      processEvent in interface IFlowHandler
      Parameters:
      event - The event node that should be processed by the client.
    • onFlowWillStart

      public void onFlowWillStart(IFlowDetails flowDetails)
      Description copied from interface: IFlowHandler
      This method is invoked just before starting a flow. The implementation of the handler may perform some additional checks, and veto the start of the flow if needed by throwing a FlowAccessException.
      Specified by:
      onFlowWillStart in interface IFlowHandler
      Parameters:
      flowDetails - The flow that will be started.
    • onFlowStart

      public void onFlowStart(IFlowDetails flowDetails)
      Description copied from interface: IFlowHandler
      This method is invoked when the flow is started.
      Specified by:
      onFlowStart in interface IFlowHandler
      Parameters:
      flowDetails - The flow that is just started.
    • onFlowAborted

      public void onFlowAborted(IFlowDetails flowDetails)
      Description copied from interface: IFlowHandler
      This method is invoked to notify the client that the flow with the specified name has been aborted.
      Specified by:
      onFlowAborted in interface IFlowHandler
      Parameters:
      flowDetails - The details of the flow that has been aborted.
    • onFlowCompleted

      public void onFlowCompleted(IFlowDetails flowDetails)
      Description copied from interface: IFlowHandler
      This method is invoked to notify the client that the flow with the specified name has completed.
      Specified by:
      onFlowCompleted in interface IFlowHandler
      Parameters:
      flowDetails - The details of the flow that has been completed.
    • onFlowContinue

      public void onFlowContinue(String flowName)
      Description copied from interface: IFlowHandler
      This method is invoked to notify the client that the flow with the specified name has continued.
      Specified by:
      onFlowContinue in interface IFlowHandler
      Parameters:
      flowName - The name of the flow that has been continued.
    • onFlowAccessException

      public void onFlowAccessException(FlowAccessException exception)
      Description copied from interface: IFlowHandler
      This method will be invoked when a flow could not be started due to a security exception. The client may choose to ignore the exception and continue with the flow, or re-throw the exception, in which case the flow will be aborted.
      Specified by:
      onFlowAccessException in interface IFlowHandler
      Parameters:
      exception - The security exception that was raised when attempting to start the flow.
    • getProfile

      public InferenceContext getProfile()
      Description copied from interface: IFlowHandler
      This method returns the profile which is used to evaluate conditions during the flow evaluations.
      Specified by:
      getProfile in interface IFlowHandler
      Returns:
      An inference context which is used for condition evaluations.
    • onConditionException

      public void onConditionException(Exception error)
      Description copied from interface: IFlowHandler
      Will be called when an exception during evaluation of a condition occurs.
      Specified by:
      onConditionException in interface IFlowHandler
      Parameters:
      error - The exception.
    • rollback

      protected void rollback()
    • onRepeatContextStart

      public void onRepeatContextStart(IRepeatContext repeatContext)
      Description copied from interface: IFlowHandler
      This method is invoked to notify the client that a repeat context has started for a subflow.
      Specified by:
      onRepeatContextStart in interface IFlowHandler
      Parameters:
      repeatContext - Contains information regarding the start of an iteration
    • onRepeatContextEnd

      public void onRepeatContextEnd(IRepeatContext repeatContext)
      Description copied from interface: IFlowHandler
      This method is invoked to notify the client that a repeat context has ended for a subflow.
      Specified by:
      onRepeatContextEnd in interface IFlowHandler
      Parameters:
      repeatContext - Contains information regarding the end of an iteration
    • onFlowExceptionHandled

      public void onFlowExceptionHandled(FlowNodeException exception)
      Description copied from interface: IFlowHandler
      Notifies the client that an exception in the flow has been handled by taking the exception exit of a service or function call
      Specified by:
      onFlowExceptionHandled in interface IFlowHandler
      Parameters:
      exception - - The exception that was handled
    • setTransactionalFlowRolledBack

      protected void setTransactionalFlowRolledBack(boolean transactionalFlowRolledBack)
    • getPageFlow

      protected String getPageFlow()
    • isTransactionFlowRolledBack

      protected boolean isTransactionFlowRolledBack()