org.apache.lenya.workflow.impl
Class TransitionImpl

java.lang.Object
  extended by org.apache.lenya.workflow.impl.TransitionImpl
All Implemented Interfaces:
Transition

public class TransitionImpl
extends java.lang.Object
implements Transition

Implementation of a transition.


Constructor Summary
protected TransitionImpl(StateImpl sourceState, StateImpl destinationState)
          Ctor.
 
Method Summary
 void addAction(Action action)
          Assigns an action to this transition.
 void addCondition(Condition condition)
          Assigns a condition to this transition.
 boolean canFire(Situation situation, WorkflowInstance instance)
          Returns if the transition can fire in a certain situation.
 Action[] getActions()
          Returns the actions which are assigned tothis transition.
 Condition[] getConditions()
          Returns the conditions which are assigned to this transition.
 StateImpl getDestination()
          Returns the destination state of this transition.
 Event getEvent()
          Returns the event which invokes this transition.
 StateImpl getSource()
          Returns the source state of this transition.
 boolean isSynchronized()
          Returns if this transition is synchronized.
 void setEvent(Event anEvent)
          Sets the event to invoke this transition.
protected  void setSynchronized(boolean isSynchronized)
          Sets if this transition is synchronized.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransitionImpl

protected TransitionImpl(StateImpl sourceState,
                         StateImpl destinationState)
Ctor.

Parameters:
sourceState - The source state.
destinationState - The destination state.
Method Detail

getActions

public Action[] getActions()
Returns the actions which are assigned tothis transition.

Specified by:
getActions in interface Transition
Returns:
An array of actions.

addAction

public void addAction(Action action)
Assigns an action to this transition.

Parameters:
action - The action.

getConditions

public Condition[] getConditions()
Returns the conditions which are assigned to this transition.

Returns:
An array of conditions.

addCondition

public void addCondition(Condition condition)
Assigns a condition to this transition.

Parameters:
condition - The condition.

getEvent

public Event getEvent()
Returns the event which invokes this transition.

Specified by:
getEvent in interface Transition
Returns:
An event.

setEvent

public void setEvent(Event anEvent)
Sets the event to invoke this transition.

Parameters:
anEvent - An event.

getSource

public StateImpl getSource()
Returns the source state of this transition.

Returns:
A state.

getDestination

public StateImpl getDestination()
Returns the destination state of this transition.

Returns:
A state.

canFire

public boolean canFire(Situation situation,
                       WorkflowInstance instance)
                throws WorkflowException
Returns if the transition can fire in a certain situation.

Specified by:
canFire in interface Transition
Parameters:
situation - The situation.
instance - The workflow instance.
Returns:
A boolean value.
Throws:
WorkflowException - when an error occurs.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

isSynchronized

public boolean isSynchronized()
Returns if this transition is synchronized.

Specified by:
isSynchronized in interface Transition
Returns:
A boolean value.

setSynchronized

protected void setSynchronized(boolean isSynchronized)
Sets if this transition is synchronized.

Parameters:
isSynchronized - A boolean value.


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.