java.lang.Object
org.springframework.statemachine.uml.support.UmlUtils

public abstract class UmlUtils extends Object
Utilities for uml model processing.
  • Constructor Details

    • UmlUtils

      public UmlUtils()
  • Method Details

    • getModel

      public static org.eclipse.uml2.uml.Model getModel(String modelPath)
      Gets the model.
      Parameters:
      modelPath - the model path
      Returns:
      the model
    • getResource

      public static org.eclipse.emf.ecore.resource.Resource getResource(String modelPath)
      Gets the resource for a model.
      Parameters:
      modelPath - the model path
      Returns:
      the resource
    • isInitialState

      public static boolean isInitialState(org.eclipse.uml2.uml.State state)
      Checks if State is an initial state by checking if it has incoming transition from UML's initial literal.
      Parameters:
      state - the state
      Returns:
      true, if is initial state
    • resolveInitialTransition

      public static org.eclipse.uml2.uml.Transition resolveInitialTransition(org.eclipse.uml2.uml.State state)
      Resolve initial transition from a State if it exists, otherwise null is returned.
      Parameters:
      state - the state
      Returns:
      the transition
    • resolveTransitionActions

      public static Collection<Action<String,String>> resolveTransitionActions(org.eclipse.uml2.uml.Transition transition, StateMachineComponentResolver<String,String> resolver)
      Resolve transition actions.
      Parameters:
      transition - the transition
      resolver - the state machine component resolver
      Returns:
      the collection of actions
    • resolveTransitionAction

      public static Action<String,String> resolveTransitionAction(org.eclipse.uml2.uml.Transition transition, StateMachineComponentResolver<String,String> resolver)
      Resolve transition action or null if no action was found.
      Parameters:
      transition - the transition
      resolver - the state machine component resolver
      Returns:
      the action
    • resolveTransitionActionFunctions

      public static Collection<Function<StateContext<String,String>,reactor.core.publisher.Mono<Void>>> resolveTransitionActionFunctions(org.eclipse.uml2.uml.Transition transition, StateMachineComponentResolver<String,String> resolver)
      Resolve transition actions.
      Parameters:
      transition - the transition
      resolver - the state machine component resolver
      Returns:
      the collection of actions
    • resolveTransitionActionFunction

      public static Function<StateContext<String,String>,reactor.core.publisher.Mono<Void>> resolveTransitionActionFunction(org.eclipse.uml2.uml.Transition transition, StateMachineComponentResolver<String,String> resolver)
      Resolve transition action or null if no action was found.
      Parameters:
      transition - the transition
      resolver - the state machine component resolver
      Returns:
      the action
    • isFinalState

      public static boolean isFinalState(org.eclipse.uml2.uml.State state)
      Checks if State is a final state.
      Parameters:
      state - the state
      Returns:
      true, if is final state
    • resolveBodyByLanguage

      public static String resolveBodyByLanguage(String language, org.eclipse.uml2.uml.BodyOwner owner)
      Resolve body by language.
      Parameters:
      language - the language
      owner - the owner
      Returns:
      the body or null if not found
    • resolveDererredEvents

      public static Collection<String> resolveDererredEvents(org.eclipse.uml2.uml.State state)
      Resolve dererred events from a state.
      Parameters:
      state - the state
      Returns:
      the collection of deferred events
    • mapUmlTransitionType

      public static TransitionKind mapUmlTransitionType(org.eclipse.uml2.uml.Transition transition)
      Map uml transtion type.
      Parameters:
      transition - the transition
      Returns:
      the transition kind