Package com.aquima.web
Class FlowStarter
java.lang.Object
com.aquima.web.FlowStarter
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
ConstructorsConstructorDescriptionFlowStarter
(com.blueriq.component.api.AquimaBeanProvider provider, SessionHeadersProperties sessionHeadersProperties) Constructs a new application starter. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.protected Map
<String, Serializable> toFlowParameters
(Map<String, String[]> parameters) This method converts a request map to a flow request map.
-
Constructor Details
-
FlowStarter
@Autowired public FlowStarter(com.blueriq.component.api.AquimaBeanProvider provider, SessionHeadersProperties sessionHeadersProperties) Constructs a new application starter.- Parameters:
provider
- the aquima engine providersessionHeadersProperties
- Session related properties
-
-
Method Details
-
startSession
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
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
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 fromauthorisationManager
- the authorisation managersessionManager
- the session manager- Returns:
- an Aquima session if the session could be created
- Throws:
com.aquima.interactions.portal.exception.PortalException
- unexpected exceptioncom.aquima.interactions.foundation.exception.AppException
- unexpected exceptioncom.aquima.interactions.metamodel.exception.UnknownLanguageException
- unexpected exception
-
determineApplicationId
protected com.aquima.interactions.foundation.ApplicationID determineApplicationId(com.blueriq.component.api.IProjectReference projectRequest) -
getFlowName
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 requestaquimaSession
- 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
protected boolean isUseRequestParamsAsFlowParams() -
setUseRequestParamsAsFlowParams
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
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 sessionflowName
- the name of the flow to startrequest
- the request- Throws:
com.aquima.interactions.foundation.exception.AppException
- when the flow could not be started
-
toFlowParameters
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
-