Class FlowStarter

java.lang.Object
com.aquima.web.FlowStarter

@ConditionalOnSingleCandidate(FlowStarter.class) @Component public class FlowStarter extends Object
This class is used to start an Aquima application by creating a session and starting a flow.

This class can be subclassed when custom startup is preferred.

Since:
8.0
Author:
Danny Roest
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    FlowStarter(com.blueriq.component.api.AquimaBeanProvider provider, SessionHeadersProperties sessionHeadersProperties)
    Constructs a new application starter.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    protected com.blueriq.component.api.IAquimaSession
    createSession(com.blueriq.component.api.IProjectReference projectRequest, com.blueriq.component.api.security.IAuthorisationManager authorisationManager, com.blueriq.component.api.IAquimaSessionsMap sessionManager)
    This method creates an Aquima Session for the specified request.
    protected com.aquima.interactions.foundation.ApplicationID
    determineApplicationId(com.blueriq.component.api.IProjectReference projectRequest)
     
    protected String
    getFlowName(com.blueriq.component.api.IProjectReference applicationRequest, com.blueriq.component.api.IAquimaSession aquimaSession)
    This method returns the flow name for the specified request.
    protected boolean
     
    void
    setUseRequestParamsAsFlowParams(boolean useRequestParamsAsFlowParams)
    This method sets whether the additional request parameters should be used as flow parameters.
    protected void
    startFlow(com.blueriq.component.api.IAquimaSession aquimaSession, String flowName, com.blueriq.component.api.IProjectReference request)
    This method starts the flow.
    com.blueriq.component.api.IAquimaSession
    startSession(com.blueriq.component.api.IProjectReference projectRequest, com.blueriq.component.api.security.IAuthorisationManager authorisationManager, com.blueriq.component.api.IAquimaSessionsMap sessionManager)
    This method creates an AquimaSession and starts a flow based on the project request.
    com.blueriq.component.api.IAquimaSession
    startSession(com.blueriq.component.api.IProjectReference projectRequest, com.blueriq.component.api.security.IAuthorisationManager authorisationManager, com.blueriq.component.api.IAquimaSessionsMap sessionManager, boolean handleUnauthorized)
    This method creates an AquimaSession and starts a flow based on the project request.
    This method converts a request map to a flow request map.

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details Link icon

    • FlowStarter Link icon

      @Autowired public FlowStarter(com.blueriq.component.api.AquimaBeanProvider provider, SessionHeadersProperties sessionHeadersProperties)
      Constructs a new application starter.
      Parameters:
      provider - the aquima engine provider
      sessionHeadersProperties - Session related properties
  • Method Details Link icon

    • startSession Link icon

      public com.blueriq.component.api.IAquimaSession startSession(com.blueriq.component.api.IProjectReference projectRequest, com.blueriq.component.api.security.IAuthorisationManager authorisationManager, com.blueriq.component.api.IAquimaSessionsMap sessionManager)
      This method creates an AquimaSession and starts a flow based on the project request.
      Parameters:
      projectRequest - The project to create at start.
      authorisationManager - The authentication manager.
      sessionManager - The session manager.
      Returns:
      The Aquima session when the session could be created and the flow started or null if the flow could not be started.
    • startSession Link icon

      public com.blueriq.component.api.IAquimaSession startSession(com.blueriq.component.api.IProjectReference projectRequest, com.blueriq.component.api.security.IAuthorisationManager authorisationManager, com.blueriq.component.api.IAquimaSessionsMap sessionManager, boolean handleUnauthorized)
      This method creates an AquimaSession and starts a flow based on the project request.
      Parameters:
      projectRequest - The project to create at start.
      authorisationManager - The authentication manager.
      sessionManager - The session manager.
      handleUnauthorized - The flag that indicates if this method should handle user not authorized at this level.
      Returns:
      The Aquima session when the session could be created and the flow started or null if the flow could not be started.
      Throws:
      com.aquima.interactions.flow.exception.FlowAccessException - If the current user does not have access to start the flow.
    • createSession Link icon

      protected com.blueriq.component.api.IAquimaSession createSession(com.blueriq.component.api.IProjectReference projectRequest, com.blueriq.component.api.security.IAuthorisationManager authorisationManager, com.blueriq.component.api.IAquimaSessionsMap sessionManager)
      This method creates an Aquima Session for the specified request.
      Parameters:
      projectRequest - the application to create a session from
      authorisationManager - the authorisation manager
      sessionManager - the session manager
      Returns:
      an Aquima session if the session could be created
      Throws:
      com.aquima.interactions.portal.exception.PortalException - unexpected exception
      com.aquima.interactions.foundation.exception.AppException - unexpected exception
      com.aquima.interactions.metamodel.exception.UnknownLanguageException - unexpected exception
    • determineApplicationId Link icon

      protected com.aquima.interactions.foundation.ApplicationID determineApplicationId(com.blueriq.component.api.IProjectReference projectRequest)
    • getFlowName Link icon

      protected String getFlowName(com.blueriq.component.api.IProjectReference applicationRequest, com.blueriq.component.api.IAquimaSession aquimaSession)
      This method returns the flow name for the specified request. If the request has no flow specified the and the application has only one flow, this flow name is returned, else and exception is thrown.
      Parameters:
      applicationRequest - the application request
      aquimaSession - the session started by request
      Returns:
      the name of the flow
      Throws:
      IllegalArgumentException - when there are more than one flows and no flow is specified in the request
    • isUseRequestParamsAsFlowParams Link icon

      protected boolean isUseRequestParamsAsFlowParams()
    • setUseRequestParamsAsFlowParams Link icon

      public void setUseRequestParamsAsFlowParams(boolean useRequestParamsAsFlowParams)
      This method sets whether the additional request parameters should be used as flow parameters. Default: true
      Parameters:
      useRequestParamsAsFlowParams - whether the additional request parameters
    • startFlow Link icon

      protected void startFlow(com.blueriq.component.api.IAquimaSession aquimaSession, String flowName, com.blueriq.component.api.IProjectReference request)
      This method starts the flow. This method can be overridden if custom flow starting is desired.
      Parameters:
      aquimaSession - the current session
      flowName - the name of the flow to start
      request - the request
      Throws:
      com.aquima.interactions.foundation.exception.AppException - when the flow could not be started
    • toFlowParameters Link icon

      protected Map<String,Serializable> toFlowParameters(Map<String,String[]> parameters)
      This method converts a request map to a flow request map. The string array is converted to string where the values are separated by a |
      Parameters:
      parameters - the application request
      Returns:
      a map with flow parameters