org.apache.lenya.workflow.impl
Class WorkflowImpl

java.lang.Object
  extended by org.apache.lenya.workflow.impl.WorkflowImpl
All Implemented Interfaces:
org.apache.lenya.workflow.Workflow

public class WorkflowImpl
extends java.lang.Object
implements org.apache.lenya.workflow.Workflow

Implementation of a workflow schema.


Field Summary
 
Fields inherited from interface org.apache.lenya.workflow.Workflow
DEFAULT_PREFIX, NAMESPACE
 
Constructor Summary
protected WorkflowImpl(java.lang.String _name, java.lang.String _initialState)
          Creates a new instance of WorkflowImpl.
 
Method Summary
protected  void addEvent(java.lang.String event)
          Adds an event.
protected  void addTransition(TransitionImpl transition)
          Adds a transition.
protected  void addVariable(BooleanVariableImpl variable)
          Adds a variable.
protected  boolean containsState(java.lang.String state)
          Checks if this workflow contains a state.
 java.lang.String[] getEvents()
           
 java.lang.String getInitialState()
          Returns the initial state of this workflow.
 boolean getInitialValue(java.lang.String variableName)
           
 org.apache.lenya.workflow.Transition[] getLeavingTransitions(java.lang.String state)
           
 java.lang.String getName()
           
 java.lang.String[] getStates()
           
protected  TransitionImpl[] getTransitions()
          Returns the transitions.
 BooleanVariableImpl getVariable(java.lang.String _name)
          Returns the variable for a certain name.
 java.lang.String[] getVariableNames()
           
protected  BooleanVariableImpl[] getVariables()
          Returns the variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowImpl

protected WorkflowImpl(java.lang.String _name,
                       java.lang.String _initialState)
Creates a new instance of WorkflowImpl.

Parameters:
_name - The name.
_initialState - the initial state of the workflow.
Method Detail

getInitialState

public java.lang.String getInitialState()
Returns the initial state of this workflow.

Specified by:
getInitialState in interface org.apache.lenya.workflow.Workflow
Returns:
The initial state.

addTransition

protected void addTransition(TransitionImpl transition)
Adds a transition.

Parameters:
transition - The transition.

getTransitions

protected TransitionImpl[] getTransitions()
Returns the transitions.

Returns:
An array of transitions.

getLeavingTransitions

public org.apache.lenya.workflow.Transition[] getLeavingTransitions(java.lang.String state)
                                                             throws org.apache.lenya.workflow.WorkflowException
Specified by:
getLeavingTransitions in interface org.apache.lenya.workflow.Workflow
Throws:
org.apache.lenya.workflow.WorkflowException
See Also:
Workflow.getLeavingTransitions(java.lang.String)

containsState

protected boolean containsState(java.lang.String state)
Checks if this workflow contains a state.

Parameters:
state - The state to check.
Returns:
true if the state is contained, false otherwise.

getStates

public java.lang.String[] getStates()
Specified by:
getStates in interface org.apache.lenya.workflow.Workflow

addEvent

protected void addEvent(java.lang.String event)
Adds an event.

Parameters:
event - An event.

addVariable

protected void addVariable(BooleanVariableImpl variable)
Adds a variable.

Parameters:
variable - A variable.

getVariable

public BooleanVariableImpl getVariable(java.lang.String _name)
                                throws org.apache.lenya.workflow.WorkflowException
Returns the variable for a certain name.

Parameters:
_name - The name of the variable.
Returns:
A variable.
Throws:
org.apache.lenya.workflow.WorkflowException - if no variable with the given name exists.

getVariables

protected BooleanVariableImpl[] getVariables()
Returns the variables.

Returns:
An array of variables.

getVariableNames

public java.lang.String[] getVariableNames()
Specified by:
getVariableNames in interface org.apache.lenya.workflow.Workflow
See Also:
Workflow.getVariableNames()

getName

public java.lang.String getName()
Specified by:
getName in interface org.apache.lenya.workflow.Workflow
See Also:
Workflow.getName()

getInitialValue

public boolean getInitialValue(java.lang.String variableName)
                        throws org.apache.lenya.workflow.WorkflowException
Specified by:
getInitialValue in interface org.apache.lenya.workflow.Workflow
Throws:
org.apache.lenya.workflow.WorkflowException
See Also:
Workflow.getInitialValue(java.lang.String)

getEvents

public java.lang.String[] getEvents()
Specified by:
getEvents in interface org.apache.lenya.workflow.Workflow
See Also:
Workflow.getEvents()


Copyright $ Apache Software Foundation. All Rights Reserved.