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 an xlworkflow 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 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)StepgetNextStep(int outcome)Get the next step based on out the outcomeintgetRequiredUsers()RolegetRole()UserSelectionActionConfiggetUserSelectionMethod()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)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, if no outcomes are configured this step will be last step in the workflowvoidsetRequiredUsers(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, this is required as every step requires oneprotected 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 config- 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 stepp or NULL if there is no step configured for this outcome
-
isValidStep
public boolean isValidStep(Context context, XmlWorkflowItem wfi) throws WorkflowConfigurationException, SQLException
-
getUserSelectionMethod
public UserSelectionActionConfig getUserSelectionMethod()
-
getNextAction
public WorkflowActionConfig getNextAction(WorkflowActionConfig currentAction)
-
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()
-
getRole
public Role getRole()
-
setUserSelectionMethod
public void setUserSelectionMethod(UserSelectionActionConfig userSelectionMethod)
Set the user selection configuration, this is required as 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
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
-
-