Skip to main content



      Home
Home » Modeling » Papyrus » Control the serialization of 'xmi:type'
Control the serialization of 'xmi:type' [message #1823272] Tue, 24 March 2020 03:19 Go to next message
Eclipse UserFriend
Hi,

I'm working with colleagues on a common project using papyrus 2019-06.
For some user, the information 'xmi:type' is serialized, for example:
...
<ownedComment xmi:type="uml:Comment" xmi:id="_ltusLVIzEeq8HeJgMSsYcw">
...

while for some other users, this information is not serialized, for example:
...
<ownedComment xmi:id="_ltusLVIzEeq8HeJgMSsYcw">
...

Is there an option in the user interface to control this beahviour when saving the model?

Thank you and kind regards,
Re: Control the serialization of 'xmi:type' [message #1823287 is a reply to message #1823272] Tue, 24 March 2020 07:30 Go to previous messageGo to next message
Eclipse UserFriend
Hi

By default EMF does not emit redundant xmi:type elements. Your second example is therefore wrong; an ownedComment is always a uml:Comment.

If you really want a bloated XMI serialization or need to support a deficient XMI reader, you can probably set the XMLResource.OPTION_SAVE_TYPE_INFORMATION in the Resource saveOptions.

"Probably" because the JavaDoc suggests that control diverts to a XMLTypeInfo which is probably part of the ExtendedMetaData that I have never really understood and so steer well clear of. It may well default usefully to save all type info for you without further effort.

Regards

Ed Willink

Re: Control the serialization of 'xmi:type' [message #1823289 is a reply to message #1823287] Tue, 24 March 2020 07:55 Go to previous messageGo to next message
Eclipse UserFriend
The two example above are taken from saved file from papyrus from two different clients. In one case the xmi:type is enforced and in the other case not. The result is confusing when comparing different version directly in Git. So, I'm wondering whether this behaviour is enforced or not in papyrus or if it can be controlled in some preferences settings.
Re: Control the serialization of 'xmi:type' [message #1823300 is a reply to message #1823289] Tue, 24 March 2020 11:29 Go to previous message
Eclipse UserFriend
Hi

I recall a thread about interchanging Papyrus/Eclipse UML models with perhaps Enterprise ARchitect which had a deficient reader, and so perhaps one of your clients fixed up the export to suit EA. No idea if this is a preference or a version change.

If you load your model in the UML Model Editor, do a trivial edit and save you should succeed in normalising the result.

Regards

Ed Willink
Previous Topic:Papyrus SysML Tutorial
Next Topic:Is Papyrus Compare still alive?
Goto Forum:
  


Current Time: Tue Jul 15 07:09:32 EDT 2025

Powered by FUDForum. Page generated in 0.05167 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top