Systems-Modeling / SysML-v2-Pilot-Implementation

Proof-of-concept pilot implementation of the SysML v2 textual notation and visualization
GNU Lesser General Public License v3.0
131 stars 24 forks source link

ST6RI-800 Terminate Actions #597

Closed seidewitz closed 1 week ago

seidewitz commented 2 weeks ago

This PR implements a new capability for terminate actions in SysML v2, as specified in the resolution to the following issue approved on Ballot 4 of the SysML v2 Finalization Task Force.

Language

A terminate action usage is used to terminate the performance of some other action. It has the form

actionnameterminateexpression;

The action name (or other declaration information) is optional. The expression is evaluates to the action to be terminated. The terminated action ends its performance by the completion of the terminate action.

actionouterAction {     in actiona;     actionterm_aterminatea; // terminates a     then terminate; // terminates outerAction }

A terminate action usage may also be used to terminate a non-action occurrence. In this case, the lifetime of the terminated occurrence must end by the completion of the terminate action. That is, the terminate action usage effectively "destroys" the terminated occurrence.

partcontainer {     partcomponent : Component[0..1];     actionact {         assigncomponent := Component(); // Create component         then terminatecomponent; // Destroy component     } }

Model Library

The following elements are added to the Systems Library model Actions:

The following feature is added to the base action definition Action:

seidewitz commented 1 week ago

@ivan-gomes @manasbajaj This PR adds TerminateActionUsage to the SysML abstract syntax. The API implementation needs to be updated for this. The SysML.uml and SysML.ecore files are updated on the ST6RI-800 branch.