Class CallbackContext
java.lang.Object
com.aquima.interactions.portal.model.session.PortalContextDelegate
com.aquima.interactions.portal.model.session.CallbackContext
- All Implemented Interfaces:
IContainerEventContext
,IEventContext
,IPortalContext
,IInternalPortalContext
,Serializable
Portal context implementation that is passed to callback functions.
- Since:
- 6.4
- Author:
- O. Kerpershoek
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CallbackContext
(CallbackVisitor callbackVisitor, IElement element, CallbackEntry callback) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addErrorMessage
(ValueReference attributeReference, String key, String[] parameters) This method may be used to add an error to the current context.boolean
addErrorText
(ValueReference attributeReference, IMultilingualText text) This method may be used to add an error to the current context.boolean
addWarningMessage
(ValueReference attributeReference, String key, String[] parameters) This method may be used to add a warning to the current context.boolean
addWarningText
(ValueReference attributeReference, IMultilingualText text) This method may be used to add a warning to the current context.boolean
This method will remove all the errors that might have been added.getActiveInstance
(String entityName) Returns the active instance connected to the specified entity name.This method will return the name of the container that the dynamic container component was applied to.This method returns an element factory that may be used to expand pre-defined elements from the composer using the current container context.getErrors
(boolean onlyGenericErrors) Returns the error messages (never null) that have been set in the request scope.getErrors
(ValueReference attributeReference) Retrieves the errors for a specific ValueReference (never null) When no error messages have been set for the specified attribute, an empty array will be returned.getEvent()
Returns the event for which this context is working.This method returns an element factory that may be used to expand pre-defined elements from the composer using the mapping context.getParameter
(String key) This method will return the value for the parameter with the specified name.This method will return all the parameters defined for the container at once in a single object.This method will return the current profile interface.boolean
This method returns the boolean indicating if errors should abort the current flow.boolean
Indicator if the request scope contains generic errors or errors on attribute values.boolean
This method returns a boolean indicating if the flow should be aborted.protected boolean
void
setFlowBlocked
(boolean rollback) This method may be used to block the current flow regardless if any errors are present.void
setFocus
(ValueReference reference) This method sets the focus for a specific ValueReference (never null).void
setStopOnErrors
(boolean stopOnErrors) This method may be used to change the behavior when an error is encountered after the component using the context has completed.Methods inherited from class com.aquima.interactions.portal.model.session.PortalContextDelegate
forModule, forModule, getApplication, getApplicationMode, getApplicationModel, getAuditEngine, getCaseEngineClient, getCommentsManager, getCommunicationEngine, getComposer, getConfiguration, getConnectionManager, getContentManagerFactory, getContentManagerFactory, getContext, getCurrentFlow, getCurrentLanguage, getDebugger, getDocumentEngine, getExpressionParser, getFactoryManager, getFlowEngine, getFlowScope, getFunctionCallDefinitionManager, getId, getMappingManager, getMaskManager, getMatchEngine, getMetaModel, getPageScope, getProcessScope, getProject, getRequestScope, getResourceManager, getRuleEngine, getServiceManager, getSessionId, getSessionScope, getState, getTraceEngine, getTreeEngine, getUserProfile, getUserScope, getWebServices, pushActiveInstance, restore
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aquima.interactions.portal.IPortalContext
forModule, forModule, getApplicationMode, getAuditEngine, getCaseEngineClient, getCommentsManager, getCommunicationEngine, getConnectionManager, getContentManagerFactory, getContentManagerFactory, getCurrentFlow, getCurrentLanguage, getDebugger, getDocumentEngine, getExpressionParser, getFlowEngine, getFlowScope, getFunctionCallDefinitionManager, getMappingManager, getMaskManager, getMatchEngine, getMetaModel, getPageScope, getProcessScope, getProject, getRequestScope, getResourceManager, getRuleEngine, getServiceManager, getSessionId, getSessionScope, getState, getTraceEngine, getTreeEngine, getUserProfile, getUserScope, getWebServices, pushActiveInstance, restore
-
Constructor Details
-
CallbackContext
protected CallbackContext(CallbackVisitor callbackVisitor, IElement element, CallbackEntry callback)
-
-
Method Details
-
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()
- Specified by:
getProfile
in interfaceIPortalContext
- Overrides:
getProfile
in classPortalContextDelegate
- Returns:
- Profile interface.
-
getElementComposer
Description copied from interface:IPortalContext
This method returns an element factory that may be used to expand pre-defined elements from the composer using the current container context.- Specified by:
getElementComposer
in interfaceIPortalContext
- Overrides:
getElementComposer
in classPortalContextDelegate
- Returns:
- An element factory that can be used to expand elements from the composer.
-
getMappingComposer
Description copied from interface:IPortalContext
This method returns an element factory that may be used to expand pre-defined elements from the composer using the mapping context.- Specified by:
getMappingComposer
in interfaceIPortalContext
- Overrides:
getMappingComposer
in classPortalContextDelegate
- Returns:
- An element factory that can be used to expand elements from the composer.
-
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.
- Specified by:
getActiveInstance
in interfaceIPortalContext
- Overrides:
getActiveInstance
in classPortalContextDelegate
- Parameters:
entityName
- The entity name for which the active instance is requested.- Returns:
- The instance that is active for the specified entity type.
-
getContainerName
Description copied from interface:IContainerEventContext
This method will return the name of the container that the dynamic container component was applied to. This name is thus equal to the name of the container as defined in the Everest Studio.- Specified by:
getContainerName
in interfaceIContainerEventContext
- Returns:
- The name of the container.
-
getParameter
Description copied from interface:IContainerEventContext
This method will return the value for the parameter with the specified name. When no value was found for the given name, the null value will be returned.- Specified by:
getParameter
in interfaceIContainerEventContext
- Parameters:
key
- String containing the name of the parameter for which the value is requested.- Returns:
- The value of the parameter for the specified name.
-
getParameters
Description copied from interface:IContainerEventContext
This method will return all the parameters defined for the container at once in a single object.- Specified by:
getParameters
in interfaceIContainerEventContext
- Returns:
- Object containing all the parameters for the container.
-
getEvent
Description copied from interface:IEventContext
Returns the event for which this context is working.- Specified by:
getEvent
in interfaceIEventContext
- Returns:
- The fired even object which is never null.
-
hasErrors
public boolean hasErrors()Description copied from interface:IEventContext
Indicator if the request scope contains generic errors or errors on attribute values.- Specified by:
hasErrors
in interfaceIEventContext
- Returns:
- boolean indicating if errors are present in the request scope.
-
clearErrors
public boolean clearErrors()Description copied from interface:IEventContext
This method will remove all the errors that might have been added. The method returns a boolean indicating if any errors were actually discarded.
Warning: Use this method with care, as clearing errors might result in a state that is not consistent with the rules defined in the model.- Specified by:
clearErrors
in interfaceIEventContext
- Returns:
- a boolean indicating if any errors were actually discarded.
-
addErrorMessage
Description copied from interface:IEventContext
This method may be used to add an error to the current context. The error may be linked to a value by specifying a value reference, or the value reference may be left empty (null) to indicate that the error is generic. The message of the error is retrieved from the meta model for the specified the key.- Specified by:
addErrorMessage
in interfaceIEventContext
- Parameters:
attributeReference
- Optional parameter that specifies the value the error belongs to.key
- The id of the message from the meta model.parameters
- Optional parameters for the message.- Returns:
- boolean indicating if the error was actually added (duplicate messages are ignored).
-
addErrorText
Description copied from interface:IEventContext
This method may be used to add an error to the current context. The error may be linked to a value by specifying a value reference, or the value reference may be left empty (null) to indicate that the error is generic.- Specified by:
addErrorText
in interfaceIEventContext
- Parameters:
attributeReference
- Optional parameter that specifies the value the error belongs to.text
- The error message that should be added to the context.- Returns:
- boolean indicating if the error was actually added (duplicate messages are ignored).
-
addWarningMessage
public boolean addWarningMessage(ValueReference attributeReference, String key, String[] parameters) Description copied from interface:IEventContext
This method may be used to add a warning to the current context. The warning may be linked to a value by specifying a value reference, or the value reference may be left empty (null) to indicate that the warning is generic. The message of the warning is retrieved from the meta model for the specified the key.- Specified by:
addWarningMessage
in interfaceIEventContext
- Parameters:
attributeReference
- Optional parameter that specifies the value the warning belongs to.key
- The id of the message from the meta model.parameters
- Optional parameters for the message.- Returns:
- boolean indicating if the error was actually added (duplicate messages are ignored).
-
addWarningText
Description copied from interface:IEventContext
This method may be used to add a warning to the current context. The warning may be linked to a value by specifying a value reference, or the value reference may be left empty (null) to indicate that the warning is generic.- Specified by:
addWarningText
in interfaceIEventContext
- Parameters:
attributeReference
- Optional parameter that specifies the value the warning belongs to.text
- The warning message that should be added to the context.- Returns:
- boolean indicating if the error was actually added (duplicate messages are ignored).
-
getErrors
Description copied from interface:IEventContext
Returns the error messages (never null) that have been set in the request scope. When no errors have been an empty array will be returned.- Specified by:
getErrors
in interfaceIEventContext
- Parameters:
onlyGenericErrors
- Boolean indicating if only generic error messages should be returned.- Returns:
- Array containing the errors that have been set on the request scope.
-
getErrors
Description copied from interface:IEventContext
Retrieves the errors for a specific ValueReference (never null) When no error messages have been set for the specified attribute, an empty array will be returned.- Specified by:
getErrors
in interfaceIEventContext
- Parameters:
attributeReference
- Reference to the attribute for which the error messages are requested.- Returns:
- Array containing the error messages for the specified attribute (may be empty).
-
getStopOnErrors
public boolean getStopOnErrors()Description copied from interface:IEventContext
This method returns the boolean indicating if errors should abort the current flow.- Specified by:
getStopOnErrors
in interfaceIEventContext
- Returns:
- boolean indicating if errors should abort the current flow.
-
isFlowBlocked
public boolean isFlowBlocked()Description copied from interface:IEventContext
This method returns a boolean indicating if the flow should be aborted. The flow is aborted under the following conditions:- StopOnErrors = true AND hasErrors = true
- SetFlowBlocked was invoked.
- Specified by:
isFlowBlocked
in interfaceIEventContext
- Returns:
- boolean indicating if the flow should be aborted.
-
setFlowBlocked
public void setFlowBlocked(boolean rollback) Description copied from interface:IEventContext
This method may be used to block the current flow regardless if any errors are present. The rollback parameter may be used to indicate if changes so far should be discarded.- Specified by:
setFlowBlocked
in interfaceIEventContext
- Parameters:
rollback
- boolean to indicate if changes so far should be discarded.
-
rollbackTransaction
protected boolean rollbackTransaction() -
setStopOnErrors
public void setStopOnErrors(boolean stopOnErrors) Description copied from interface:IEventContext
This method may be used to change the behavior when an error is encountered after the component using the context has completed. The default behavior is to stop any flow processing when the component using the context added an error. When this method is invoked with the value false, any errors from the component will be ignored, and the flow will continue normally. This setting has only effect on the current component using the flow. If another component is invoked after, that does have the stopOnErrors set to true, the flow will still be aborted.
Warning: Use this method with care, as it can result in errors being ignored or not shown if the result page does not contain the fields the errors are defined for.- Specified by:
setStopOnErrors
in interfaceIEventContext
- Parameters:
stopOnErrors
- Boolean indicating if the flow should be aborted when an error is encountered.
-
setFocus
Description copied from interface:IEventContext
This method sets the focus for a specific ValueReference (never null).- Specified by:
setFocus
in interfaceIEventContext
- Parameters:
reference
- Reference to the attribute for which the focus has to be set.
-