Class ForLoopActions
java.lang.Object
com.dassault_systemes.modeler.sysml.model.ForLoopActions
Utility class providing helper methods for accessing and creating
input parameters and loop‑variable elements of a
ForLoopActionUsage.
A for‑loop action typically includes:
- a sequence expression supplying iteration values,
- a body action executed for each value, and
- a loop variable referencing the current iteration element.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndex of the loop body action input parameter.static final intIndex of the sequence (iteration source) input parameter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ActionUsagegetOrCreateBodyAction(ForLoopActionUsage actionUsage, Supplier<ActionUsage> parameterFactory) Returns the loop body action of theForLoopActionUsage, creating it if necessary using the supplied factory.static FeaturegetOrCreateLoopVariable(ForLoopActionUsage actionUsage) Returns the loop variable of theForLoopActionUsage, creating it if necessary.static FeaturegetOrCreateSeqArgumentParameter(ForLoopActionUsage actionUsage) Returns the sequence argument of theForLoopActionUsage, creating it if necessary.
-
Field Details
-
SEQ_ARGUMENT_PARAMETER_INDEX
public static final int SEQ_ARGUMENT_PARAMETER_INDEXIndex of the sequence (iteration source) input parameter.- See Also:
-
BODY_ARGUMENT_PARAMETER_INDEX
public static final int BODY_ARGUMENT_PARAMETER_INDEXIndex of the loop body action input parameter.- See Also:
-
-
Constructor Details
-
ForLoopActions
public ForLoopActions()
-
-
Method Details
-
getOrCreateSeqArgumentParameter
Returns the sequence argument of theForLoopActionUsage, creating it if necessary. The returned feature represents the iteration source.- Parameters:
actionUsage- the for‑loop action usage whose sequence argument is requested- Returns:
- existing or newly created sequence argument feature
-
getOrCreateBodyAction
public static ActionUsage getOrCreateBodyAction(ForLoopActionUsage actionUsage, Supplier<ActionUsage> parameterFactory) Returns the loop body action of theForLoopActionUsage, creating it if necessary using the supplied factory.- Parameters:
actionUsage- the for‑loop action usage whose body action is requestedparameterFactory- factory used to create the action if missing- Returns:
- existing or newly created body action
-
getOrCreateLoopVariable
Returns the loop variable of theForLoopActionUsage, creating it if necessary. The loop variable is aReferenceUsageowned by the action and represents the current iteration element.- Parameters:
actionUsage- the for‑loop action usage whose loop variable is requested- Returns:
- existing or newly created loop variable feature
-