Class Step

java.lang.Object
org.dspace.xmlworkflow.state.Step
All Implemented Interfaces:
Aware, BeanNameAware

public class Step extends Object implements 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 Details

  • Constructor Details

    • Step

      public Step()
  • Method Details

    • 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.
    • getRole

      public Role getRole()
      Get the configured Role for 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

      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:
      setBeanName in interface 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