Sparx Enterprise Architect SysML: can you make composite value types?

382 views Asked by At

Sparx Enterprise Architect / SysML:

Can you make composite value types? Like composite blocks?

I wanted to design in a visual way (tree form) data types that are composed of values, where the latter are composed of sub-values, and so on.

This is so that I can do the typing visually in a tree form.

I am not talking about inheritance here.

Example - attached as a PNG image: enter image description here

1

There are 1 answers

0
tfitz On

Yes you can, such Value Types are called 'structured type' and appear as a ValueType with multiple entries within the value compartment. An example is a 'Position' ValueType which we intend to have an x and y component, our unit of measure is 'm' for meters.

  1. Drop a ValueType onto a BDD, assign it the name 'Position'.
  2. Drop another ValueType onto a BDD, assign it the name 'm'. If so inclined in the Properties window there is a 'quantityKind' and 'Unit' field which you can fill as needed (this may be 'length' and 'meter' respectively).
  3. From the Toolbox drop a Property on the 'Position' ValueType in the Project Browser (alternatively you can drop it on the 'Position' ValueType that's in the BDD). Give this property the name 'x'.
  4. With the property selected, in the Properties window select the Properties tab. In 'Type' field select 'Select...'. Find and select your 'm' ValueType. Ok. Save Property.
  5. Save and reload the BDD. The 'Position' ValueType now has 'x:m' under the values compartment.
  6. Rinse and repeat.

Note that you are not concerned about showing units of measure in step 4 you are safe if you select Type 'Real'. However, 'x:Real' will then appear in the properties compartment of 'Position' ValueType but otherwise it's legitimate.