Author Topic: Profile: Class<a> --> Attribute<a>  (Read 2603 times)

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Profile: Class<a> --> Attribute<a>
« on: January 30, 2013, 09:33:45 pm »
Hi all,

I've searched the help but fail to find the answer to the following question:

1. Is it possible - using only a Profile* - to configure my own stereotyped class to instruct the attribute dialog to automatically set only a specific <<stereotype>> for the attribute instead of the std (un-stereotyped) ones when adding new attributes?

1.b. Same Q for operations and associations.

1.c. Same Q for right-click menus when adding from the diagram view.

// Rolf Lampa

* (Yes, I plan to make a MDG Technology later)
« Last Edit: January 30, 2013, 09:55:52 pm by Rolf_Lampa »
-- There's always a solution --

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Profile: Class<a> --> Attribute<a>
« Reply #1 on: January 30, 2013, 10:40:18 pm »
AFAIK not, but you can show the stereotyped attributes, operations and associations in your own toolboxes. For the latter, its also possible to create quick-linker menus.

HTH
Günther

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: Profile: Class<a> --> Attribute<a>
« Reply #2 on: January 30, 2013, 11:03:55 pm »
Thank you for this hint. Searching for quick linker indicates that I will find my way.

It really would be a useful feature to be able to define in a stereotype what default stereotypes associated model element should have. I think I will suggest that in the dedicated fora.

Thanks again for your help.

// Rolf Lampa
-- There's always a solution --

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Profile: Class<a> --> Attribute<a>
« Reply #3 on: January 31, 2013, 01:42:42 am »
You can also do some interception of creation of attributes/operation (e.g. automatically setting a stereotype, depending on the class stereotype)  programmatically with an AddIn.

Best regards,
Günther

qwerty

  • EA Guru
  • *****
  • Posts: 12814
  • Karma: +366/-295
  • I'm no guru at all
    • View Profile
Re: Profile: Class<a> --> Attribute<a>
« Reply #4 on: January 31, 2013, 01:48:20 am »
I was about to suggest the same. The methods are EA_OnPostNewAttribute and EA_OnPostNewMethod.

q.

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: Profile: Class<a> --> Attribute
« Reply #5 on: January 31, 2013, 05:25:45 am »
Thank you Makulik & thank you qwerty, an interception will definitely be included in my final tool.

I hope that addins can be embedded into MDG Technologies so as to be included in a "package" for simple deployment on other instances of EA.

// Rolf Lampa

« Last Edit: January 31, 2013, 05:26:17 am by Rolf_Lampa »
-- There's always a solution --

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Profile: Class<a> --> Attribute
« Reply #6 on: January 31, 2013, 05:49:02 am »
Quote
I hope that addins can be embedded into MDG Technologies so as to be included in a "package" for simple deployment on other instances of EA.
Yes and no. Actually it's vice versa, you can provide a specific MDG technology from within an EA AddIn: have a look at Technology broadcasst events. Finally the AddIn needs to provide the MDG technology XML as an internal file resource. But I have never used this myself ...

HTH
Günther
« Last Edit: January 31, 2013, 05:51:06 am by g.makulik »
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

qwerty

  • EA Guru
  • *****
  • Posts: 12814
  • Karma: +366/-295
  • I'm no guru at all
    • View Profile
Re: Profile: Class<a> --> Attribute<a>
« Reply #7 on: January 31, 2013, 07:16:54 am »
Me too. In the past I had created MDG and add-in framework as two independent things. I guess it's like Günther said. The MDG for SysML for example comes with an installer that provides code and profile. No idea how EA supports creation of such an installer (I guess, it doesn't).

q.

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Profile: Class<a> --> Attribute<a>
« Reply #8 on: January 31, 2013, 07:30:47 am »
Quote
No idea how EA supports creation of such an installer (I guess, it doesn't).

I'd guess it's the AddIn's responsibility to provide an installer, and where it delivers the MDG tech XML from. It could be either a file resource integrated in the AddIn's .dll or dynamically loaded from a configuration defined file path. So nothing special necessary from EA's side.

I'm not really aware about the mentioned broadcast events flow, but EA_OnInitializeTechnologies is what you need:

Quote
Return Value:

Return the MDG Technology as a single XML string.

From where you get this XML string is up to you.

Best regards,
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/