Class WorkflowDescriptor

java.lang.Object
com.opensymphony.workflow.loader.AbstractDescriptor
com.opensymphony.workflow.loader.WorkflowDescriptor
All Implemented Interfaces:
Validatable, XMLizable, Serializable
Direct Known Subclasses:
ImmutableWorkflowDescriptor

public class WorkflowDescriptor extends AbstractDescriptor implements Validatable
Describes a single workflow
Author:
Pat Lightbody
See Also:
  • Field Details

    • XML_HEADER

      public static final String XML_HEADER
      See Also:
    • DOCTYPE_DECL

      public static final String DOCTYPE_DECL
      See Also:
    • globalConditions

      protected ConditionsDescriptor globalConditions
    • commonActionsList

      protected List commonActionsList
    • globalActions

      protected List globalActions
    • initialActions

      protected List initialActions
    • joins

      protected List joins
    • registers

      protected List registers
    • splits

      protected List splits
    • steps

      protected List steps
    • commonActions

      protected Map commonActions
    • metaAttributes

      protected Map metaAttributes
    • timerFunctions

      protected Map timerFunctions
    • workflowName

      protected String workflowName
  • Constructor Details

  • Method Details

    • getAction

      public ActionDescriptor getAction(int id)
    • getCommonActions

      public Map getCommonActions()
      Get a Map of the common actions specified, keyed on actionId (an Integer)
      Returns:
      A list of ActionDescriptor objects
    • getGlobalActions

      public List getGlobalActions()
      Get a List of the global actions specified
      Returns:
      A list of ActionDescriptor objects
    • getGlobalConditions

      public ConditionsDescriptor getGlobalConditions()
    • getInitialAction

      public ActionDescriptor getInitialAction(int id)
    • getInitialActions

      public List getInitialActions()
      Get a List of initial steps for this workflow
      Returns:
      A list of ActionDescriptor objects
    • getJoin

      public JoinDescriptor getJoin(int id)
    • getJoins

      public List getJoins()
      Get a List of initial steps for this workflow
      Returns:
      A list of JoinDescriptor objects
    • getMetaAttributes

      public Map getMetaAttributes()
    • setName

      public void setName(String name)
    • getName

      public String getName()
    • getRegisters

      public List getRegisters()
    • getSplit

      public SplitDescriptor getSplit(int id)
    • getSplits

      public List getSplits()
      Get a List of initial steps for this workflow
      Returns:
      A list of SplitDescriptor objects
    • getStep

      public StepDescriptor getStep(int id)
    • getSteps

      public List getSteps()
      Get a List of steps in this workflow
      Returns:
      a List of StepDescriptor objects
    • setTriggerFunction

      public FunctionDescriptor setTriggerFunction(int id, FunctionDescriptor descriptor)
      Update a trigger function
      Parameters:
      id - The id for the trigger function
      descriptor - The descriptor for the trigger function
      Returns:
      The old trigger function with the specified ID, if any existed
    • getTriggerFunction

      public FunctionDescriptor getTriggerFunction(int id)
    • getTriggerFunctions

      public Map getTriggerFunctions()
      Get a Map of all trigger functions in this workflow
      Returns:
      a Map with Integer keys and FunctionDescriptor values
    • addCommonAction

      public void addCommonAction(ActionDescriptor descriptor)
      Add a common action
      Parameters:
      descriptor - The action descriptor to add
      Throws:
      IllegalArgumentException - if the descriptor's ID already exists in the workflow
    • addGlobalAction

      public void addGlobalAction(ActionDescriptor descriptor)
      Add a global action
      Parameters:
      descriptor - The action descriptor to add
      Throws:
      IllegalArgumentException - if the descriptor's ID already exists in the workflow
    • addInitialAction

      public void addInitialAction(ActionDescriptor descriptor)
      Add an initial action
      Parameters:
      descriptor - The action descriptor to add
      Throws:
      IllegalArgumentException - if the descriptor's ID already exists in the workflow
    • addJoin

      public void addJoin(JoinDescriptor descriptor)
      Add a join
      Parameters:
      descriptor - The join descriptor to add
      Throws:
      IllegalArgumentException - if the descriptor's ID already exists in the workflow
    • addSplit

      public void addSplit(SplitDescriptor descriptor)
      Add a split
      Parameters:
      descriptor - The split descriptor to add
      Throws:
      IllegalArgumentException - if the descriptor's ID already exists in the workflow
    • addStep

      public void addStep(StepDescriptor descriptor)
      Add a step
      Parameters:
      descriptor - The step descriptor to add
      Throws:
      IllegalArgumentException - if the descriptor's ID already exists in the workflow
    • removeAction

      public boolean removeAction(ActionDescriptor actionToRemove)
      Remove an action from this workflow completely.

      This method will check global actions and all steps.

      Returns:
      true if the action was successfully removed, false if it was not found
    • validate

      public void validate() throws InvalidWorkflowDescriptorException
      Description copied from interface: Validatable
      Validate this element, and propagate validation to all contained sub-elements. Should throw an InvalidWorkflowDescriptorException with details in message if the element is invalid. Validity checks should be checks that cannot be encapsulated in the DTD. Validation has to be called explicitly on writting, a writeXML() does not validate implicitly; it *IS* thus possible to write invalid descriptor files. This could be useful for e.g. a graphical workflow definition editor which would like to write incomplete definitions. Validation *IS* performed on loading a workflow definition.
      Specified by:
      validate in interface Validatable
      Throws:
      InvalidWorkflowDescriptorException
      See Also:
    • writeXML

      public void writeXML(PrintWriter out, int indent)
      Specified by:
      writeXML in interface XMLizable
    • init

      protected void init(Element root)