|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.evelopers.unimod.core.ModelElement com.evelopers.unimod.core.stateworks.Transition
Transition abstraction. Has source and target states, trigged event, guard condition and output actions to be executed in a case of this transition chosen as transition to go.
Transition has several internal states that the following table illustrates:
+---------------------------------------------------------------------------------+ | state | source state set | source attached | target state set | target attached | +---------------------------------------------------------------------------------+ | 1 | no | no | no | no | | 2 | yes | no | no | no | | 3 | yes | yes | no | no | | 4 | yes | yes | yes | no | | 5 | yes | yes | yes | yes | | 6 | no | no | yes | no | | 7 | no | no | yes | yes | | 8 | yes | no | yes | yes | | 9 | yes | no | yes | no | +---------------------------------------------------------------------------------+
To set source and target state and attach them, use method reconnect(com.evelopers.unimod.core.stateworks.State, com.evelopers.unimod.core.stateworks.State)
.
There are 4 different types of Transition because of different types of Event
and Guard
:
Type | Event | Guard | Semantics |
1 | E1 | O1.X1 | E1 && O1.X1 |
2 | Event.ANY | O1.X1 | E1 || E2 || .. || Ex && O1.X1 where E1..Ex are all possible event |
3 | E1 | Guard.ELSE | E1 && !(guard1 || guard2 || ... || guardx) where guard 1..guardx are guard conditions on all outgoing transitions with event E1 |
4 | Event.ANY | Guard.ELSE | (E1 && !(guard11 || guard12 || ... || guard1x)) || (E2 && !(guard21 || guard22 || ... || guard2x)) || ... || (Ey && !(guardy1 || guardy2 || ... || guardyx)) |
Field Summary | |
protected Event |
event
Trigger event. |
static java.lang.String |
EVENT_PROPERTY
|
protected Guard |
guard
Guard condition |
static java.lang.String |
GUARD_PROPERTY
|
static java.lang.String |
OUTPUT_ACTIONS_PROPERTY
|
protected java.util.List |
outputActions
List of output actions. |
protected State |
sourceState
Source state |
protected State |
targetState
Target state |
Fields inherited from class com.evelopers.unimod.core.ModelElement |
listeners, name, NAME_PROPERTY, stereotype, STEREOTYPE_PROPERTY |
Constructor Summary | |
protected |
Transition(State sourceState,
State targetState,
Guard guard,
Event event)
Creates transition. |
Method Summary | |
void |
addOutputAction(Action action)
Adds output action |
void |
attachSource()
|
void |
attachTarget()
|
void |
detachSource()
|
void |
detachTarget()
|
boolean |
equals(java.lang.Object o)
Compare with another model element. |
Event |
getEvent()
Returns trigged event |
Guard |
getGuard()
Returns guard condition |
java.util.List |
getOutputActions()
Returns output actions |
State |
getSourceState()
Returns source state |
State |
getTargetState()
Returns target state |
int |
hashCode()
Returns model element hash code. |
void |
reconnect(State newSourceState,
State newTargetState)
Reconnects transition to new source and target states. |
void |
removeOutputAction(Action action)
Removes output action |
void |
setEvent(Event newEvent)
|
void |
setGuard(Guard guard)
|
void |
setSourceState(State newSourceState)
Sets new source state. |
void |
setTargetState(State newTargetState)
Sets new target state. |
java.lang.String |
toString()
Returns transition string representation |
Methods inherited from class com.evelopers.unimod.core.ModelElement |
accept, addPropertyChangeListener, firePropertyChange, getName, getStereotype, initListeners, removePropertyChangeListener, setName, setStereotype |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String OUTPUT_ACTIONS_PROPERTY
public static final java.lang.String EVENT_PROPERTY
public static final java.lang.String GUARD_PROPERTY
protected State sourceState
protected State targetState
protected Event event
protected Guard guard
protected java.util.List outputActions
Constructor Detail |
protected Transition(State sourceState, State targetState, Guard guard, Event event)
Guard.TRUE_EXPR
and if given Event is null - it's Event.NO_EVENT
sourceState
- source statetargetState
- target stateguard
- guard guardevent
- trigged eventMethod Detail |
public void reconnect(State newSourceState, State newTargetState)
newSourceState
- new source statenewTargetState
- public State getSourceState()
public void setSourceState(State newSourceState)
newSourceState
- new source state. If null, then transition will only removes itself
from old source state outgoing transitions list.public void attachSource()
public void detachSource()
public State getTargetState()
public void setTargetState(State newTargetState)
newTargetState
- new target state. If null, then transition will only removes itlsef
from target state incoming transitions set.public void attachTarget()
public void detachTarget()
public Event getEvent()
public void setEvent(Event newEvent)
public Guard getGuard()
public void setGuard(Guard guard)
public void addOutputAction(Action action)
action
- action to addpublic void removeOutputAction(Action action)
action
- action to removepublic java.util.List getOutputActions()
public boolean equals(java.lang.Object o)
ModelElement
equals
in class ModelElement
o
- another model element
public int hashCode()
ModelElement
hashCode
in class ModelElement
public java.lang.String toString()
toString
in class ModelElement
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |