Author Topic: SysML enumerations  (Read 10844 times)

ChB

  • EA User
  • **
  • Posts: 40
  • Karma: +4/-0
    • View Profile
SysML enumerations
« on: April 05, 2016, 10:42:25 pm »
Hello All,

I'm using SysML 1.4 in EA 12.1 SysEng Edition to model a system (electronics, software and some mechanical aspects).

I'm performing high level design using SysML 1.4  <<block>> elements and have been happily giving some blocks "value" properties typed by a <<valueType>>.

I've defined valueTypes for things like "speed", "power", "temperature".   All good so far.  I can create value properties for blocks using these valueTypes.  And I can use the same valueTypes for flow properties.

I'd like a block to have a value property which is of an enumeration type.  How do I model that?  I can create <<enumeration>> elements and use literal attributes to define the set of possible values of that enumeration but I can't use the <<enumeration>> to type a block's value property.  Block properties that are typed with <<valueType>> are shown as "values" whereas those typed with <<enumeration>> are shown as "properties".

How do I define a valueType for something like "color" which can only have values Red, Orange, Yellow, Green?  And use that as the type of a block's value property?

Note that the purpose of the "model" is to communicate to other team members, we're not intending to generate code or perform simulations etc, it all about human-to-human communication.
« Last Edit: April 05, 2016, 10:48:18 pm by ChB »

PeterHeintz

  • EA User
  • **
  • Posts: 967
  • Karma: +58/-18
    • View Profile
Re: SysML enumerations
« Reply #1 on: April 05, 2016, 11:22:24 pm »
According UML an enumeration is a DataType and therefore also a kind of Value Type.

The thing is just that once you type a property with a ValueType it goes in EA into the values compartment but if you assign a enumeration it goes for some reasons into the properties compartment (“anything else compartment)”.

If you need to have the enumeration in the values compartment you could use a generalization between your real enumeration and a “helper Value Type”.
Best regards,

Peter Heintz

ChB

  • EA User
  • **
  • Posts: 40
  • Karma: +4/-0
    • View Profile
Re: SysML enumerations
« Reply #2 on: April 06, 2016, 12:01:11 am »
Many thanks Peter, that's a clear explanation and suggestion.

Regarding enumerations you said: "it goes for some reasons into the properties compartment".

I suggest this is not an EA quirk because the SysML 1.4 spec states:
Quote
A property typed by a SysML ValueType is classified as a value property, and always has composite aggregation.  [...]  Properties of any type may be shown in a “properties” compartment or in additional compartments with user-defined labels.
(That's from section 8.3.2.3 of http://www.omg.org/spec/SysML/1.4/PDF/ )

This feels like an SysML weakness, not an EA weakness but I like your suggestion Peter, I think that generalisation connector will convey sufficient detail.

PeterHeintz

  • EA User
  • **
  • Posts: 967
  • Karma: +58/-18
    • View Profile
Re: SysML enumerations
« Reply #3 on: April 06, 2016, 05:55:37 pm »
Yes, SysML spec. has several weaknesses and a good example is the enumeration that is just mentioned to be existed but nothing else.
However EA also has several weaknesses in supporting SysML. Some might be based on the weaknesses of the SysML spec. others are just weaknesses of the EA implementation.
For us as users it does not matter, we want to have a tool that makes sense with few weaknesses.
Best regards,

Peter Heintz

ChB

  • EA User
  • **
  • Posts: 40
  • Karma: +4/-0
    • View Profile
Re: SysML enumerations
« Reply #4 on: April 06, 2016, 06:19:42 pm »
Yes, SysML spec. has several weaknesses and a good example is the enumeration that is just mentioned to be existed but nothing else.

For the record, for other people searching this forum:

Agreed, I could not find a useful explanation or example of Enumeration in the SysML 1.4 spec.
Furthermore "A Practical Guide to SysML" by Friedenthal, Moore and Steiner (3rd edition covering 1.4) didn't help either.

I'm not sure but I think Enumerations would be useful when creating type (stereotype) extensions in a company or project specific profile.... but that's a dark mystery for me at the moment.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8068
  • Karma: +118/-20
    • View Profile
Re: SysML enumerations
« Reply #5 on: April 08, 2016, 03:27:57 pm »
The SysML specification doesn't have a lot to say about enumerations because it doesn't explicitly customize them, so Enumerations are just the same as in UML.

The ValueType stereotype can be applied to an enumeration (because enumeration is a kind of datatype) I'm not sure it should be though. The tagged values don't seem relevant, but it does make it appear in the values compartment (which makes sense to me)

ChB

  • EA User
  • **
  • Posts: 40
  • Karma: +4/-0
    • View Profile
Re: SysML enumerations
« Reply #6 on: April 08, 2016, 06:00:02 pm »
The ValueType stereotype can be applied to an enumeration...

Oh yes, that could be exactly what I want.  Thank you.

PeterHeintz

  • EA User
  • **
  • Posts: 967
  • Karma: +58/-18
    • View Profile
Re: SysML enumerations
« Reply #7 on: April 08, 2016, 06:28:57 pm »
I tried this.
Just assigning a valueType stereotype to the enumeration is sufficient. Tags for units and quantityKinds are not required at all.
Nevertheless I have the impression that SysML spec. should define that a enumeration should go under values in any case.
Best regards,

Peter Heintz

ChB

  • EA User
  • **
  • Posts: 40
  • Karma: +4/-0
    • View Profile
Re: SysML enumerations
« Reply #8 on: April 08, 2016, 07:49:06 pm »
Yes, it's working for me too.  I've converted some of my model to use an enumeration that's stereotyped as a valueType.   Where I used to use an "ordinary" valueType I'm now using an enumeration stereotyped as a valueType.

It's looking good so far and "makes sense" for human-to-human communication using my model.

Thanks all. Hope this thread is useful to others.