org.tigris.scarab.workflow
Class CheapWorkflow

java.lang.Object
  extended byorg.tigris.scarab.workflow.DefaultWorkflow
      extended byorg.tigris.scarab.workflow.CheapWorkflow
All Implemented Interfaces:
Workflow

public class CheapWorkflow
extends DefaultWorkflow

Simple implementation of Workflow, relies on the Transition tables, where every record defines a transition available for a given Role, from an option to another.


Constructor Summary
CheapWorkflow()
           
 
Method Summary
 boolean canMakeTransition(ScarabUser user, AttributeOption fromOption, AttributeOption toOption, Issue issue)
          Returns true if the transition from the option fromOption to toOption is allowed for the current user.
 boolean canMakeTransitionsFrom(ScarabUser user, IssueType issueType, Attribute attribute, AttributeOption fromOption)
          Returns true if at least one transition from the fromOption to any other option is allowed on the given attribute in the scope of the given IssueType and for the current user.
 java.util.List filterConditionalTransitions(java.util.List transitions, Issue issue)
          Filter the allowed transitions so only those not-conditioned, those whose condition fulfill, and those not restricted by the blocking condition, will remain.
 java.util.List getTransitions(ScarabUser user, IssueType issueType, Attribute attribute)
          Returns the list of transitions allowed for the current user in the current module/issueType/attribute combination
 java.util.List getTransitionsFrom(ScarabUser user, IssueType issueType, Attribute attribute, AttributeOption fromOption)
          Returns the list of transitions allowed for the current user in the current module/issueType/attribute combination starting from fromOption.
 TransitionNode getTransitionTree(ScarabUser user, IssueType issueType, Attribute attribute)
          Returns the tree of transitions in the current module/issueType/attribute combination.
 void getTransitionTree(ScarabUser user, IssueType issueType, Attribute attribute, AttributeOption fromOption, TransitionNode node, java.util.List visitedTransitions)
          Returns the list of transitions allowed for the current user in the current module/issueType/attribute combination
 
Methods inherited from class org.tigris.scarab.workflow.DefaultWorkflow
addIssueTypeWorkflowToModule, checkInitialTransition, checkTransition, copyIssueTypeWorkflows, deleteWorkflowsForAttribute, deleteWorkflowsForOption, getWorkflowForRole, getWorkflowsForIssueType, getWorkflowsForRoleList, inherit, resetAllWorkflowsForIssueType, resetWorkflow, resetWorkflows, saveWorkflow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheapWorkflow

public CheapWorkflow()
Method Detail

canMakeTransition

public boolean canMakeTransition(ScarabUser user,
                                 AttributeOption fromOption,
                                 AttributeOption toOption,
                                 Issue issue)
Returns true if the transition from the option fromOption to toOption is allowed for the current user.

Specified by:
canMakeTransition in interface Workflow
Overrides:
canMakeTransition in class DefaultWorkflow

canMakeTransitionsFrom

public boolean canMakeTransitionsFrom(ScarabUser user,
                                      IssueType issueType,
                                      Attribute attribute,
                                      AttributeOption fromOption)
                               throws ScarabException
Returns true if at least one transition from the fromOption to any other option is allowed on the given attribute in the scope of the given IssueType and for the current user.

Specified by:
canMakeTransitionsFrom in interface Workflow
Overrides:
canMakeTransitionsFrom in class DefaultWorkflow
Throws:
org.apache.torque.TorqueException
ScarabException

getTransitions

public java.util.List getTransitions(ScarabUser user,
                                     IssueType issueType,
                                     Attribute attribute)
                              throws ScarabException
Returns the list of transitions allowed for the current user in the current module/issueType/attribute combination

Specified by:
getTransitions in interface Workflow
Overrides:
getTransitions in class DefaultWorkflow
Throws:
org.apache.torque.TorqueException
ScarabException

getTransitionTree

public TransitionNode getTransitionTree(ScarabUser user,
                                        IssueType issueType,
                                        Attribute attribute)
                                 throws ScarabException
Returns the tree of transitions in the current module/issueType/attribute combination.

Specified by:
getTransitionTree in interface Workflow
Overrides:
getTransitionTree in class DefaultWorkflow
Throws:
org.apache.torque.TorqueException
ScarabException

getTransitionTree

public void getTransitionTree(ScarabUser user,
                              IssueType issueType,
                              Attribute attribute,
                              AttributeOption fromOption,
                              TransitionNode node,
                              java.util.List visitedTransitions)
                       throws ScarabException
Returns the list of transitions allowed for the current user in the current module/issueType/attribute combination

Throws:
org.apache.torque.TorqueException
ScarabException

getTransitionsFrom

public java.util.List getTransitionsFrom(ScarabUser user,
                                         IssueType issueType,
                                         Attribute attribute,
                                         AttributeOption fromOption)
                                  throws ScarabException
Returns the list of transitions allowed for the current user in the current module/issueType/attribute combination starting from fromOption.

Specified by:
getTransitionsFrom in interface Workflow
Overrides:
getTransitionsFrom in class DefaultWorkflow
Throws:
org.apache.torque.TorqueException
ScarabException

filterConditionalTransitions

public java.util.List filterConditionalTransitions(java.util.List transitions,
                                                   Issue issue)
                                            throws org.apache.torque.TorqueException
Filter the allowed transitions so only those not-conditioned, those whose condition fulfill, and those not restricted by the blocking condition, will remain.

Parameters:
transitions -
issue -
Returns:
Throws:
org.apache.torque.TorqueException


Copyright © 2000-2004 Tigris.org. All Rights Reserved.