Class TxPortalContext
java.lang.Object
com.aquima.interactions.portal.model.session.PortalContext
com.aquima.interactions.portal.model.tx.TxPortalContext
- All Implemented Interfaces:
Interruptible
,IPortalContext
,ISessionLifecycle
,IInternalPortalContext
,Serializable
- Direct Known Subclasses:
FunctionCallContext
Portal context implementation that supports transactions.
- Since:
- 5.0.1
- Author:
- O. Kerpershoek
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTxPortalContext
(ISolution application, IModule module, Channel channel, IProfile profile) Constructs the context with the required parameters.TxPortalContext
(ISolution application, IModule module, IProfile profile, IPortalMessageBus messageBus, ISessionState sessionState) Constructs a portal context from a saved session state.TxPortalContext
(TxPortalContext other) Constructs the context from another context. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
activate
(ISessionActivationContext sessionActivationContext) This method may be used for activating the objects after deserialization.protected void
commitTransaction
(String name) protected void
completeFlow
(String flowName) protected void
destroy()
This method returns the current active instance context.getActiveInstance
(String entityName) Returns the active instance connected to the specified entity name.Retrieves the flow scope form the context.This method will return the current profile interface.getState()
Returns the state of the portalcontext (for serialization).protected TmsProfile
This method returns the profile of all the user set data.void
This method may be used for preparing the objects for serialization.void
pushActiveInstance
(IEntityInstance instance) This method will activate the instance in the current context.void
restore
(IPortalContextState state) Clears the current state and overrides it with the provided state.protected void
rollbackTransaction
(String name) protected void
setActiveContext
(IInstanceContext context) protected void
setActiveFlowScope
(FlowScope flowScope) protected void
protected void
startTransaction
(String name) Methods inherited from class com.aquima.interactions.portal.model.session.PortalContext
forModule, forModule, getApplication, getApplicationMode, getApplicationModel, getAuditEngine, getCaseEngineClient, getChannel, getChannelName, getCommentsManager, getCommunicationEngine, getComposer, getConfiguration, getConnectionManager, getContentManagerFactory, getContentManagerFactory, getCurrentFlow, getCurrentLanguage, getCurrentPageName, getDebugger, getDocumentEngine, getElementComposer, getExpressionParser, getFactoryManager, getFlowEngine, getFlowState, getFunctionCallDefinitionManager, getId, getInternalSessionScope, getMappingComposer, getMappingManager, getMaskManager, getMatchEngine, getMetaModel, getPageScope, getProcessScope, getProject, getRequestErrorMap, getRequestScope, getResourceManager, getRuleEngine, getServiceManager, getSessionId, getSessionScope, getTraceEngine, getTreeEngine, getUser, getUserScope, getWebServices, interrupt, isInterrupted, onEndRequest, onStartPage, onStartRequest, onStartTransition, setCurrentLanguage, setFlowState, setProcessScope, setSessionId, setSessionScope, setSessionScope
-
Constructor Details
-
TxPortalContext
Constructs the context with the required parameters.- Parameters:
application
- The application for which the context should be created.module
- The module containing the static definitions that should be used.channel
- The active channel.profile
- The profile containing the state of the application.
-
TxPortalContext
Constructs the context from another context. This will not perform a deep-clone operation, as most objects from the specified context will be used in this context.- Parameters:
other
- The other context that should be used to initialize this context.
-
TxPortalContext
public TxPortalContext(ISolution application, IModule module, IProfile profile, IPortalMessageBus messageBus, ISessionState sessionState) Constructs a portal context from a saved session state.- Parameters:
application
- The application model.module
- The module containing the static definitions that should be used.profile
- The profile for the session data.sessionState
- The session state information that should be used to initialize the context.- Throws:
AppException
- This exception is thrown when the context could not be created using the session state information.
-
-
Method Details
-
getTmsProfile
- Specified by:
getTmsProfile
in classPortalContext
-
getActiveContext
This method returns the current active instance context. Note: This method is public to allow the session state access to in instance context.- Returns:
- the current active instance context.
-
setActiveContext
-
startFlow
- Specified by:
startFlow
in classPortalContext
-
abortFlow
- Specified by:
abortFlow
in classPortalContext
-
completeFlow
- Specified by:
completeFlow
in classPortalContext
-
pushActiveInstance
Description copied from interface:IPortalContext
This method will activate the instance in the current context. Once an instance has been activated in a portal context, the instance will stay active until the page flow the activation occurred in has been completed.- Parameters:
instance
- The instance that should be activated.
-
startTransaction
- Specified by:
startTransaction
in classPortalContext
-
commitTransaction
- Specified by:
commitTransaction
in classPortalContext
-
rollbackTransaction
- Specified by:
rollbackTransaction
in classPortalContext
-
getActiveInstance
Description copied from interface:IPortalContext
Returns the active instance connected to the specified entity name. An instance might have been activated in the following ways:- The instance is a singleton, and therefore always active.
- The instance is activated through a container (only during page evaluation).
- The instance is activated by using the pushActiveInstance within the same flow.
- Parameters:
entityName
- The entity name for which the active instance is requested.- Returns:
- The instance that is active for the specified entity type.
-
getProfile
Description copied from interface:IPortalContext
This method will return the current profile interface. In addition to the standard profile behavior, the implementation returned here will also automatically inference unknown values, and is aware of the instances that might have been activated during the page flow.See also getUserProfile()
- Returns:
- Profile interface.
-
getUserProfile
Description copied from interface:IPortalContext
This method returns the profile of all the user set data. This profile may be used to retrieve the user data without any sourcing of values.- Returns:
- The readonly user profile, never null
-
getFlowScope
Description copied from interface:IPortalContext
Retrieves the flow scope form the context. This object contains parameters and information for the current flow. After the flow is left the scope is changed and is cleared to hold new properties bound to that flow.- Returns:
- The flow-bound scope which is never null.
- See Also:
-
setActiveFlowScope
-
getActiveFlowScope
-
getState
Description copied from interface:IPortalContext
Returns the state of the portalcontext (for serialization).- Specified by:
getState
in interfaceIPortalContext
- Overrides:
getState
in classPortalContext
- Returns:
- returns the current state of the portalcontext.
-
restore
Description copied from interface:IPortalContext
Clears the current state and overrides it with the provided state.- Specified by:
restore
in interfaceIPortalContext
- Overrides:
restore
in classPortalContext
- Parameters:
state
- The new state for this context.
-
destroy
protected void destroy()- Overrides:
destroy
in classPortalContext
-
activate
Description copied from interface:ISessionLifecycle
This method may be used for activating the objects after deserialization.- Specified by:
activate
in interfaceISessionLifecycle
- Overrides:
activate
in classPortalContext
- Parameters:
sessionActivationContext
- the current session activation context.
-
passivate
public void passivate()Description copied from interface:ISessionLifecycle
This method may be used for preparing the objects for serialization.- Specified by:
passivate
in interfaceISessionLifecycle
- Overrides:
passivate
in classPortalContext
-