Package org.dspace.xmlworkflow.state
Class Step
java.lang.Object
org.dspace.xmlworkflow.state.Step
- All Implemented Interfaces:
Aware,BeanNameAware
A class that contains all the data of a
Workflow step.- Author:
- Bram De Schouwer (bram.deschouwer at dot com), Kevin Van de Velde (kevin at atmire dot com), Ben Bosman (ben at atmire dot com), Mark Diggory (markd at atmire dot com)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetActionConfig(String actionID) Get an WorkflowActionConfiguration object for the provided action identifierGet the processing actions for the step.getId()getNextAction(WorkflowActionConfig currentAction) Look up the action which follows a given action.getNextStep(int outcome) Get the next step based on out the outcomeintGetter for the number of required reviews.getRole()Get the configuredRolefor this step.Getter for the step's configured user selection method.booleanhasUI()Boolean that returns whether or not the actions in this step have a uibooleanisFinished(Context c, XmlWorkflowItem wfi) Check if enough users have finished this step for it to continuebooleanisValidStep(Context context, XmlWorkflowItem wfi) Is this step "valid"?voidsetActions(List<WorkflowActionConfig> actions) Set the processing actions for the step.voidStore the name of the bean in the identifiervoidsetOutcomes(Map<Integer, Step> outcomes) Set the outcomes as a map.voidsetRequiredUsers(int requiredUsers) Set the number of required users that need to execute this step before it is completed, the default is a single uservoidSet the role of which users role should execute this stepvoidsetUserSelectionMethod(UserSelectionActionConfig userSelectionMethod) Set the user selection configuration.protected voidsetWorkflow(Workflow workflow) Set the workflow this step belongs to
-
Field Details
-
inProgressUserService
-
-
Constructor Details
-
Step
public Step()
-
-
Method Details
-
getActionConfig
Get an WorkflowActionConfiguration object for the provided action identifier- Parameters:
actionID- the action id for which we want our action configuration.- Returns:
- The corresponding WorkflowActionConfiguration
- Throws:
WorkflowConfigurationException- occurs if the provided action isn't part of the step
-
hasUI
public boolean hasUI()Boolean that returns whether or not the actions in this step have a ui- Returns:
- a boolean
-
getNextStep
Get the next step based on out the outcome- Parameters:
outcome- the outcome of the previous step- Returns:
- the next step or NULL if there is no step configured for this outcome
-
isValidStep
public boolean isValidStep(Context context, XmlWorkflowItem wfi) throws WorkflowConfigurationException, SQLException Is this step "valid"?- Parameters:
context- current DSpace session.wfi- the current workflow item in this step.- Returns:
- true if the user selection is "valid".
- Throws:
WorkflowConfigurationException- passed through.SQLException- passed through.
-
getUserSelectionMethod
Getter for the step's configured user selection method.- Returns:
- the configured user selection method for this step.
-
getNextAction
Look up the action which follows a given action.- Parameters:
currentAction- the action in question.- Returns:
- the next action in sequence.
-
getId
-
getWorkflow
-
isFinished
Check if enough users have finished this step for it to continue- Parameters:
c- The relevant DSpace Context.wfi- the workflow item to check- Returns:
- if enough users have finished this task
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
getRequiredUsers
public int getRequiredUsers()Getter for the number of required reviews.- Returns:
- the number of users required to review this step.
-
getRole
Get the configuredRolefor this step.- Returns:
- the configured role.
-
setUserSelectionMethod
@Autowired(required=true) public void setUserSelectionMethod(UserSelectionActionConfig userSelectionMethod) Set the user selection configuration. Every step requires one.- Parameters:
userSelectionMethod- the user selection method configuration
-
setOutcomes
Set the outcomes as a map. If no outcomes are configured, this step will be last step in the workflow.- Parameters:
outcomes- the map containing the outcomes.
-
getActions
Get the processing actions for the step. Processing actions contain the logic required to execute the required operations in each step.- Returns:
- the actions configured for this step
-
setActions
Set the processing actions for the step. Processing actions contain the logic required to execute the required operations in each step.- Parameters:
actions- the list of actions
-
setWorkflow
Set the workflow this step belongs to- Parameters:
workflow- the workflow configuration
-
setBeanName
Store the name of the bean in the identifier- Specified by:
setBeanNamein interfaceBeanNameAware- Parameters:
s- the bean name
-
setRequiredUsers
public void setRequiredUsers(int requiredUsers) Set the number of required users that need to execute this step before it is completed, the default is a single user- Parameters:
requiredUsers- the number of required users
-
setRole
Set the role of which users role should execute this step- Parameters:
role- the role to be configured for this step
-