Class FlowHandler
java.lang.Object
com.aquima.interactions.portal.model.session.FlowHandler
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionFlowHandler
(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. -
Method Summary
Modifier and TypeMethodDescriptiondoProcess
(IActionNodeDetails action) protected String
This method returns the profile which is used to evaluate conditions during the flow evaluations.protected boolean
This method will return a boolean indicating if a page commit will be needed.protected boolean
void
onConditionException
(Exception error) Will be called when an exception during evaluation of a condition occurs.void
onFlowAborted
(IFlowDetails flowDetails) This method is invoked to notify the client that the flow with the specified name has been aborted.void
onFlowAccessException
(FlowAccessException exception) This method will be invoked when a flow could not be started due to a security exception.void
onFlowCompleted
(IFlowDetails flowDetails) This method is invoked to notify the client that the flow with the specified name has completed.void
onFlowContinue
(String flowName) This method is invoked to notify the client that the flow with the specified name has continued.void
onFlowExceptionHandled
(FlowNodeException exception) Notifies the client that an exception in the flow has been handled by taking the exception exit of a service or function callvoid
onFlowStart
(IFlowDetails flowDetails) This method is invoked when the flow is started.void
onFlowWillStart
(IFlowDetails flowDetails) This method is invoked just before starting a flow.void
onRepeatContextEnd
(IRepeatContext repeatContext) This method is invoked to notify the client that a repeat context has ended for a subflow.void
onRepeatContextStart
(IRepeatContext repeatContext) This method is invoked to notify the client that a repeat context has started for a subflow.process
(IActionNodeDetails action) This method will be invoked when the flow engine encounters an action node in the flow.void
processEvent
(IEventNodeDetails event) This method will be invoked when the flow engine encounters an event node in the flow.protected void
rollback()
protected void
setTransactionalFlowRolledBack
(boolean transactionalFlowRolledBack)
-
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
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 interfaceIFlowHandler
- 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
-
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
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 interfaceIFlowHandler
- Parameters:
event
- The event node that should be processed by the client.
-
onFlowWillStart
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 interfaceIFlowHandler
- Parameters:
flowDetails
- The flow that will be started.
-
onFlowStart
Description copied from interface:IFlowHandler
This method is invoked when the flow is started.- Specified by:
onFlowStart
in interfaceIFlowHandler
- Parameters:
flowDetails
- The flow that is just started.
-
onFlowAborted
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 interfaceIFlowHandler
- Parameters:
flowDetails
- The details of the flow that has been aborted.
-
onFlowCompleted
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 interfaceIFlowHandler
- Parameters:
flowDetails
- The details of the flow that has been completed.
-
onFlowContinue
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 interfaceIFlowHandler
- Parameters:
flowName
- The name of the flow that has been continued.
-
onFlowAccessException
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 interfaceIFlowHandler
- Parameters:
exception
- The security exception that was raised when attempting to start the flow.
-
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 interfaceIFlowHandler
- Returns:
- An inference context which is used for condition evaluations.
-
onConditionException
Description copied from interface:IFlowHandler
Will be called when an exception during evaluation of a condition occurs.- Specified by:
onConditionException
in interfaceIFlowHandler
- Parameters:
error
- The exception.
-
rollback
protected void rollback() -
onRepeatContextStart
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 interfaceIFlowHandler
- Parameters:
repeatContext
- Contains information regarding the start of an iteration
-
onRepeatContextEnd
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 interfaceIFlowHandler
- Parameters:
repeatContext
- Contains information regarding the end of an iteration
-
onFlowExceptionHandled
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 interfaceIFlowHandler
- Parameters:
exception
- - The exception that was handled
-
setTransactionalFlowRolledBack
protected void setTransactionalFlowRolledBack(boolean transactionalFlowRolledBack) -
getPageFlow
-
isTransactionFlowRolledBack
protected boolean isTransactionFlowRolledBack()
-