java.lang.Object
com.dassault_systemes.modeler.sysml.model.Actions

@OpenApiAll public class Actions extends Object
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 Details

    • Actions

      public Actions()
  • Method Details

    • isSpecialAction

      public static boolean isSpecialAction(org.eclipse.emf.ecore.EClass eClass)
      Returns whether the given EClass represents 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:
      true if the class represents a special action
    • isIfOrLoopActionUsage

      public static boolean isIfOrLoopActionUsage(org.eclipse.emf.ecore.EClass eClass)
      Returns whether the given EClass represents an if-action or a loop-action.
      Parameters:
      eClass - the class to test
      Returns:
      true if the class is an if-action or loop-action usage
    • isForLoopActionUsage

      public static boolean isForLoopActionUsage(org.eclipse.emf.ecore.EClass eClass)
      Returns whether the given EClass represents a for-loop action usage.
      Parameters:
      eClass - the class to test
      Returns:
      true if the class is a for-loop action usage
    • isIfActionUsage

      public static boolean isIfActionUsage(org.eclipse.emf.ecore.EClass eClass)
      Returns whether the given EClass represents an if-action usage.
      Parameters:
      eClass - the class to test
      Returns:
      true if the class is an if-action usage
    • isWhileLoopActionUsage

      public static boolean isWhileLoopActionUsage(org.eclipse.emf.ecore.EClass eClass)
      Returns whether the given EClass represents a while-loop action usage.
      Parameters:
      eClass - the class to test
      Returns:
      true if the class is a while-loop action usage
    • isActionUsageOrDefinition

      public static boolean isActionUsageOrDefinition(@CheckForNull Element element)
      Returns whether the given element is an ActionUsage or ActionDefinition.
      Parameters:
      element - the element to test
      Returns:
      true if the element is an action usage or definition
    • isActionUsageOrDefinition

      public static boolean isActionUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass)
      Returns whether the given EClass represents an action usage or definition.
      Parameters:
      eClass - the class to test
      Returns:
      true if the class is an action usage or definition
    • getActions

      public static List<ActionUsage> getActions(Type type)
      Returns all ActionUsage elements 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

      public static List<ActionUsage> getOwnedActions(Type type)
      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

      public static boolean isDoneActionUsage(Element element)
      Returns whether the given element represents a “done” action usage. This is determined via the ActionsLibrary and redefinition semantics.
      Parameters:
      element - the element to test
      Returns:
      true if the element is a done action usage
    • isStartActionUsage

      public static boolean isStartActionUsage(Element element)
      Returns whether the given element represents a “start” action usage.
      Parameters:
      element - the element to test
      Returns:
      true if the element is a start action usage
    • getOrCreateInputParameter

      public static Feature getOrCreateInputParameter(ActionUsage actionUsage, int index)
      Returns the input parameter at the given index, creating it if necessary.
      Parameters:
      actionUsage - the action usage
      index - the parameter index
      Returns:
      the existing or newly created input parameter
    • getOwnedInputParameter

      @CheckForNull public static Feature getOwnedInputParameter(ActionUsage actionUsage, int index)
      Returns the owned input parameter at the given index, or null if it does not exist.
      Parameters:
      actionUsage - the action usage
      index - the parameter index
      Returns:
      the owned input parameter, or null