Tom Sawyer visualization shows <<part>> for redefined features instead of actual types

I’m using Syside Modeler with Tom Sawyer visualization and encountering an issue where redefined features display as generic <> instead of showing their actual types.

Minimal Example

Library definition:


package Library {
  part def ‘Brewing System’ { /* … */ }
  part def ‘Coffee Maker’ {    
    part brewing : ‘Brewing System’;  
  }
}

Design usage:


package Design {
  import Library::*;
  part coffee_maker : ‘Coffee Maker’ {
    part redefines brewing : ‘Brewing System’ {
      // parameterize nested attributes
    }
  }
}

Expected Behavior

When visualizing coffee_maker, the child brewing should display as type ‘Brewing System’ (and then I would ideally be able to expand and show children)

Actual Behavior

The visualization shows brewing as a generic <<part>> with no type information. The library definitions visualize correctly when viewed directly.

What I’ve Tried

  • Adding explicit type to redefinition: part redefines brewing : ‘Brewing System’ — no change
  • Verified model parses correctly with syside check
  • Confirmed the semantic model is correct (cost calculations using the nested structure work)

Questions

  1. Am I missing something here? (Highly likely)
  2. Is this a known limitation of Tom Sawyer’s handling of redefines?
  3. Is there a setting or workaround to display inherited/redefined types?
  4. Are there plans to support type resolution for redefined features in future versions?

Per the KerML spec, my understanding is that the /type property for redefined features is derived rather than explicit, but I would expect the visualization to resolve this.

Hi @rwestwood!

There is currently a limitation with how the visualisation is implemented in Syside 0.8.4 and previous versions. If you click on the Syside button in the top right when focused on a .sysml file, you will notice that the visualisation function is called “Visualise current file”. Therefore, if your Library and Design are in two different .sysml files, when visualising the coffee_maker Syside will not see the contents of the Coffee Maker part definition.

Current workarounds

A workaround for now would be to put both Library and Design packages into the same .sysml file and visualise the model. You should then see something like this:

Another workaround would be to enable “beta” features of Syside Modeler through VSCode’s settings. Look for “Syside › Modeler › Viz Tom Sawyer: Show Beta” in the UI settings, or "syside.modeler.vizTomSawyer.showBeta": true in JSON settings. After enabling the setting, you should also see a “Visualise folder (beta)” option when clicking on the Syside logo. Using this option, you should get the same diagram as with the previous workaround, but if you have a lot of .sysml files in your workspace, the diagram generation might take a long time.

Future workflows

We are currently working on a significantly improved implementation of the visualisation that would allow you to visualise specific parts of the model through SysML’s view elements, instead of visualising singular model files. This solution would make it easier to generate reproducible diagrams, while also solving the issue described by you in this post. Keep an eye out on the changelogs for this!

2 Likes