Book a Demo

Author Topic: stereotypedrelationship on/from metaclass  (Read 21590 times)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
stereotypedrelationship on/from metaclass
« on: November 10, 2021, 02:52:56 am »
The Help says:
Quote
You can use a «stereotypedrelationship» connector between two Stereotypes or Metaclasses to specify a valid stereotyped connector between instances of those elements.
So I added one from a metaclass to a stereotype and one self-connector for that metaclass (being ActionPin; I just posted another bug related to that one). But neither is exported in the XML.

Is it just the Help being wrong or is there and work around?

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: stereotypedrelationship on/from metaclass
« Reply #1 on: November 10, 2021, 10:12:29 am »
In my test it worked. Not sure what you've done differently. Are you looking in the right place?

Code: [Select]
<?xml  version='1.0' encoding='windows-1252' ?>
<UMLProfile profiletype="uml2">
<Documentation id="F3315FE4-E" name="MetaclassRules" version="1.0" notes="MetaclassRules"/>
<Content>
<Stereotypes/>
<TaggedValueTypes/>
<ViewDefinitions/>
<Metamodel>
<Metaclass name="ActionPin" notes="">
<stereotypedrelationships>
<stereotypedrelationship stereotype="ArchiMate3::ArchiMate_Flow" constraint="ActionPin;ActivityParameter"/>
</stereotypedrelationships>
</Metaclass>
<Metaclass name="ActivityParameter" notes="">
<stereotypedrelationships>
<stereotypedrelationship stereotype="ArchiMate3::ArchiMate_Flow" constraint="ActivityParameter"/>
</stereotypedrelationships>
</Metaclass>
</Metamodel>
</Content>
</UMLProfile>

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: stereotypedrelationship on/from metaclass
« Reply #2 on: November 10, 2021, 08:06:16 pm »
A couple of ideas to help debug things, q...


As Eve's solution says, these relationships end up in the <metamodel/> section.


Secondly, you now know how it should work.  I would import Eve's code (with appropriate changes for your specific needs) into your MDG, and confirm that it works.  If not, then there's something else "at play". If so, then just get your model to generate the same thing.  I've found things can get a bit "touchy" with the model-based QL and things stop working for no real apparent reason.


If you run these tests and it doesn't resolve things for you, let us know and I can help with some other ideas.


Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: stereotypedrelationship on/from metaclass
« Reply #3 on: November 10, 2021, 09:00:19 pm »
Well, I can't import the above XML to get me a «profile» model but only a working instance too proof it works. But I'm at the step before that.

I looked again: clearly I do have an ActionPin metaclass with three stereotyped relationships (of my object flow stereotype): One from a sterotyped activity parameter, one towards it and on self-reference for the metaclass. When I export the profile I only see a single occurence of ActionPin in the whole file:
Code: [Select]
<Stereotype name="activity parameter" metatype="Activity parameter" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="1" hideicon="0" generalizes="Noteable" baseStereotypes="Noteable">
<stereotypedrelationships>
<stereotypedrelationship stereotype="MyProfile::object flow" constraint="ActionPin;MyProfile::activity parameter"/>
</stereotypedrelationships>
...
So that's only the one from the stereotype towards the metaclass. I don't see the other two.

q.

P.S. Forgot to say that the metamodel section is empty...
« Last Edit: November 10, 2021, 09:16:44 pm by qwerty »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: stereotypedrelationship on/from metaclass
« Reply #4 on: November 10, 2021, 10:38:47 pm »

Well, I can't import the above XML to get me a «profile» model but only a working instance to prove it works. But I'm at the step before that.




P.S. Forgot to say that the metamodel section is empty...
Yes, add Eve's code after generation, to check that it works.  Remove all references to the Action Pin relationship (sounds like only one).


Let us know if it works.


Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: stereotypedrelationship on/from metaclass
« Reply #5 on: November 10, 2021, 11:35:04 pm »
I don't doubt it works (though I'll check it). My problem is the step BEFORE that. My profile does not export that structure.

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: stereotypedrelationship on/from metaclass
« Reply #6 on: November 10, 2021, 11:45:07 pm »
I added the above to my profile. But these Perspectives drive me crazy. I still have not figured out when they filter what. For the above I need the Archimate stuff. I enabled that in the MDG list but it does not offer anything from Archimate (neither in the drag-to-blank nor for any diagrams to create with). When trying to create an object flow (any) it still croaks it would be invalid.

It feels like crawling from one mud hole to the next.

q.
« Last Edit: November 10, 2021, 11:55:44 pm by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: stereotypedrelationship on/from metaclass
« Reply #7 on: November 10, 2021, 11:56:39 pm »
Perspectives work reasonably well, and perspective sets work reasonably well.
The idea is to leave the MDG settings alone (everything enabled) and use the perspective to select the allowed MDG's.

With the perspective sets you can then create a set of (a single in my case) perspectives that is allowed for a group of users.

This helped to greatly reduce the number of diagram types etc.. available for the regular users, while still allowing the full set for power-users and administrators.

Geert


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: stereotypedrelationship on/from metaclass
« Reply #8 on: November 10, 2021, 11:57:48 pm »
Just don't use the "strict" option, because that will mess up everything (such as common relations like trace that are no longer visible)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: stereotypedrelationship on/from metaclass
« Reply #9 on: November 11, 2021, 01:25:12 am »
Basically I try to use it as you say. But these filters All, Personal, bla... just confuse me and never seem to do any filtering. It's just "something" that happens or does not happen. I know that I have the tendency to fall into SW traps that lay around nobody else ever fell in. Anyhow, I don't get it. And I've not touched the strict since I did understand the meaning of that less than the rest.

q.
« Last Edit: November 11, 2021, 01:32:22 am by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: stereotypedrelationship on/from metaclass
« Reply #10 on: November 11, 2021, 02:20:39 am »
I have one Model based set that contains all the MDG's we use.
Then in the group restrictions, I have created a Perspective group that only contains my Perspective set, and I assign that set to the security group(s)

Now the users can only choose between my perspective or All (which is also only my perspective, so it doesn't matter which they choose)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: stereotypedrelationship on/from metaclass
« Reply #11 on: November 11, 2021, 04:34:48 am »
Well, I more or less did that too. But eventually I want to see "All" but I never notice any difference between that I my perspective. Just let's pretend it's "just me". There were times when I was excited using EA. Since years it's more and more growing a "uh, EA again?". Sad but true.

q.