|
standard library package States { |
|
doc |
|
|
|
|
|
|
|
|
|
|
|
private import Occurrences::Occurrence; |
|
private import StatePerformances::StatePerformance; |
|
private import StatePerformances::StateTransitionPerformance; |
|
private import Actions::Action; |
|
private import Actions::TransitionAction; |
|
private import Actions::transitionActions; |
|
private import Actions::AcceptAction; |
|
private import Actions::actions; |
|
private import SequenceFunctions::notEmpty; |
|
private import SequenceFunctions::size; |
|
|
|
abstract state def StateAction :> Action, StatePerformance { |
|
doc |
|
|
|
|
|
|
|
|
|
|
|
entry action entryAction :>> 'entry'; |
|
do action doAction: Action :>> 'do'; |
|
exit action exitAction: Action :>> 'exit'; |
|
|
|
attribute :>> isTriggerDuring; |
|
|
|
ref state self: StateAction :>> Action::self, StatePerformance::self; |
|
|
|
action :>> subactions :> middle { |
|
doc |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
action substates: StateAction[0..*] :> stateActions, subactions { |
|
doc |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
abstract state exclusiveStates: StateAction[0..*] :> substates { |
|
doc |
|
|
|
|
|
|
|
|
|
} |
|
|
|
abstract action stateTransitions: StateTransitionAction[0..*] :> transitions { |
|
doc |
|
|
|
|
|
|
|
} |
|
|
|
succession stateSequencing first exclusiveStates[0..1] then exclusiveStates[0..1] { |
|
doc |
|
|
|
|
|
|
|
} |
|
assert constraint {notEmpty(exclusiveStates) implies size(stateSequencing) == size(exclusiveStates) - 1} |
|
} |
|
|
|
action def StateTransitionAction :> TransitionAction, StateTransitionPerformance { |
|
doc |
|
|
|
|
|
|
|
|
|
|
|
in transitionLinkSource[1]: StateAction :>> |
|
TransitionAction::transitionLinkSource, StateTransitionPerformance::transitionLinkSource; |
|
|
|
out payload[0..*]; |
|
in :>> receiver; |
|
|
|
bind payload = accepter.payload; |
|
bind receiver = accepter.receiver; |
|
} |
|
|
|
abstract state stateActions: StateAction[0..*] nonunique :> actions { |
|
doc |
|
|
|
|
|
|
|
} |
|
} |