Systems-Modeling / SysML-v2-Release

The latest incremental release of SysML v2. Start here.
GNU Lesser General Public License v3.0
417 stars 56 forks source link

Missing tag <<variation>> on <<part def>> in PlantUML graphical representation #86

Open westboros opened 5 months ago

westboros commented 5 months ago

Installed 2024-02 release and noticed that the \<\<variation>> tag is missing on \<\<part def>> elements. However, the \<\<variation>> tag is visible on \<\<part>> elements.

From the SysMLv2 spec, it seems the \<\<variation>> should appear on \<\<part def>> elements.

From 2a-OMG_Systems_Modeling_Languge.pdf Table 4. Definition and Usage - Representative Notation:

SysMLv2VariationPartDef

From my local eclipse project:

SysMLv2VarationTag

westboros commented 5 months ago

Perhaps this bit of code in SysML2PlantUMLText.java in org.omg.sysml.plantuml is causing the behavior (line 260):

private static void appendVariation(StringBuilder sb, Type typ) {
    if (!(typ instanceof Usage)) return;
    Usage u = (Usage) typ;
    if (u.isVariation()) {
        sb.append(" <<variation>>\\n");
    }
}

Not sure why there is a need to exit the appendVariation() method if typ is not an instance of a Usage.

himi commented 5 months ago

I forgot the case that typ is of Definition. I'll fix it.