Class WorkflowAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.plugins.workflow.cocoon.AbstractWorkflowAction
-
- org.ametys.plugins.workflow.cocoon.WorkflowAction
-
- All Implemented Interfaces:
Initializable
,Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
ContentWorkflowAction
,FormEntriesWorkflowAction
,ProcessWorkflowAction
public class WorkflowAction extends AbstractWorkflowAction
Action for firing a transition on a workflow.The following parameters are supported:
- workflowId
- the id of the workflow to use
- actionId
- the id of the action to fire
Map
returned is empty on successful transition and throw an exception on error.
-
-
Field Summary
-
Fields inherited from class org.ametys.plugins.workflow.cocoon.AbstractWorkflowAction
_workflowProvider
-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description WorkflowAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map
_act(Redirector redirector, Map objectModel, String source, Parameters parameters, int actionId, Map inputs)
Initialize or act on a workflow instance.protected Map
_getActionResult(Redirector redirector, Map objectModel, String source, Parameters parameters)
Provides the action result after successful workflow transition.protected String
_getExceptionContext(Map objectModel, String source, Parameters parameters)
Provides the exception context for a more friendly error message.protected long
_getWorkflowId(Map objectModel, String source, Parameters parameters)
Provide the workflow id.-
Methods inherited from class org.ametys.plugins.workflow.cocoon.AbstractWorkflowAction
_getActionId, _getFailConditions, _getInputs, _getWorkflowErrors, _getWorkflowWarns, _processInvalidActionException, _processWorkflowException, act, initialize
-
Methods inherited from class org.apache.cocoon.acting.ServiceableAction
service
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
WorkflowAction
public WorkflowAction()
-
-
Method Detail
-
_act
protected Map _act(Redirector redirector, Map objectModel, String source, Parameters parameters, int actionId, Map inputs) throws com.opensymphony.workflow.InvalidInputException, com.opensymphony.workflow.WorkflowException
Description copied from class:AbstractWorkflowAction
Initialize or act on a workflow instance.- Specified by:
_act
in classAbstractWorkflowAction
- 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.
-
_getWorkflowId
protected long _getWorkflowId(Map objectModel, String source, Parameters parameters)
Provide the workflow id.Default implementation uses parameter
workflowId
.- Parameters:
objectModel
- the current object model.source
- the current source.parameters
- the current parameters.- Returns:
- the workflow id.
-
_getActionResult
protected Map _getActionResult(Redirector redirector, Map objectModel, String source, Parameters parameters)
Provides the action result after successful workflow transition.Default implementation returns a empty
Map
.- Parameters:
redirector
- the redirector.objectModel
- the current object model.source
- the current source.parameters
- the current parameters.- Returns:
- the action result.
-
_getExceptionContext
protected String _getExceptionContext(Map objectModel, String source, Parameters parameters)
Description copied from class:AbstractWorkflowAction
Provides the exception context for a more friendly error message.- Specified by:
_getExceptionContext
in classAbstractWorkflowAction
- Parameters:
objectModel
- the current object model.source
- the current source.parameters
- the current parameters.- Returns:
- the message describing the exception context.
-
-