Package org.ametys.plugins.workflow
Class AbstractWorkflowComponent
java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
- All Implemented Interfaces:
LogEnabled
,Serviceable
- Direct Known Subclasses:
AbstractContentWorkflowComponent
,AbstractExplorerNodeWorkflowComponent
,AbstractNodeWorkflowComponent
,ActiveEntryFunction
,AmetysObjectCurrentStepCondition
,CheckRightsCondition
Abstract class for easily retrieving environment components
in a condition or a function.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
Record representing a condition failure -
Field Summary
Modifier and TypeFieldDescriptionprotected Logger
Logger available to subclasses.protected ServiceManager
Service manager available to subclasses.static final String
Constant for storing the content into the transient variables map.static final String
Constant for storing the content into the transient variables map.static final String
Constant for storing the result map into the transient variables map.static final String
Constant for storing the workflow validation in result map. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addWorkflowError
(Map transientVars, I18nizableText errorLabel) Add a global workflow error such as fail conditionvoid
addWorkflowWarning
(Map transientVars, I18nizableText warnLabel) Add a global workflow errors that will be traited as warningsvoid
enableLogging
(Logger logger) getConditionFailures
(Map transientVars) Retrieve the list condition failuregetContextParameters
(Map transientVars) Retrieve the workflow parameters map, or an empty map if there is no parametersgetResultsMap
(Map transientVars) Retrieve the map to write return valuesRetrieve the user responsible of the call.void
service
(ServiceManager manager)
-
Field Details
-
CONTEXT_PARAMETERS_KEY
Constant for storing the content into the transient variables map. -
RESULT_MAP_KEY
Constant for storing the result map into the transient variables map. -
FAIL_CONDITIONS_KEY
Constant for storing the content into the transient variables map. -
WORKFLOW_VALIDATION_KEY
Constant for storing the workflow validation in result map.- See Also:
-
_manager
Service manager available to subclasses. -
_logger
Logger available to subclasses.
-
-
Constructor Details
-
AbstractWorkflowComponent
public AbstractWorkflowComponent()
-
-
Method Details
-
enableLogging
- Specified by:
enableLogging
in interfaceLogEnabled
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getUser
Retrieve the user responsible of the call.- Parameters:
transientVars
- the parameters from the call.- Returns:
- the user responsible of the call.
- Throws:
com.opensymphony.workflow.WorkflowException
- if the user is not present.
-
getContextParameters
Retrieve the workflow parameters map, or an empty map if there is no parameters- Parameters:
transientVars
- the parameters from the call.- Returns:
- the workflow parameters map
-
getConditionFailures
Retrieve the list condition failure- Parameters:
transientVars
- the parameters from the call.- Returns:
- the list of failed condition
-
getResultsMap
public Map<String,Object> getResultsMap(Map transientVars) throws com.opensymphony.workflow.WorkflowException Retrieve the map to write return values- Parameters:
transientVars
- the parameters from the call.- Returns:
- the map to render.
- Throws:
com.opensymphony.workflow.WorkflowException
- if the result map is not found.
-
addWorkflowError
public void addWorkflowError(Map transientVars, I18nizableText errorLabel) throws com.opensymphony.workflow.WorkflowException Add a global workflow error such as fail condition- Parameters:
transientVars
- the parameters from the call.errorLabel
- The error label- Throws:
com.opensymphony.workflow.WorkflowException
- if the result map is not found.
-
addWorkflowWarning
public void addWorkflowWarning(Map transientVars, I18nizableText warnLabel) throws com.opensymphony.workflow.WorkflowException Add a global workflow errors that will be traited as warnings- Parameters:
transientVars
- the parameters from the call.warnLabel
- The warning label- Throws:
com.opensymphony.workflow.WorkflowException
- if the result map is not found.
-