Book a Demo

Author Topic: MDG: How to influence the order of stereotypes in the output MDG file  (Read 5122 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
We've started to look at converting our "hand-rolled" MDG file to a formal MDG metamodel using the MDG Generator.

One nice thing about our hand-rolled version is that WE decide what the order of the stereotypes is.  Is it possible to influence the output order via the generator?

TIA,
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: MDG: How to influence the order of stereotypes in the output MDG file
« Reply #1 on: April 18, 2018, 05:52:54 pm »
Where would that oder be important? I guess in the toolbox? If so (IIRC) EA does not offer an ordering from the MDG export (since IIRC I tried that once and could not figure it out).

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: MDG: How to influence the order of stereotypes in the output MDG file
« Reply #2 on: April 18, 2018, 10:42:36 pm »
Where would that oder be important? I guess in the toolbox? If so (IIRC) EA does not offer an ordering from the MDG export (since IIRC I tried that once and could not figure it out).

q.

In the toolbox you define the order yourself. (attribute order)
I don't see where the order in the MDG file would be relevant either.

But maybe it uses the project browser order when generating the profile xml file from a package?

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: MDG: How to influence the order of stereotypes in the output MDG file
« Reply #3 on: April 19, 2018, 12:33:43 pm »
Where would that order be important? I guess in the toolbox? If so (IIRC) EA does not offer an ordering from the MDG export (since IIRC I tried that once and could not figure it out).

q.
Well, we have an existing MDG which is in a particular order  Arcs (alphabetical) followed by Vertices (alphabetical).  We are trying to regenerate the same content from the repository, so we use file comparators to compare what we generate with what we wanted to generate.  The file comparators work on text and so the order of the output is important, to help up do the comparison.

The generated MDG appears to have output the  Vertices (corrupted alphabetical) followed by Arcs (alphabetical).  I say corrupted alphabetical because the Vertices had an outlier (from close to the end alphabetically) stuck at the front, but the rest appear alphabetical.   (EAUI?)

Also, at the moment, the metatypes are intermingled in the same package and we want to separate them for ease of management, we'd like to know if that will affect the output.

So, could anyone, but especially a Sparxian, indicate how the output order is determined?
(For example, if it IS/should be Vertices (alphabetical) followed by Arcs (alphabetical), then we can easily cut and paste our original MDG file and swap.  Then "we're off and racing"!  :) )

Paolo
« Last Edit: April 19, 2018, 12:35:32 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: MDG: How to influence the order of stereotypes in the output MDG file
« Reply #4 on: April 19, 2018, 04:35:50 pm »
Paolo,

As an alternative, you could compare the xml files "functionally".

I had this same requirement to compare XSD files in a "functional" way -> ignoring order of elements (where not important), whitespace, order of attributes, etc...
(we are migrating a Magicdraw model + XSD generation to EA + XSD generation and we need to know if the XSD's (about 500 of them) are functionally still 100% the same while allowing non important differences)
What I end up doing was building my own comparer based on a code sample I found on a Microsoft website.

I uploaded it to github. I think you only need to change the (hardcoded) .xsd extension to .xml to make it compare xml file.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: MDG: How to influence the order of stereotypes in the output MDG file
« Reply #5 on: April 20, 2018, 09:43:23 am »
Paolo,

As an alternative, you could compare the xml files "functionally".

I had this same requirement to compare XSD files in a "functional" way -> ignoring the order of elements (where not important), whitespace, order of attributes, etc...
(we are migrating a Magicdraw model + XSD generation to EA + XSD generation and we need to know if the XSD's (about 500 of them) are functionally still 100% the same while allowing non-important differences)
What I end up doing was building my own comparer based on a code sample I found on a Microsoft website.

I uploaded it to github. I think you only need to change the (hardcoded) .xsd extension to .xml to make it compare xml file.

Geert
Thanks, Geert!

That should be really useful!  I'll give it a try when I get to work.

However, that doesn't change my need to know the expected output order.  You know my views on consistency.  Why is that outlier present?  I'm always nervous with "unknowns".

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

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
If you save a profile from a diagram, the stereotype elements are processed in Z-order. If you save a profile from a package, the stereotype elements are processed in project browser order.
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
If you save a profile from a diagram, the stereotype elements are processed in Z-order. If you save a profile from a package, the stereotype elements are processed in project browser order.
Thanks KP,

is that the t_diagramobjects.Sequence value for the diagram and the t_object.TPos value for the Browser?

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