Skip to content

Comments

ST6RI-838 Control node bodies (SYSML2_-262)#642

Merged
seidewitz merged 1 commit intomasterfrom
ST6RI-838
May 2, 2025
Merged

ST6RI-838 Control node bodies (SYSML2_-262)#642
seidewitz merged 1 commit intomasterfrom
ST6RI-838

Conversation

@seidewitz
Copy link
Member

This PR implements the resolution to the following issue, as approved in SysML v2 FTF 2 Ballot 7:

(This should have been implemented in release 2025-02, but it was missed.)

In the SysML abstract syntax, ControlNodes (i.e., fork, join, decide and merge nodes) are kinds of ActionUsages that are typed by ControlActions from the Systems Model Library. The abstract syntax allows control nodes to have any sort of owned members that other kinds of action usages can. However, the textual notation syntax previously allowed only annotations to be declared in the body of a control node. The resolution to SYSML2_-262 corrects this by revising the SysML textual notation grammar to allow control nodes to have regular action bodies.

In particular, with this change, it is possible to declare control nodes with parameters, enabling the modeling of flows through them. For example:

action def A {
    action a1 {
        out x1;
    }
    then j1;

    action a2 {
        out x2;
    }
    then j1;

    flow a1.x1 to j1.x1;
    flow a2.x2 to j1.x2;

    join j1 {
        in x1;
        in x2;
        out y = (x1, x2);
    }
    then a3;

    flow j1.y to a3.y;

    action a3 {
        in y;
    }
}

Note that it is still necessary to have successions (or succession flows) into and out of control nodes in order to get the proper "control" semantics.

- Also reduced parser splitter count to 18.
- Updated ControlNodeTest for control nodes with parameters.
@seidewitz seidewitz self-assigned this Apr 29, 2025
@seidewitz seidewitz requested a review from himi April 29, 2025 23:25
@seidewitz seidewitz added this to the 2025-04 milestone Apr 29, 2025
@himi
Copy link
Member

himi commented May 2, 2025

I confirmed it worked. However, the graphical notation will be an open issue. The visualization result of the example in action view is as below:

image

Since the standard notation of join node is just a thick line and we have not discussed any notations to specify parameters with it, the flow targets are not rendered.

@seidewitz
Copy link
Member Author

Since the standard notation of join node is just a thick line and we have not discussed any notations to specify parameters with it, the flow targets are not rendered.

Yes, updating the graphical notation was specifically left open in the resolution to SYSML2_-262, because we didn't have time to address it. However, for now, just showing the flows as directly incoming/outgoing from the control node symbol is reasonable.

@seidewitz seidewitz merged commit 33d60a4 into master May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants