Book a Demo

Author Topic: Create custom Diagram from MDG  (Read 4738 times)

rmartinezb

  • EA User
  • **
  • Posts: 44
  • Karma: +1/-0
    • View Profile
Create custom Diagram from MDG
« on: February 24, 2017, 07:50:37 pm »
Hi!
I created a new MDG that defines a new toolbox and assign it to a custom diagram. In Ea, when I create a new diagram, i can select my new technology and i haven't any problem, but when i create a diagram from an addin only the called "Custom" toolbox are shown, not my custom toolbox:



The way I create the diagram is:
            EA.Diagram diagram = thePackage.Diagrams.AddNew(diagramName, "DevOpsMDG::DevOps");
            diagram.Update();

And in my MDG file I have:

               <Stereotype name="DevOps " alias="DevOps" notes="Custom MDG" cx="386" cy="88" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0">
                  <AppliesTo>
                    <Apply type="Diagram_Custom">
                          <Property name="alias" value="DevOps"/>
                     <Property name="diagramID" value="DevOps"/>
                     <Property name="toolbox" value="DevOps"/>
                    </Apply>
                  </AppliesTo>
               </Stereotype>

I think the problem must be in one of this codes. Anyone know what I'm doing wrong?

Greetings.

rmartinezb

  • EA User
  • **
  • Posts: 44
  • Karma: +1/-0
    • View Profile
Re: Create custom Diagram from MDG
« Reply #1 on: March 01, 2017, 10:51:54 pm »
Hi!
I solved my problem, I would have something wrong in the MDG, so I redo it from the beginning and now all works.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Create custom Diagram from MDG
« Reply #2 on: March 02, 2017, 07:45:35 pm »
Hello,

Since profiles, toolboxes and diagram sets are all stored in the same format, you can quite easily accidentally overwrite a toolbox file with a profile file, etc. The fact that EA only remembers one "most recent" file for all three types doesn't help, and neither does the fact that when EA encounters a diagram set content in a toolbox file, which clearly won't work, it doesn't inform you but quietly creates a broken MDG Technology file.

I recommend using separate subdirectories for the three types of XMI file, and different naming standards as well. And being very careful.

/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Create custom Diagram from MDG
« Reply #3 on: March 02, 2017, 09:40:05 pm »
Besides what Uffe said, I also have some scripting aid that actually looks into the single MDG files and puts the parts together after verification only. I asked Sparx to do similar things years ago. Well, they talk Sparxian. I don't.

q.