Interface Workflow

All Known Implementing Classes:
AbstractWorkflow, BasicWorkflow, OfbizWorkflow

public interface Workflow
The core workflow interface.
Author:
Patrick Lightbody
  • Field Details

  • Method Details

    • getAvailableActions

      int[] getAvailableActions(long id)
      Deprecated.
      use getAvailableActions(long, Map) with an empty Map instead.
    • getCurrentSteps

      List getCurrentSteps(long id)
      Returns a Collection of Step objects that are the current steps of the specified workflow instance.
      Parameters:
      id - The workflow instance id.
      Returns:
      The steps that the workflow instance is currently in.
    • getEntryState

      int getEntryState(long id)
      Return the state of the specified workflow instance id.
      Parameters:
      id - The workflow instance id.
      Returns:
      int The state id of the specified workflow
    • getHistorySteps

      List getHistorySteps(long id)
      Returns a list of all steps that are completed for the given workflow instance id.
      Parameters:
      id - The workflow instance id.
      Returns:
      a List of Steps
      See Also:
    • getPropertySet

      com.opensymphony.module.propertyset.PropertySet getPropertySet(long id)
      Get the PropertySet for the specified workflow instance id.
      Parameters:
      id - The workflow instance id.
    • getSecurityPermissions

      List getSecurityPermissions(long id)
      Deprecated.
      use getSecurityPermissions(long, java.util.Map) with a null map instead.
      Get a collection (Strings) of currently defined permissions for the specified workflow instance.
      Parameters:
      id - the workflow instance id.
      Returns:
      A List of permissions specified currently (a permission is a string name).
    • getSecurityPermissions

      List getSecurityPermissions(long id, Map inputs)
      Get a collection (Strings) of currently defined permissions for the specified workflow instance.
      Parameters:
      id - id the workflow instance id.
      inputs - inputs The inputs to the workflow instance.
      Returns:
      A List of permissions specified currently (a permission is a string name).
    • getWorkflowDescriptor

      WorkflowDescriptor getWorkflowDescriptor(String workflowName)
      Get the workflow descriptor for the specified workflow name.
      Parameters:
      workflowName - The workflow name.
    • getWorkflowName

      String getWorkflowName(long id)
      Get the name of the specified workflow instance.
      Parameters:
      id - the workflow instance id.
    • canInitialize

      boolean canInitialize(String workflowName, int initialStep)
      Check if the calling user has enough permissions to initialise the specified workflow.
      Parameters:
      workflowName - The name of the workflow to check.
      initialStep - The id of the initial state to check.
      Returns:
      true if the user can successfully call initialize, false otherwise.
    • canModifyEntryState

      boolean canModifyEntryState(long id, int newState)
      Check if the state of the specified workflow instance can be changed to the new specified one.
      Parameters:
      id - The workflow instance id.
      newState - The new state id.
      Returns:
      true if the state of the workflow can be modified, false otherwise.
    • changeEntryState

      void changeEntryState(long id, int newState) throws WorkflowException
      Modify the state of the specified workflow instance.
      Parameters:
      id - The workflow instance id.
      newState - the new state to change the workflow instance to. If the new state is
      invalid reference
      com.opensymphony.workflow.spi.WorkflowEntry.KILLED
      or
      invalid reference
      com.opensymphony.workflow.spi.WorkflowEntry.COMPLETED
      then all current steps are moved to history steps. If the new state is
      Throws:
      WorkflowException
    • doAction

      void doAction(long id, int actionId, Map inputs) throws InvalidInputException, WorkflowException
      Perform an action on the specified workflow instance.
      Parameters:
      id - The workflow instance id.
      actionId - The action id to perform (action id's are listed in the workflow descriptor).
      inputs - The inputs to the workflow instance.
      Throws:
      InvalidInputException - if a validator is specified and an input is invalid.
      InvalidActionException - if the action is invalid for the specified workflow instance's current state.
      WorkflowException
    • executeTriggerFunction

      void executeTriggerFunction(long id, int triggerId) throws WorkflowException
      Executes a special trigger-function using the context of the given workflow instance id. Note that this method is exposed for Quartz trigger jobs, user code should never call it.
      Parameters:
      id - The workflow instance id
      triggerId - The id of the speciail trigger-function
      Throws:
      WorkflowException
    • initialize

      long initialize(String workflowName, int initialAction, Map inputs) throws InvalidRoleException, InvalidInputException, WorkflowException, InvalidEntryStateException, InvalidActionException
      Initializes a workflow so that it can begin processing. A workflow must be initialized before it can begin any sort of activity. It can only be initialized once.
      Parameters:
      workflowName - The workflow name to create and initialize an instance for
      initialAction - The initial step to start the workflow
      inputs - The inputs entered by the end-user
      Throws:
      InvalidRoleException - if the user can't start this function
      InvalidInputException - if a validator is specified and an input is invalid.
      InvalidActionException - if the specified initial action is invalid for the specified workflow.
      WorkflowException
      InvalidEntryStateException
    • query

      List query(WorkflowQuery query) throws WorkflowException
      Deprecated.
      Query the workflow store for matching instances
      Throws:
      WorkflowException
    • query

      Query the workflow store for matching instances
      Throws:
      WorkflowException
    • getAvailableActions

      int[] getAvailableActions(long id, Map inputs)
      Get the available actions for the specified workflow instance.
      Parameters:
      id - The workflow instance id.
      inputs - The inputs map to pass on to conditions
      Returns:
      An array of action id's that can be performed on the specified entry
      Throws:
      IllegalArgumentException - if the specified id does not exist, or if its workflow descriptor is no longer available or has become invalid.
    • setConfiguration

      void setConfiguration(Configuration configuration)
      Set the configuration for this workflow. If not set, then the workflow will use the default configuration static instance.
      Parameters:
      configuration - a workflow configuration
    • getWorkflowNames

      String[] getWorkflowNames()
      Get all available workflow names.
    • canInitialize

      boolean canInitialize(String workflowName, int initialAction, Map inputs)
      Determine if a particular workflow can be initialized.
      Parameters:
      workflowName - The workflow name to check.
      initialAction - The potential initial action.
      inputs - The inputs to check.
      Returns:
      true if the workflow can be initialized, false otherwise.
    • removeWorkflowDescriptor

      boolean removeWorkflowDescriptor(String workflowName) throws FactoryException
      Remove the specified workflow descriptor.
      Parameters:
      workflowName - The workflow name of the workflow to remove.
      Returns:
      true if the workflow was removed, false otherwise.
      Throws:
      FactoryException - If the underlying workflow factory has an error removing the workflow, or if it does not support the removal of workflows.
    • saveWorkflowDescriptor

      boolean saveWorkflowDescriptor(String workflowName, WorkflowDescriptor descriptor, boolean replace) throws FactoryException
      Add a new workflow descriptor
      Parameters:
      workflowName - The workflow name of the workflow to add
      descriptor - The workflow descriptor to add
      replace - true, if an existing descriptor should be overwritten
      Returns:
      true if the workflow was added, fales otherwise
      Throws:
      FactoryException - If the underlying workflow factory has an error adding the workflow, or if it does not support adding workflows.