Package org.ametys.plugins.workflow
Class AbstractAmetysWorkflow
- java.lang.Object
-
- com.opensymphony.workflow.AbstractWorkflow
-
- org.ametys.plugins.workflow.AbstractAmetysWorkflow
-
- All Implemented Interfaces:
com.opensymphony.workflow.Workflow
- Direct Known Subclasses:
WorkflowProvider.AmetysObjectWorkflow
,WorkflowProvider.ExternalWorkflow
,WorkflowProvider.GenericWorkflow
public abstract class AbstractAmetysWorkflow extends com.opensymphony.workflow.AbstractWorkflow
Base Ametys class for manipulating workflow instances.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Long,ReentrantLock>
_instancesLocks
Reentrant locks for synchronizing access to each instanceprotected static org.slf4j.Logger
_logger
Logger available to subclasses.protected WorkflowHelper
_workflowHelper
workflow helper
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractAmetysWorkflow(WorkflowHelper workflowHelper, com.opensymphony.workflow.WorkflowContext workflowContext)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
doAction(long id, int actionId, Map inputs)
int[]
getAvailableActions(long id)
Deprecated.int[]
getAvailableActions(long id, Map inputs)
long
initialize(String workflowName, int initialActionId, Map inputs)
Creates a new workflow instance of a particular type of workflow.protected boolean
transitionWorkflow(com.opensymphony.workflow.spi.WorkflowEntry entry, List currentSteps, com.opensymphony.workflow.spi.WorkflowStore store, com.opensymphony.workflow.loader.WorkflowDescriptor wf, com.opensymphony.workflow.loader.ActionDescriptor action, Map transientVars, Map inputs, com.opensymphony.module.propertyset.PropertySet ps)
-
Methods inherited from class com.opensymphony.workflow.AbstractWorkflow
canInitialize, canInitialize, canInitialize, canModifyEntryState, changeEntryState, checkImplicitFinish, completeEntry, createNewCurrentStep, executeFunction, executeTriggerFunction, getAvailableActionsForStep, getAvailableAutoActions, getAvailableAutoActionsForStep, getConfiguration, getCurrentStep, getCurrentSteps, getEntryState, getHistorySteps, getPersistence, getPersistenceProperties, getPropertySet, getResolver, getSecurityPermissions, getSecurityPermissions, getWorkflowDescriptor, getWorkflowName, getWorkflowNames, isActionAvailable, passesCondition, passesConditions, passesConditions, populateTransientMap, query, query, removeWorkflowDescriptor, saveWorkflowDescriptor, setConfiguration, setResolver, verifyInputs
-
-
-
-
Field Detail
-
_logger
protected static org.slf4j.Logger _logger
Logger available to subclasses.
-
_instancesLocks
protected Map<Long,ReentrantLock> _instancesLocks
Reentrant locks for synchronizing access to each instance
-
_workflowHelper
protected WorkflowHelper _workflowHelper
workflow helper
-
-
Constructor Detail
-
AbstractAmetysWorkflow
protected AbstractAmetysWorkflow(WorkflowHelper workflowHelper, com.opensymphony.workflow.WorkflowContext workflowContext)
Constructor- Parameters:
workflowHelper
- The workflow helperworkflowContext
- The workflow context
-
-
Method Detail
-
initialize
public long initialize(String workflowName, int initialActionId, Map inputs) throws com.opensymphony.workflow.WorkflowException
Creates a new workflow instance of a particular type of workflow.- Specified by:
initialize
in interfacecom.opensymphony.workflow.Workflow
- Overrides:
initialize
in classcom.opensymphony.workflow.AbstractWorkflow
- Parameters:
workflowName
- the type of the workflow.initialActionId
- the initial action to perform orInteger.MIN_VALUE
in order to use the first initial action.inputs
- the arguments to transmit to the workflow. Can not be null.- Returns:
- the workflow instance id.
- Throws:
com.opensymphony.workflow.WorkflowException
-
getAvailableActions
public int[] getAvailableActions(long id, Map inputs)
- Specified by:
getAvailableActions
in interfacecom.opensymphony.workflow.Workflow
- Overrides:
getAvailableActions
in classcom.opensymphony.workflow.AbstractWorkflow
-
getAvailableActions
@Deprecated public int[] getAvailableActions(long id)
Deprecated.- Specified by:
getAvailableActions
in interfacecom.opensymphony.workflow.Workflow
- Overrides:
getAvailableActions
in classcom.opensymphony.workflow.AbstractWorkflow
-
doAction
public void doAction(long id, int actionId, Map inputs) throws com.opensymphony.workflow.WorkflowException
- Specified by:
doAction
in interfacecom.opensymphony.workflow.Workflow
- Overrides:
doAction
in classcom.opensymphony.workflow.AbstractWorkflow
- Throws:
com.opensymphony.workflow.WorkflowException
-
transitionWorkflow
protected boolean transitionWorkflow(com.opensymphony.workflow.spi.WorkflowEntry entry, List currentSteps, com.opensymphony.workflow.spi.WorkflowStore store, com.opensymphony.workflow.loader.WorkflowDescriptor wf, com.opensymphony.workflow.loader.ActionDescriptor action, Map transientVars, Map inputs, com.opensymphony.module.propertyset.PropertySet ps) throws com.opensymphony.workflow.WorkflowException
- Overrides:
transitionWorkflow
in classcom.opensymphony.workflow.AbstractWorkflow
- Throws:
com.opensymphony.workflow.WorkflowException
-
-