Class AbstractWorkflowAction

All Implemented Interfaces:
Initializable, Component, LogEnabled, Serviceable, Action
Direct Known Subclasses:
InitializeWorkflowAction, WorkflowAction

public abstract class AbstractWorkflowAction extends ServiceableAction implements Initializable
Abstract action for managing a workflow instance.

The following parameters are supported:

actionId
the id of the action to fire
  • Field Details

  • Constructor Details

  • Method Details

    • initialize

      public void initialize() throws Exception
      Specified by:
      initialize in interface Initializable
      Throws:
      Exception
    • act

      public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
      Specified by:
      act in interface Action
      Throws:
      Exception
    • _getActionId

      protected int _getActionId(Map objectModel, String source, Parameters parameters) throws Exception
      Provide the action id to use.

      Default implementation uses parameter actionId.

      Parameters:
      objectModel - the current object model.
      source - the current source.
      parameters - the current parameters.
      Returns:
      the action id.
      Throws:
      Exception - if an error occurs.
    • _getInputs

      protected Map<String,Object> _getInputs(Redirector redirector, Map objectModel, String source, Parameters parameters) throws Exception
      Provide the inputs to use.

      Default implementation provide the redirector.

      Parameters:
      redirector - the redirector.
      objectModel - the current object model.
      source - the current source.
      parameters - the current parameters.
      Returns:
      the inputs to use.
      Throws:
      Exception - if an error occurs.
    • _act

      protected abstract Map _act(Redirector redirector, Map objectModel, String source, Parameters parameters, int actionId, Map inputs) throws com.opensymphony.workflow.InvalidInputException, com.opensymphony.workflow.WorkflowException
      Initialize or act on a workflow instance.

      Parameters:
      redirector - the redirector.
      objectModel - the current object model.
      source - the current source.
      parameters - the current parameters.
      actionId - the action id to use.
      inputs - the inputs to use
      Returns:
      the action result.
      Throws:
      com.opensymphony.workflow.InvalidInputException - if the action id is not valid.
      com.opensymphony.workflow.WorkflowException - if the action failed.
    • _processInvalidActionException

      protected Map _processInvalidActionException(Redirector redirector, Map objectModel, String source, Parameters parameters, long actionId, Map inputs, com.opensymphony.workflow.InvalidActionException e) throws Exception
      Called when the current action is invalid.

      Default implementation throw an exception.

      Parameters:
      redirector - the redirector.
      objectModel - the current object model.
      source - the current source.
      parameters - the current parameters.
      actionId - the invalid action id.
      inputs - the inputs
      e - the invalid action exception.
      Returns:
      the action result.
      Throws:
      Exception - in order to stop the current pipeline.
    • _getFailConditions

      protected String _getFailConditions(Map inputs)
      Get the fail conditions as a String
      Parameters:
      inputs - the inputs
      Returns:
      the fail conditions
    • _getWorkflowErrors

      protected Errors _getWorkflowErrors(Map inputs)
      Get the workflow errors
      Parameters:
      inputs - The inputs
      Returns:
      The workflow errors or null if not found
    • _getWorkflowWarns

      protected Errors _getWorkflowWarns(Map inputs)
      Get the workflow warnings
      Parameters:
      inputs - The inputs
      Returns:
      The workflow warnings or null if not found
    • _processWorkflowException

      protected Map _processWorkflowException(Redirector redirector, Map objectModel, String source, Parameters parameters, long actionId, com.opensymphony.workflow.WorkflowException e) throws Exception
      Called when the current action has thrown a WorkflowException.

      Default implementation throw an exception.

      Parameters:
      redirector - the redirector.
      objectModel - the current object model.
      source - the current source.
      parameters - the current parameters.
      actionId - the invalid action id.
      e - the workflow exception.
      Returns:
      the action result.
      Throws:
      Exception - in order to stop the current pipeline.
    • _getExceptionContext

      protected abstract String _getExceptionContext(Map objectModel, String source, Parameters parameters)
      Provides the exception context for a more friendly error message.
      Parameters:
      objectModel - the current object model.
      source - the current source.
      parameters - the current parameters.
      Returns:
      the message describing the exception context.