Class PerformActions

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

@OpenApiAll public class PerformActions extends Object
Utility class providing helper methods for creating, retrieving, and managing PerformActionUsage elements that associate a performer with an action.
  • Constructor Details

    • PerformActions

      public PerformActions()
  • Method Details

    • addActionToPerformer

      public static PerformActionUsage addActionToPerformer(ActionUsage actionUsage, Feature performer, @CheckForNull Feature oldPerformer, @CheckForNull Type actionsContext)
      Ensures that the given performer has a PerformActionUsage referencing the specified action. If an existing perform action usage is found, it is reused. Otherwise, a new one is created or migrated from the old performer.

      If the perform action usage is newly associated with the performer, its referenced action is updated accordingly.

      Parameters:
      actionUsage - the action being performed
      performer - the performer feature
      oldPerformer - previous performer, if any
      actionsContext - optional context used to determine reference structure
      Returns:
      the perform action usage associated with the performer
    • disposePerformActionUsage

      public static void disposePerformActionUsage(Feature performer, ActionUsage actionUsage)
      Disposes the perform action usage associated with the given performer and action, if it exists and can be deleted.
      Parameters:
      performer - the performer feature
      actionUsage - the performed action
    • getPurePerformActionUsageInPerformer

      @CheckForNull public static PerformActionUsage getPurePerformActionUsageInPerformer(Feature performer, ActionUsage performedAction)
      Returns the perform action usage owned by the performer that references the given action, if any.
      Parameters:
      performer - the performer feature
      performedAction - the action being performed
      Returns:
      perform action usage, or null if none exists
    • streamOfPurePerformActionUsageInPerformer

      public static Stream<PerformActionUsage> streamOfPurePerformActionUsageInPerformer(Feature performer)
      Returns a stream of perform action usages owned by the performer.
      Parameters:
      performer - the performer feature
      Returns:
      stream of perform action usages
    • isPurePerformActionUsage

      public static boolean isPurePerformActionUsage(Element element)
      Checks whether the element is a pure perform action usage, meaning its EClass matches the SysML perform action usage definition exactly.
      Parameters:
      element - the element
      Returns:
      true if pure perform action usage
    • isPerformableAction

      public static boolean isPerformableAction(@CheckForNull Element element)
      Checks whether the element is an action that can be performed. Control occurrences cannot be performed.
      Parameters:
      element - the element
      Returns:
      true if the element is a performable action
    • getOrCreateOwnedPerformActionUsageTypedBy

      @CheckForNull public static PerformActionUsage getOrCreateOwnedPerformActionUsageTypedBy(Type owner, Type type, boolean create)
      Returns a perform action usage owned by the given type and typed by the specified type, creating one if requested and none exists.
      Parameters:
      owner - the owning type
      type - the type to match
      create - whether to create a new perform action usage if missing
      Returns:
      perform action usage, or null if none exists and creation is disabled