Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: chrisfcarroll on July 02, 2021, 01:15:12 am

Title: Setting (default) Available DataTypes for Attributes of a Class in a Package
Post by: chrisfcarroll on July 02, 2021, 01:15:12 am
I have created a Package for a domain model and set its Language to <none>. I create a diagram in the package and set its language to <none> as well.

I create a Class by dragging from the toolbox to the diagram. I want the datatypes available for the attributes of the class to be the UML profile datatypes (Boolean, Integer, String etc) but mostly the datatypes available look like C or Java : boolean, byte, double, char etc.

(1) How do I get new classes to default to the language of the Package or the diagram?

(2) How do I get an existing class to offer me UML datatypes for its attributes?

Concerning question 2: I can see that if I set a class's language to C# and then click off the class and click on it again I am then offered C# language datatypes for the attributes. But I see nothing I can do to get the UML datatypes. Setting language to <none> or to blank doesn't have any effect.


EA 14 Professional
Title: Re: Setting (default) Available DataTypes for Attributes of a Class in a Package
Post by: qwerty on July 02, 2021, 04:40:43 am
The datatypes are language agnostic. They are defined in UML itself.

q.
Title: Re: Setting (default) Available DataTypes for Attributes of a Class in a Package
Post by: chrisfcarroll on July 02, 2021, 06:42:54 am
Ah. So if language is a red herring, I am still left looking for what determines that dropdown of datatypes for an Attribute.

It certainly looks — https://imgur.com/gallery/DddQy74 — language-centric?

(https://imgur.com/gallery/DddQy74)
Title: Re: Setting (default) Available DataTypes for Attributes of a Class in a Package
Post by: qwerty on July 02, 2021, 07:32:26 am
Not sure about that, but when you deal with databases you can indeed set specific datatypes. There's some setting in EA but I don't remember where. EA is not straight in various aspects. Maybe you wait for a Sparxian to explain it...

q.
Title: Re: Setting (default) Available DataTypes for Attributes of a Class in a Package
Post by: Modesto Vega on July 02, 2021, 05:58:38 pm
Just a few comments:

One other point in UML data types are an element. This is not the way Sparx currently implements data types but you could also use this approach.
Title: Re: Setting (default) Available DataTypes for Attributes of a Class in a Package
Post by: philchudley on July 03, 2021, 06:29:23 am
To set the global language to <none> for all elements especially classes:

1) Click the Portal in the Ribbon
2) Select Toolbars -> Code Engineering from the the menu


This will display a floating toolbar which you can dock to a suitable position, once docked, select <none> from the first drop down list.

The second drop down list will allow to set the target DBMS for table elements.

NOTE: this setting will one affect new elements ... existing elements will still have their original default language (usually Java)

Then when adding attributes to a class element using the Features window, you can set the attribute type to one of the UML primitives (String, Boolean, Integer, Real, Unlimited Natural) which are now in the drop down list.

Also  note the default type for any attribute is int regardless on language setting. But can be changed as stated above.

Phil
Title: Re: Setting (default) Available DataTypes for Attributes of a Class in a Package
Post by: qwerty on July 03, 2021, 07:27:03 am
You might run a query in the SQL scratchpad:
Code: [Select]
SELECT * from t_datatypesThat might give you an idea. (Actually I never needed to care about these datatypes so I'm pretty lost here)

q.