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,- AmetysObjectCurrentStepCondition,- CheckAllowedUsersCondition,- CheckProcessCreatorCondition,- CheckRightsCondition,- EditProcessFunction,- PilotageStatusCheckCondition,- SetProcessCurrentStepId
 
 public abstract class AbstractWorkflowComponent extends Object implements LogEnabled, Serviceable Abstract class for easily retrieving environment components in a condition or a function.
- 
- 
Field SummaryFields Modifier and Type Field Description protected Logger_loggerLogger available to subclasses.protected ServiceManager_managerService manager available to subclasses.static StringCONTEXT_PARAMETERS_KEYConstant for storing the content into the transient variables map.static StringFAIL_CONDITIONS_KEYConstant for storing the content into the transient variables map.static StringRESULT_MAP_KEYConstant for storing the result map into the transient variables map.static StringWORKFLOW_ERRORS_KEYConstant for storing the workflow errors in result map.static StringWORKFLOW_WARNS_KEYConstant for storing the workflow warnings in result map.
 - 
Constructor SummaryConstructors Constructor Description AbstractWorkflowComponent()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWorkflowError(Map transientVars, I18nizableText errorLabel)Add a global workflow error such as fail conditionvoidaddWorkflowWarning(Map transientVars, I18nizableText warnLabel)Add a global workflow errors that will be traited as warningsvoidenableLogging(Logger logger)List<String>getConditionFailures(Map transientVars)Retrieve the list condition failuresMap<String,Object>getContextParameters(Map transientVars)Retrieve the workflow parameters map, or an empty map if there is no parametersMap<String,Object>getResultsMap(Map transientVars)Retrieve the map to write return valuesUserIdentitygetUser(Map transientVars)Retrieve the user responsible of the call.voidservice(ServiceManager manager)
 
- 
- 
- 
Field Detail- 
CONTEXT_PARAMETERS_KEYpublic static final String CONTEXT_PARAMETERS_KEY Constant for storing the content into the transient variables map.
 - 
RESULT_MAP_KEYpublic static final String RESULT_MAP_KEY Constant for storing the result map into the transient variables map.
 - 
FAIL_CONDITIONS_KEYpublic static final String FAIL_CONDITIONS_KEY Constant for storing the content into the transient variables map.
 - 
WORKFLOW_ERRORS_KEYpublic static final String WORKFLOW_ERRORS_KEY Constant for storing the workflow errors in result map.- See Also:
- Constant Field Values
 
 - 
WORKFLOW_WARNS_KEYpublic static final String WORKFLOW_WARNS_KEY Constant for storing the workflow warnings in result map.- See Also:
- Constant Field Values
 
 - 
_managerprotected ServiceManager _manager Service manager available to subclasses.
 
- 
 - 
Constructor Detail- 
AbstractWorkflowComponentpublic AbstractWorkflowComponent() 
 
- 
 - 
Method Detail- 
enableLoggingpublic void enableLogging(Logger logger) - Specified by:
- enableLoggingin interface- LogEnabled
 
 - 
servicepublic void service(ServiceManager manager) throws ServiceException - Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
 - 
getUserpublic UserIdentity getUser(Map transientVars) throws com.opensymphony.workflow.WorkflowException 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.
 
 - 
getContextParameterspublic Map<String,Object> getContextParameters(Map transientVars) throws com.opensymphony.workflow.WorkflowException 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
- Throws:
- com.opensymphony.workflow.WorkflowException- if the object model or the request is not present.
 
 - 
getConditionFailurespublic List<String> getConditionFailures(Map transientVars) throws com.opensymphony.workflow.WorkflowException Retrieve the list condition failures- Parameters:
- transientVars- the parameters from the call.
- Returns:
- the list of failed condition
- Throws:
- com.opensymphony.workflow.WorkflowException- If an error occurred
 
 - 
getResultsMappublic 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.
 
 - 
addWorkflowErrorpublic 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.
 
 - 
addWorkflowWarningpublic 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.
 
 
- 
 
-