Book a Demo

Author Topic: New MDG: Instance doesn't take over the tagged values from the activity/block  (Read 3441 times)

RealPecho

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
I create my first MDG and try to apply some ideas from my last company. Most of the things are already working but i have problems with the instances.

I define stereotype that extends an activity. I added some tagged values from type enumeration to the stereotype and configured the instance behavior as "instance" and give the name of another stereotype. (see screenshots)

I create also the stereotype for the instance with the same tagged values.

Problem:

I add to a diagram an activity element with the defined stereotype and change the value of the tagged value. Then I add an instance of this element to the diagram, but the instance doesn't take over the new value for the tagged values of the element.

I know, that this is possible because is working in my last company, but i don't know what i am doing wrong. i compared the 2 xml-files, but they are identical




https://github.com/RealPecho/MDG

Stereotype for activity:

Code: [Select]
<Stereotype name="BWSysDevActivity" instanceMode="Instance" instanceType="BWSysDev::BWSysDevActionCallBehavior" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<AppliesTo>
<Apply type="Activity">
<Property name="_HideStype" value="BWSysDevActivity"/>
<Property name="isReadOnly" value="false"/>
<Property name="isSingleExecution" value=""/>
<Property name="parameterName" value=""/>
<Property name="postcondition" value=""/>
<Property name="precondition" value=""/>
<Property name="_makeComposite" value="false"/>
<Property name="_UCRect" value="0"/>
</Apply>
</AppliesTo>
<TaggedValues>
<Tag name="ElementType" type="enumeration" description="" unit="" values="Mechatronical,Electrical,Mechanical,Software,Unknown" default="Unknown"/>
...
</TaggedValues>
</Stereotype>

Stereotype for instance:

Code: [Select]
<Stereotype name="BWSysDevActionCallBehavior" instanceMode="Instance" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
<AppliesTo>
<Apply type="Action">
<Property name="context" value=""/>
<Property name="effect" value=""/>
<Property name="kind" value="CallBehavior"/>
<Property name="_HideStype" value="BWSysDevActionCallBehavior"/>
</Apply>
</AppliesTo>
<TaggedValues>
<Tag name="ElementType" type="enumeration" description="" unit="" values="Mechatronical,Electrical,Mechanical,Software,Unknown" default="Unknown"/>
...
</TaggedValues>
</Stereotype>

RealPecho

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
no idea?  :'(

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Tagged values absolutely and categorically should not be copied from a classifier to an instance. Same for Behaviors to a CallBehaviorAction referencing that Behavior.

That's just not how UML profiles work.

If I had your requirement (and wasn't constrained by implementing an externally defined profile) I would make BWSysDevActivity and BWSysDevActionCallBehavior abstract. Then define specializations for each of those enumerations that link to the other for the instance type.

It may also be possible to only make that change for BWSysDevActivity and then in your shape script check for classifier.stereotype. (I say may because it's not technically a classifier, but given EA handles them similarly it may work anyway)

RealPecho

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
thanks eve, but it is not clear for me.
I defined both stereotypes as Abstract but with the spezialization is not clear what do you mean. I defined an enumeration and i used the same enumeration in both stereotypes. in Profile Helper, under "Tagged Values" i added in both the same enumaration.

another picutre of the properties of the instanz:

https://github.com/RealPecho/MDG/blob/main/properties_instanz.png

the instanz is relationed with the parental, but the attributes are not taken over.

Maybe this is not right, but it was working in the old technology and we need unfortunately in this way to avoid a mismatch

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
You seem to be assuming that an instance will copy the tagged values from it's classifier.

That is not the case. If you need that, you'll need to write some kind of automation yourself I'm afraid.

Not sure why it's working with your old technology, but I don't AFAIK you can't make EA copy the tagged values from a classifier to an instance out of the box.

Geert

RealPecho

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Thank you Guys! Now it is clear for me.
I tested again the old technology and it is not taking over the tagged values. I don't know where i saw this effect  :-\