Book a Demo

Author Topic: Unapply profile in XMI export  (Read 4560 times)

mobius

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Unapply profile in XMI export
« on: November 09, 2018, 07:32:43 pm »
Hi,

Does anyone know how to unapply a profile while exporting to XMI ????

The profile should still be applied to the package in the repository.

BR,

M.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Unapply profile in XMI export
« Reply #1 on: November 09, 2018, 07:34:31 pm »
What would that be, "unapply a profile"?

Geert

mobius

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Unapply profile in XMI export
« Reply #2 on: November 10, 2018, 01:17:27 am »
Geert,

Remove all stereotype ( and properties / tagged values  )

BR,

M.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Unapply profile in XMI export
« Reply #3 on: November 10, 2018, 01:21:18 am »
You can't (AFAIK). To me that's like printing a book originally in French and telling the reader it's Spanish.

q.

mobius

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Unapply profile in XMI export
« Reply #4 on: November 10, 2018, 01:27:30 am »
Geert,

In a normal XMI it would mean:
- remove the profile IRI and prefix from the root
- remove the 'appliedProfile' from the 'profileApplication' section
- remove all stereotype statements --> all <profilePrefix:profileStereotype ......../> since tagged values are part of these statements these will also disappear.

This will work, but not for EA roudtrip, since EA puts all sorts of redundant information in their <xmi:Extension>.

BR,

M

mobius

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Unapply profile in XMI export
« Reply #5 on: November 10, 2018, 01:51:31 am »
quote from the spec: ( 12.3.3.3 ProfileApplication )

Once a Profile has been applied to a Package, it is allowed to remove the applied Profile at will. Removing a Profile implies that all elements that are instances of Stereotypes defined in the Profile are deleted including the instances of Profile-defined Classes they compositionally aggregate and the instances of Profile-defined composite Associations linking them. Other instances that are not compositionally aggregated must also be deleted if their defining type is no longer accessible from any other Profile applied to the same model.The removal of an applied Profile leaves the instances of elements from the referenced metamodel intact. It is only the instances of the elements from the Profile that are deleted. This means that for example a profiled UML model can always be interchanged with another tool that does not support the profile and be interpreted as a pure UML model. A Profile which is a packagedElement of another Profile can be applied individually. However, the nested Profile must specify any required metaclass and/or metamodel references if it contains any Stereotypes and may use PackageImport to indicate other Profiles to be co-applied. Metaclass and/or metamodel references are not inherited from a containing Profile.
« Last Edit: November 10, 2018, 02:04:51 am by mobius »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Unapply profile in XMI export
« Reply #6 on: November 10, 2018, 02:52:31 am »
I don't think there's a feature to do that.
You might want to play with the different options in the xmi export, or else write an xslt and apply that after exporting xmi.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Unapply profile in XMI export
« Reply #7 on: November 10, 2018, 02:53:02 am »
Still my translation example holds true. Just that Sparx allows to do such things does not make them more meaningful.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Unapply profile in XMI export
« Reply #8 on: November 12, 2018, 09:34:13 am »
I'd look at running an XSLT transform on the exported XMI. There's built-in support to do that, to the extent that you can use it as a new export format.

https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/add_import_export_scripts.html

mobius

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Unapply profile in XMI export
« Reply #9 on: November 12, 2018, 06:38:24 pm »
Simon,

I was aware of the xalt option, but not the MDG part of it, thanks.

I will probably try this, can anyone give a hint which information needs to be deleted from the xmi:extension part?

BR,
M.

PS. Are you ever gonna support xslt 2.0 ??