Class PerformActions
java.lang.Object
com.dassault_systemes.modeler.sysml.model.PerformActions
Utility class providing helper methods for creating, retrieving, and managing
PerformActionUsage elements that associate a performer with an action.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PerformActionUsageaddActionToPerformer(ActionUsage actionUsage, Feature performer, Feature oldPerformer, Type actionsContext) Ensures that the given performer has aPerformActionUsagereferencing the specified action.static voiddisposePerformActionUsage(Feature performer, ActionUsage actionUsage) Disposes the perform action usage associated with the given performer and action, if it exists and can be deleted.static PerformActionUsagegetOrCreateOwnedPerformActionUsageTypedBy(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.static PerformActionUsagegetPurePerformActionUsageInPerformer(Feature performer, ActionUsage performedAction) Returns the perform action usage owned by the performer that references the given action, if any.static booleanisPerformableAction(Element element) Checks whether the element is an action that can be performed.static booleanisPurePerformActionUsage(Element element) Checks whether the element is a pure perform action usage, meaning its EClass matches the SysML perform action usage definition exactly.static Stream<PerformActionUsage> streamOfPurePerformActionUsageInPerformer(Feature performer) Returns a stream of perform action usages owned by the performer.
-
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 aPerformActionUsagereferencing 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 performedperformer- the performer featureoldPerformer- previous performer, if anyactionsContext- optional context used to determine reference structure- Returns:
- the perform action usage associated with the performer
-
disposePerformActionUsage
Disposes the perform action usage associated with the given performer and action, if it exists and can be deleted.- Parameters:
performer- the performer featureactionUsage- 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 featureperformedAction- 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
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
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 typetype- the type to matchcreate- whether to create a new perform action usage if missing- Returns:
- perform action usage, or null if none exists and creation is disabled
-