Package org.dspace.xmlworkflow.state
Class Step
- java.lang.Object
-
- org.dspace.xmlworkflow.state.Step
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
public class Step extends Object implements org.springframework.beans.factory.BeanNameAware
A class that contains all the data of aWorkflowstep.- 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 Modifier and Type Field Description protected InProgressUserServiceinProgressUserService
-
Constructor Summary
Constructors Constructor Description Step()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowActionConfiggetActionConfig(String actionID)Get an WorkflowActionConfiguration object for the provided action identifierList<WorkflowActionConfig>getActions()Get the processing actions for the step.StringgetId()WorkflowActionConfiggetNextAction(WorkflowActionConfig currentAction)Look up the action which follows a given action.StepgetNextStep(int outcome)Get the next step based on out the outcomeintgetRequiredUsers()Getter for the number of required reviews.RolegetRole()Get the configuredRolefor this step.UserSelectionActionConfiggetUserSelectionMethod()Getter for the step's configured user selection method.WorkflowgetWorkflow()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.voidsetBeanName(String s)Store 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 uservoidsetRole(Role role)Set 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 Detail
-
inProgressUserService
@Autowired protected InProgressUserService inProgressUserService
-
-
Method Detail
-
getActionConfig
public WorkflowActionConfig getActionConfig(String actionID) throws WorkflowConfigurationException
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
public Step getNextStep(int outcome)
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
public UserSelectionActionConfig getUserSelectionMethod()
Getter for the step's configured user selection method.- Returns:
- the configured user selection method for this step.
-
getNextAction
public WorkflowActionConfig getNextAction(WorkflowActionConfig currentAction)
Look up the action which follows a given action.- Parameters:
currentAction- the action in question.- Returns:
- the next action in sequence.
-
getId
public String getId()
-
getWorkflow
public Workflow getWorkflow()
-
isFinished
public boolean isFinished(Context c, XmlWorkflowItem wfi) throws SQLException
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.
-
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
public void setOutcomes(Map<Integer,Step> outcomes)
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
public List<WorkflowActionConfig> 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
@Autowired(required=true) public void setActions(List<WorkflowActionConfig> actions)
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
protected void setWorkflow(Workflow workflow)
Set the workflow this step belongs to- Parameters:
workflow- the workflow configuration
-
setBeanName
public void setBeanName(String s)
Store the name of the bean in the identifier- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware- 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
public void setRole(Role role)
Set the role of which users role should execute this step- Parameters:
role- the role to be configured for this step
-
-