Class Actions
java.lang.Object
com.dassault_systemes.modeler.sysml.model.Actions
Utility methods for identifying action usages and definitions, as well as
common action subtypes such as if-actions, loop-actions, assignment actions,
accept actions, send actions, and terminate actions.
These helpers centralize common type checks and provide convenience access
to owned and created input parameters of ActionUsage elements.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ActionUsage> getActions(Type type) Returns allActionUsageelements referenced by the given type.static FeaturegetOrCreateInputParameter(ActionUsage actionUsage, int index) Returns the input parameter at the given index, creating it if necessary.static List<ActionUsage> getOwnedActions(Type type) Returns the actions owned directly by the given type.static FeaturegetOwnedInputParameter(ActionUsage actionUsage, int index) Returns the owned input parameter at the given index, ornullif it does not exist.static booleanisActionUsageOrDefinition(Element element) Returns whether the given element is anActionUsageorActionDefinition.static booleanisActionUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents an action usage or definition.static booleanisDoneActionUsage(Element element) Returns whether the given element represents a “done” action usage.static booleanisForLoopActionUsage(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents a for-loop action usage.static booleanisIfActionUsage(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents an if-action usage.static booleanisIfOrLoopActionUsage(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents an if-action or a loop-action.static booleanisSpecialAction(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents a “special” action.static booleanisStartActionUsage(Element element) Returns whether the given element represents a “start” action usage.static booleanisWhileLoopActionUsage(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents a while-loop action usage.
-
Constructor Details
-
Actions
public Actions()
-
-
Method Details
-
isSpecialAction
public static boolean isSpecialAction(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents a “special” action. Special actions include:- control nodes,
- if- and loop-action usages,
- assignment actions,
- accept actions,
- send actions, and
- terminate actions.
- Parameters:
eClass- the class to test- Returns:
trueif the class represents a special action
-
isIfOrLoopActionUsage
public static boolean isIfOrLoopActionUsage(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents an if-action or a loop-action.- Parameters:
eClass- the class to test- Returns:
trueif the class is an if-action or loop-action usage
-
isForLoopActionUsage
public static boolean isForLoopActionUsage(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents a for-loop action usage.- Parameters:
eClass- the class to test- Returns:
trueif the class is a for-loop action usage
-
isIfActionUsage
public static boolean isIfActionUsage(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents an if-action usage.- Parameters:
eClass- the class to test- Returns:
trueif the class is an if-action usage
-
isWhileLoopActionUsage
public static boolean isWhileLoopActionUsage(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents a while-loop action usage.- Parameters:
eClass- the class to test- Returns:
trueif the class is a while-loop action usage
-
isActionUsageOrDefinition
Returns whether the given element is anActionUsageorActionDefinition.- Parameters:
element- the element to test- Returns:
trueif the element is an action usage or definition
-
isActionUsageOrDefinition
public static boolean isActionUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents an action usage or definition.- Parameters:
eClass- the class to test- Returns:
trueif the class is an action usage or definition
-
getActions
Returns allActionUsageelements referenced by the given type. This includes inherited and non-owned actions.- Parameters:
type- the type whose actions are requested- Returns:
- a list of action usages
-
getOwnedActions
Returns the actions owned directly by the given type.- Definitions expose owned actions.
- Usages expose nested actions.
- Parameters:
type- the type whose owned actions are requested- Returns:
- a list of owned action usages
-
isDoneActionUsage
Returns whether the given element represents a “done” action usage. This is determined via theActionsLibraryand redefinition semantics.- Parameters:
element- the element to test- Returns:
trueif the element is a done action usage
-
isStartActionUsage
Returns whether the given element represents a “start” action usage.- Parameters:
element- the element to test- Returns:
trueif the element is a start action usage
-
getOrCreateInputParameter
Returns the input parameter at the given index, creating it if necessary.- Parameters:
actionUsage- the action usageindex- the parameter index- Returns:
- the existing or newly created input parameter
-
getOwnedInputParameter
Returns the owned input parameter at the given index, ornullif it does not exist.- Parameters:
actionUsage- the action usageindex- the parameter index- Returns:
- the owned input parameter, or
null
-