Class IfActions
java.lang.Object
com.dassault_systemes.modeler.sysml.model.IfActions
Utility class providing helper methods for accessing and creating
input parameters of an
IfActionUsage. These parameters correspond
to the condition expression, the “then” action, and the “else” action.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndex of the “else” action input parameter.static final intIndex of the condition (if‑argument) input parameter.static final intIndex of the “then” action input parameter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ActionUsagegetOrCreateElseAction(IfActionUsage actionUsage, Supplier<ActionUsage> parameterFactory) Returns the “else” action of theIfActionUsage, creating it if necessary using the supplied factory.static ExpressiongetOrCreateIfArgument(IfActionUsage actionUsage, Supplier<Expression> parameterFactory) Returns the condition expression of theIfActionUsage, creating it if necessary using the supplied factory.static ActionUsagegetOrCreateThenAction(IfActionUsage actionUsage, Supplier<ActionUsage> parameterFactory) Returns the “then” action of theIfActionUsage, creating it if necessary using the supplied factory.
-
Field Details
-
IF_ARGUMENT_PARAMETER_INDEX
public static final int IF_ARGUMENT_PARAMETER_INDEXIndex of the condition (if‑argument) input parameter.- See Also:
-
THEN_ACTION_PARAMETER_INDEX
public static final int THEN_ACTION_PARAMETER_INDEXIndex of the “then” action input parameter.- See Also:
-
ELSE_ACTION_PARAMETER_INDEX
public static final int ELSE_ACTION_PARAMETER_INDEXIndex of the “else” action input parameter.- See Also:
-
-
Constructor Details
-
IfActions
public IfActions()
-
-
Method Details
-
getOrCreateIfArgument
public static Expression getOrCreateIfArgument(IfActionUsage actionUsage, Supplier<Expression> parameterFactory) Returns the condition expression of theIfActionUsage, creating it if necessary using the supplied factory.- Parameters:
actionUsage- the if‑action usage whose condition is requestedparameterFactory- factory used to create the expression if missing- Returns:
- existing or newly created condition expression
-
getOrCreateThenAction
public static ActionUsage getOrCreateThenAction(IfActionUsage actionUsage, Supplier<ActionUsage> parameterFactory) Returns the “then” action of theIfActionUsage, creating it if necessary using the supplied factory.- Parameters:
actionUsage- the if‑action usage whose then‑action is requestedparameterFactory- factory used to create the action if missing- Returns:
- existing or newly created then‑action
-
getOrCreateElseAction
public static ActionUsage getOrCreateElseAction(IfActionUsage actionUsage, Supplier<ActionUsage> parameterFactory) Returns the “else” action of theIfActionUsage, creating it if necessary using the supplied factory.- Parameters:
actionUsage- the if‑action usage whose else‑action is requestedparameterFactory- factory used to create the action if missing- Returns:
- existing or newly created else‑action
-