Class StateMachineHelper

java.lang.Object
com.nomagic.uml2.ext.jmi.helpers.StateMachineHelper

@OpenApiAll public class StateMachineHelper extends Object
An utility class with utility methods operating on state machine domain elements
  • Constructor Details

    • StateMachineHelper

      public StateMachineHelper()
  • Method Details

    • setOperationForTransition

      public static void setOperationForTransition(Transition transition, Operation operation)
      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 transition
      operation - the given operation
    • setSignalForTransition

      public static void setSignalForTransition(Transition transition, Signal signal)
      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 transition
      signal - the given signal
    • getOperationForTransition

      @CheckForNull public static Operation getOperationForTransition(Transition transition)
      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

      @CheckForNull public static Signal getSignalForTransition(Transition transition)
      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

      public static boolean isSignalEvent(Transition transition)
      Check if event of given transition is SignalEvent
      Parameters:
      transition - transition
      Returns:
      true if event is SignalEvent
    • isCallEvent

      public static boolean isCallEvent(Transition transition)
      Check if event of given transition is CallEvent
      Parameters:
      transition - transition
      Returns:
      true if event is CallEvent
    • getOperationsForTransition

      public static Collection<Operation> getOperationsForTransition(@CheckForNull Classifier classifier)
      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

      @CheckForNull public static Classifier getClassifierForTransition(Transition transition)
      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

      @CheckForNull public static Classifier getStateMachineContext(StateMachine machine)
      Returns the context of the state machine.
      Parameters:
      machine - - state machine.
      Returns:
      context of the state machine.
    • disposeTriggers

      @Deprecated public static void disposeTriggers(List<Trigger> triggers)
      Disposes given collection of triggers and referenced by them events
      Parameters:
      triggers - triggers
    • disposeTriggers

      public static void disposeTriggers(Collection<Trigger> triggers)
    • disposeEvent

      public static void disposeEvent(@CheckForNull Event event)
      Disposes event if it is not used any more by other elements in the model.
      Parameters:
      event - event
    • getEventForTransition

      @CheckForNull public static Event getEventForTransition(Transition transition)
      Returns an event of given transition. Event is taken from trigger.
      Parameters:
      transition - the given transition
      Returns:
      an event of given transition
    • getFirstTrigger

      @CheckForNull public static Trigger getFirstTrigger(Transition transition)
      Returns first trigger from transition
      Parameters:
      transition - transition
      Returns:
      trigger