Class AbstractWorkflowComponent

java.lang.Object
org.ametys.plugins.workflow.AbstractWorkflowComponent
All Implemented Interfaces:
LogEnabled, Serviceable
Direct Known Subclasses:
AbstractContentWorkflowComponent, AbstractExplorerNodeWorkflowComponent, AbstractNodeWorkflowComponent, AmetysObjectCurrentStepCondition, CheckRightsCondition, PilotageStatusCheckCondition

public abstract class AbstractWorkflowComponent extends Object implements LogEnabled, Serviceable
Abstract class for easily retrieving environment components in a condition or a function.
  • Field Details

  • Constructor Details

  • Method Details

    • enableLogging

      public void enableLogging(Logger logger)
      Specified by:
      enableLogging in interface LogEnabled
    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • getUser

      public 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.
    • getContextParameters

      public 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.
    • getConditionFailures

      public 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
    • 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.