Author Topic: MDG Meta-constraints  (Read 2942 times)

OpenIT Solutions

  • EA User
  • **
  • Posts: 549
  • Karma: +6/-1
    • View Profile
MDG Meta-constraints
« on: October 22, 2021, 01:47:42 am »
Hi,

I'm just looking at replacing my Quicklinker CSV with a meta model (stereotyped relationships etc). One bit i can't figure out from the docs and various vidoes out there - if i use the quicklinker on a diagram and drag to an empty space - how to i specify which valid element stereotypes and connectors to display ? Any hints ? Docs that explain ?

Regards,

Jon.

qwerty

  • EA Guru
  • *****
  • Posts: 12446
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: MDG Meta-constraints
« Reply #1 on: October 22, 2021, 05:23:03 am »
I would guess that any metarelation you define would result in a new entry. However, I don't know by heart. If you figure it out, let us know :-) I'm just (again) starting to struggle with that.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7615
  • Karma: +96/-18
    • View Profile
Re: MDG Meta-constraints
« Reply #2 on: October 22, 2021, 08:10:16 am »
When you define metaconstraints and stereotyped relationships you define which what is legal.

Those legal relationships will then be filtered to match what's in the current toolbox. Unless you turn off the filter to toolbox option.
Eve

support@sparxsystems.com

OpenIT Solutions

  • EA User
  • **
  • Posts: 549
  • Karma: +6/-1
    • View Profile
Re: MDG Meta-constraints
« Reply #3 on: October 22, 2021, 07:08:15 pm »
Hi,

I have defined a stereotype relationship between two element stereotypes i have defined. If a place the two elements on a diagram and use the quicklinker to add a relationship, my stereotyped relationship is on the quicklinker. All good. However if i drag the quicklinker from a stereotyped element to empty space on the diagram, the quicklinker does not offer/contain my second stereotyped element. Its the latter bit that i can't get to work. Any clues / tips ?

If uncheck Filter to Toolbox, i'm presented with the element to create on the quicklinker. The elements and connector are in the toolbox however. So unclear what i've done wrong here...

My element stereotypes have a Class metaclass and the relationships has a Dependency metaclass, with meaning forweard/backward defined.

Regards,

Jon.


« Last Edit: October 22, 2021, 07:14:21 pm by OpenIT Solutions »

OpenIT Solutions

  • EA User
  • **
  • Posts: 549
  • Karma: +6/-1
    • View Profile
Re: MDG Meta-constraints
« Reply #4 on: October 22, 2021, 07:13:03 pm »
Hi,

I've copied the generated mdg/xml below to help diagnose the issue. very much appreciate any help/pointers :

<?xml version="1.0" encoding="windows-1252"?>
<MDG.Technology version="1.0"><Documentation id="dbX" name="dbX" version="1" notes="dbX Test profile"/><UMLProfiles><UMLProfile profiletype="uml2">
         <Documentation id="B0A553A8-F" name="dbX" version="1.0" alias="dbX" notes="dbX"/>
         <Content>
            <Stereotypes>
               <Stereotype name="Problem" metatype="Problem" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <stereotypedrelationships>
                     <stereotypedrelationship stereotype="dbX::solved_by" constraint="dbX::Solution"/>
                  </stereotypedrelationships>
                  <AppliesTo>
                     <Apply type="Class">
                        <Property name="isActive" value=""/>
                     </Apply>
                  </AppliesTo>
               </Stereotype>
               <Stereotype name="Solution" metatype="Solution" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <metaconstraints>
                     <metaconstraint umlRole="target" constraint="dbX::Problem"/>
                  </metaconstraints>
                  <AppliesTo>
                     <Apply type="Class">
                        <Property name="isActive" value=""/>
                     </Apply>
                  </AppliesTo>
               </Stereotype>
               <Stereotype name="solved_by" metatype="solved_by" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <AppliesTo>
                     <Apply type="Dependency">
                        <Property name="_lineStyle" value="orthogonalR"/>
                        <Property name="_MeaningBackwards" value="solves"/>
                        <Property name="_MeaningForwards" value="solved by"/>
                        <Property name="direction" value="Source -&gt; Destination"/>
                     </Apply>
                  </AppliesTo>
               </Stereotype>
            </Stereotypes>
            <TaggedValueTypes/>
            <ViewDefinitions/>
            <Metamodel/>
         </Content>
      </UMLProfile>
   </UMLProfiles><DiagramProfile><UMLProfile profiletype="uml2">
         <Documentation id="44255F82-2" name="dbX-D" version="1.0" notes="dbX-D"/>
         <Content>
            <Stereotypes>
               <Stereotype name="dbX Diagram" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <AppliesTo>
                     <Apply type="Diagram_Logical">
                        <Property name="alias" value="dbX"/>
                        <Property name="toolbox" value="dbX-T"/>
                     </Apply>
                  </AppliesTo>
               </Stereotype>
            </Stereotypes>
            <TaggedValueTypes/>
            <ViewDefinitions/>
            <Metamodel/>
         </Content>
      </UMLProfile>
   </DiagramProfile><UIToolboxes><UMLProfile profiletype="uml2">
         <Documentation id="AAFFFDE3-0" name="dbX-T" version="1.0" notes="dbX-T"/>
         <Content>
            <Stereotypes>
               <Stereotype name="Connectors" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <AppliesTo>
                     <Apply type="ToolboxPage"/>
                  </AppliesTo>
                  <TaggedValues>
                     <Tag name="dbX::solved_by(UML::Dependency)" type="" description="" unit="" values="" default="Solved by"/>
                  </TaggedValues>
               </Stereotype>
               <Stereotype name="dbX-T" notes="dbX-T" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <AppliesTo>
                     <Apply type="ToolboxPage"/>
                  </AppliesTo>
                  <TaggedValues>
                     <Tag name="dbX::Problem (UML::Class)" type="" description="" unit="" values="" default="Problem"/>
                     <Tag name="dbX::Solution (UML::Class)" type="" description="" unit="" values="" default="Solution"/>
                  </TaggedValues>
               </Stereotype>
            </Stereotypes>
            <TaggedValueTypes/>
            <ViewDefinitions/>
            <Metamodel/>
         </Content>
      </UMLProfile>
   </UIToolboxes></MDG.Technology>

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2858
  • Karma: +49/-3
    • View Profile
Re: MDG Meta-constraints
« Reply #5 on: October 25, 2021, 07:46:56 am »
I don't know if it's the whole issue, but you have your <metaconstraint> in the wrong place. Add two metaconstraints to the dependency stereotype, one with umlRole="source" and one with umlRole="target", pointing to the problem and solution stereotypes respectively.
The Sparx Team
support@sparxsystems.com

OpenIT Solutions

  • EA User
  • **
  • Posts: 549
  • Karma: +6/-1
    • View Profile
Re: MDG Meta-constraints
« Reply #6 on: October 27, 2021, 09:22:46 pm »
Hi KP,

I've applied changes you sugggested. Still no joy :-(. See updated / generated mdg xml below. Any other suggestions please ?

<?xml version="1.0" encoding="windows-1252"?>
<MDG.Technology version="1.0"><Documentation id="dbX" name="dbX" version="1" notes="dbX Test profile"/><UMLProfiles><UMLProfile profiletype="uml2">
         <Documentation id="B0A553A8-F" name="dbX" version="1.0" alias="dbX" notes="dbX"/>
         <Content>
            <Stereotypes>
               <Stereotype name="Problem" metatype="Problem" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <stereotypedrelationships>
                     <stereotypedrelationship stereotype="dbX::solved_by" constraint="dbX::Solution"/>
                  </stereotypedrelationships>
                  <AppliesTo>
                     <Apply type="Class">
                        <Property name="isActive" value=""/>
                     </Apply>
                  </AppliesTo>
               </Stereotype>
               <Stereotype name="Solution" metatype="Solution" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <AppliesTo>
                     <Apply type="Class">
                        <Property name="isActive" value=""/>
                     </Apply>
                  </AppliesTo>
               </Stereotype>
               <Stereotype name="solved_by" metatype="solved_by" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <metaconstraints>
                     <metaconstraint umlRole="source" constraint="dbX::Problem"/>
                     <metaconstraint umlRole="target" constraint="dbX::Solution"/>
                  </metaconstraints>
                  <AppliesTo>
                     <Apply type="Dependency">
                        <Property name="_lineStyle" value="orthogonalR"/>
                        <Property name="_MeaningBackwards" value="Solves"/>
                        <Property name="_MeaningForwards" value="Solved by"/>
                        <Property name="direction" value="Source -&gt; Destination"/>
                     </Apply>
                  </AppliesTo>
               </Stereotype>
            </Stereotypes>
            <TaggedValueTypes/>
            <ViewDefinitions/>
            <Metamodel/>
         </Content>
      </UMLProfile>
   </UMLProfiles><DiagramProfile><UMLProfile profiletype="uml2">
         <Documentation id="44255F82-2" name="dbX-D" version="1.0" notes="dbX-D"/>
         <Content>
            <Stereotypes>
               <Stereotype name="dbX Diagram" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <AppliesTo>
                     <Apply type="Diagram_Logical">
                        <Property name="alias" value="dbX"/>
                        <Property name="toolbox" value="dbX-T"/>
                     </Apply>
                  </AppliesTo>
               </Stereotype>
            </Stereotypes>
            <TaggedValueTypes/>
            <ViewDefinitions/>
            <Metamodel/>
         </Content>
      </UMLProfile>
   </DiagramProfile><UIToolboxes><UMLProfile profiletype="uml2">
         <Documentation id="AAFFFDE3-0" name="dbX-T" version="1.0" notes="dbX-T"/>
         <Content>
            <Stereotypes>
               <Stereotype name="Connectors" notes="" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <AppliesTo>
                     <Apply type="ToolboxPage"/>
                  </AppliesTo>
                  <TaggedValues>
                     <Tag name="dbX::solved_by(UML::Dependency)" type="" description="" unit="" values="" default="Solves"/>
                  </TaggedValues>
               </Stereotype>
               <Stereotype name="dbX-T" notes="dbX-T" cx="0" cy="0" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <AppliesTo>
                     <Apply type="ToolboxPage"/>
                  </AppliesTo>
                  <TaggedValues>
                     <Tag name="dbX::Problem (UML::Class)" type="" description="" unit="" values="" default="Problem"/>
                     <Tag name="dbX::Solution (UML::Class)" type="" description="" unit="" values="" default="Solution"/>
                  </TaggedValues>
               </Stereotype>
            </Stereotypes>
            <TaggedValueTypes/>
            <ViewDefinitions/>
            <Metamodel/>
         </Content>
      </UMLProfile>
   </UIToolboxes></MDG.Technology>