Class UmlUtils
java.lang.Object
org.springframework.statemachine.uml.support.UmlUtils
Utilities for uml model processing.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.uml2.uml.Model
Gets the model.static org.eclipse.emf.ecore.resource.Resource
getResource
(String modelPath) Gets the resource for a model.static boolean
isFinalState
(org.eclipse.uml2.uml.State state) Checks ifState
is a final state.static boolean
isInitialState
(org.eclipse.uml2.uml.State state) Checks ifState
is an initial state by checking if it has incoming transition from UML's initial literal.static TransitionKind
mapUmlTransitionType
(org.eclipse.uml2.uml.Transition transition) Map uml transtion type.static String
resolveBodyByLanguage
(String language, org.eclipse.uml2.uml.BodyOwner owner) Resolve body by language.static Collection<String>
resolveDererredEvents
(org.eclipse.uml2.uml.State state) Resolve dererred events from a state.static org.eclipse.uml2.uml.Transition
resolveInitialTransition
(org.eclipse.uml2.uml.State state) Resolve initial transition from aState
if it exists, otherwise null is returned.resolveTransitionAction
(org.eclipse.uml2.uml.Transition transition, StateMachineComponentResolver<String, String> resolver) Resolve transition action or null if no action was found.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.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.static Collection<Action<String,
String>> resolveTransitionActions
(org.eclipse.uml2.uml.Transition transition, StateMachineComponentResolver<String, String> resolver) Resolve transition actions.
-
Constructor Details
-
UmlUtils
public UmlUtils()
-
-
Method Details
-
getModel
Gets the model.- Parameters:
modelPath
- the model path- Returns:
- the model
-
getResource
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 ifState
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 aState
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 transitionresolver
- 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 transitionresolver
- the state machine component resolver- Returns:
- the action
-
resolveTransitionActionFunctions
public static Collection<Function<StateContext<String,String>, resolveTransitionActionFunctionsreactor.core.publisher.Mono<Void>>> (org.eclipse.uml2.uml.Transition transition, StateMachineComponentResolver<String, String> resolver) Resolve transition actions.- Parameters:
transition
- the transitionresolver
- the state machine component resolver- Returns:
- the collection of actions
-
resolveTransitionActionFunction
public static Function<StateContext<String,String>, resolveTransitionActionFunctionreactor.core.publisher.Mono<Void>> (org.eclipse.uml2.uml.Transition transition, StateMachineComponentResolver<String, String> resolver) Resolve transition action or null if no action was found.- Parameters:
transition
- the transitionresolver
- the state machine component resolver- Returns:
- the action
-
isFinalState
public static boolean isFinalState(org.eclipse.uml2.uml.State state) Checks ifState
is a final state.- Parameters:
state
- the state- Returns:
- true, if is final state
-
resolveBodyByLanguage
Resolve body by language.- Parameters:
language
- the languageowner
- the owner- Returns:
- the body or null if not found
-
resolveDererredEvents
Resolve dererred events from a state.- Parameters:
state
- the state- Returns:
- the collection of deferred events
-
mapUmlTransitionType
Map uml transtion type.- Parameters:
transition
- the transition- Returns:
- the transition kind
-