Package com.nomagic.uml2.ext.jmi.helpers
Class StateMachineHelper
java.lang.Object
com.nomagic.uml2.ext.jmi.helpers.StateMachineHelper
An utility class with utility methods operating on state machine domain elements
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
disposeEvent
(Event event) Disposes event if it is not used any more by other elements in the model.static void
disposeTriggers
(Collection<Trigger> triggers) static void
disposeTriggers
(List<Trigger> triggers) Deprecated.static Classifier
getClassifierForTransition
(Transition transition) Returns the classifier as context for given transition.static Event
getEventForTransition
(Transition transition) Returns an event of given transition.static Trigger
getFirstTrigger
(Transition transition) Returns first trigger from transitionstatic Operation
getOperationForTransition
(Transition transition) Returns an operation of given transition.static Collection<Operation>
getOperationsForTransition
(Classifier classifier) Collects operations from given classifiers, base classifiers and provided interfaces of given classifiers.static Signal
getSignalForTransition
(Transition transition) Returns a signal of given transition.static Classifier
getStateMachineContext
(StateMachine machine) Returns the context of the state machine.static boolean
isCallEvent
(Transition transition) Check if event of given transition is CallEventstatic boolean
isSignalEvent
(Transition transition) Check if event of given transition is SignalEventstatic void
setOperationForTransition
(Transition transition, Operation operation) Set derived property operation for transition.static void
setSignalForTransition
(Transition transition, Signal signal) Set derived property signal for transition.
-
Constructor Details
-
StateMachineHelper
public StateMachineHelper()
-
-
Method Details
-
setOperationForTransition
Set derived property operation for transition. Operation is mapped to first trigger call event operation. If transition does not own trigger, new one is created. If trigger does not reference CallEvent or old even is referenced by other elements, new CallEvent is created.- Parameters:
transition
- the given transitionoperation
- the given operation
-
setSignalForTransition
Set derived property signal for transition. Signal is mapped to first trigger signal event signal. If transition does not own trigger, new one is created. If trigger does not reference SignalEvent or old even is referenced by other elements, new SignalEvent is created.- Parameters:
transition
- the given transitionsignal
- the given signal
-
getOperationForTransition
Returns an operation of given transition. Operation is taken from trigger call event.- Parameters:
transition
- the given transition- Returns:
- an operation of given transition
-
getSignalForTransition
Returns a signal of given transition. Signal is taken from trigger signal event.- Parameters:
transition
- the given transition- Returns:
- a signal of given transition
-
isSignalEvent
Check if event of given transition is SignalEvent- Parameters:
transition
- transition- Returns:
- true if event is SignalEvent
-
isCallEvent
Check if event of given transition is CallEvent- Parameters:
transition
- transition- Returns:
- true if event is CallEvent
-
getOperationsForTransition
Collects operations from given classifiers, base classifiers and provided interfaces of given classifiers. Current implementation uses InteractionHelper.getOperationsForCallAction(classifier)- Parameters:
classifier
- classifier- Returns:
- operations
- See Also:
-
getClassifierForTransition
Returns the classifier as context for given transition. If transition is in protocol state machine, ProtocolStateMachine.Interface can be returned.- Parameters:
transition
- transition- Returns:
- classifier
-
getStateMachineContext
Returns the context of the state machine.- Parameters:
machine
- - state machine.- Returns:
- context of the state machine.
-
disposeTriggers
Deprecated.Disposes given collection of triggers and referenced by them events- Parameters:
triggers
- triggers
-
disposeTriggers
-
disposeEvent
Disposes event if it is not used any more by other elements in the model.- Parameters:
event
- event
-
getEventForTransition
Returns an event of given transition. Event is taken from trigger.- Parameters:
transition
- the given transition- Returns:
- an event of given transition
-
getFirstTrigger
Returns first trigger from transition- Parameters:
transition
- transition- Returns:
- trigger
-
disposeTriggers(Collection)