Book a Demo

Author Topic: How to export UML profile from Repository Resources?  (Read 4864 times)

roman104

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
  • Right Information - In Right Time - for Right Role
    • View Profile
    • Right Information - In Right Time - for Right Role
How to export UML profile from Repository Resources?
« on: August 15, 2023, 01:49:05 am »
Hi All,
I am in situation, that I need to make reverse engineering over my own UML Profile.
We have changed the UML Profile package in model dedicated for developing UML Profile.
We have imported this profile to many models.
The last change was made outside this dedicated model in local repository of one guy who left company already.
New generated UML profile doesn't work correctly and I need to fix dedicated model with UML profile package.
My problem is, that I have repository with correct UML profile in Repository Resources.
I need to extract somehow this profile to XML file to perform "reverse engineering" and correct original in UML Profle Package.
Could You please to advice me how to manage it?
Thank You very much
Kind regards
Roman

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to export UML profile from Repository Resources?
« Reply #1 on: August 15, 2023, 03:03:20 am »
Bad luck: not possible. If you don't have a backup you need to start from scratch.

q.

roman104

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
  • Right Information - In Right Time - for Right Role
    • View Profile
    • Right Information - In Right Time - for Right Role
Re: How to export UML profile from Repository Resources?
« Reply #2 on: August 15, 2023, 05:59:00 am »
Hi Qwerty
Thank You for prompt answer, although pessimistic :).
I have found the root cause of different behavior of "new" and original UML Profile.
1. Original UML profile was generated as "Save Diagram as UML Profile"
2. "New" one was generated as "Save Package as UML Profile"
The differences are in order of parameters and attributes in output xml files


That means, the dedicated repository contains the same content, but results depends on the way of generating.
Save Package as UML and Save diagram as UML Profile apply different methods for ordering the parameters in generated XML file.


Thank You very much 
kind regards
ROman

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to export UML profile from Repository Resources?
« Reply #3 on: August 15, 2023, 07:29:00 am »
Ah, I see. For a couple of reasons I wrote my own exporter for MDG which avoids these mines (and a coule of others). Unfortunately it was made for a customer and I can not (yet) make it generally available. Sparx does not have a hand for making these things user friendly. At least (after a request many many years ago) they at least saved the target location for profiles. But there's no mechanism to avoid saving the wrong was/place.

q.

roman104

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
  • Right Information - In Right Time - for Right Role
    • View Profile
    • Right Information - In Right Time - for Right Role
Re: How to export UML profile from Repository Resources?
« Reply #4 on: August 15, 2023, 09:21:29 pm »
I am confuse, surprise from implementation of UML Schema, .
XML should not be dependent on element order at all.
All parameters have key-value. Why it is dependent on order?
It is very strange.
I can rise the ticket to sparxs, may be they will add this bug into backlog.
 :)
Roman

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: How to export UML profile from Repository Resources?
« Reply #5 on: August 15, 2023, 10:47:09 pm »
Hi Roman,

I have always used "Save Diagram as UML Profile". I suspect that, if the package has multiple diagrams, "Save Package as UML Profile" adds an additional element. But I could be wrong and it will be a few days before I can check it.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to export UML profile from Repository Resources?
« Reply #6 on: August 16, 2023, 12:59:13 am »
The difference is that saving a diagram will include the rendering style. And of course only the elements that are actually on the diagram. This could be a subset of the package contents. Havig said that, I only save the package since I set the style via shape script. And it will export always all elements of the package.

q.
« Last Edit: August 16, 2023, 01:01:08 am by qwerty »

roman104

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
  • Right Information - In Right Time - for Right Role
    • View Profile
    • Right Information - In Right Time - for Right Role
Re: How to export UML profile from Repository Resources?
« Reply #7 on: August 21, 2023, 08:17:12 pm »
The difference is that saving a diagram will include the rendering style. And of course only the elements that are actually on the diagram. This could be a subset of the package contents. Havig said that, I only save the package since I set the style via shape script. And it will export always all elements of the package.

q.
Thank YOu Modesto, Thank You Qwerty.
For me it means, I have to test outputs more deeply than before.
The side effect of changing order of elements in xml file leads to total mulfunction after importing UML profile after importing.
I have tested all option EA15, EA16 32 bits, EA16, 64 bits as UML Profile source (in variants Publis Package, Publish Diagram) and impact on reading in EA15, EA16, 32 bits , EA 16 64 bits.
See attachment.
I have raised ticket. IMO there is bug in XML parser, maybe it is feature, but the parsing process is dependant on global setting - Order element !!!.


roman104

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
  • Right Information - In Right Time - for Right Role
    • View Profile
    • Right Information - In Right Time - for Right Role
Re: How to export UML profile from Repository Resources?
« Reply #8 on: August 21, 2023, 08:28:51 pm »
I cannot attach the pdf.
There are 3x2 option for generating UML Profile xml file and 6x3 option for reading xml files.
The result is:
1. If the general model option "Sort Alphabetically is ON" In Object Preferences/Sort Features Alphabetically, the option Publish Package generate xml with different order of element as Publish as Diagram.
2.In other option it works, sometime I have to select right stereotype manually for the first time, but it works.


For me, I will prefer option Publish diagram.
But for me it is strange, that xml pairs key=values are not respect during import process.


Thank You very Much for valuable discussion.
Roman