Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Empty comments in imported XMI-based UML
Empty comments in imported XMI-based UML [message #1690636] Mon, 30 March 2015 09:24 Go to next message
André  Pankraz is currently offline André PankrazFriend
Messages: 5
Registered: March 2015
Junior Member
Hi,

we observed empty comments in the XMI-imported UML model in the newest Eclipse 4.4.2 with UML2 Extender SDK 5.0.2.v20150202-0947.
The comments where fine with UML2 SDK 4.x.

I tried to isolate and guess the problem as good as I can. I think, the problem is the XMI-version:
<xmi:XMI xmi:version="20131001" xmlns:xmi=".../XMI/20131001"

With this detected XMI version the Eclipse Importer doesn't accept anymore ownedComments with a direct body-attribute like this:
<ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985" annotatedElement="eee_1045467100313_135436_1" body="Author:andre.&#xA;Created:27.03.15 14:26.&#xA;Title:.&#xA;Comment:.&#xA;"/>

The Eclipse Importer works fine with body as sub-element, which I observed through changing/saving the comment in Eclipse Ecore Viewer:
<ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985" annotatedElement="eee_1045467100313_135436_1" >
<body>Author:andre.&#xA;Created:27.03.15 14:26.&#xA;Title:.&#xA;Comment:.&#xA;</body>
</ownedComment>

Is this a known problem?

Best regards,
André Pankraz
Re: Empty comments in imported XMI-based UML [message #1690673 is a reply to message #1690636] Mon, 30 March 2015 13:56 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5843
Registered: July 2009
Senior Member
Hi

That looks correct to me. I don't think that you are allowed to have
new-lines in non-data elements (in any XML version). Use &xA;

Regards

Ed Willink


On 30/03/2015 12:16, André Pankraz wrote:
> Hi,
>
> we observed empty comments in the XMI-imported UML model in the newest
> Eclipse 4.4.2 with UML2 Extender SDK 5.0.2.v20150202-0947.
> The comments where fine with UML2 SDK 4.x.
>
> I tried to isolate and guess the problem as good as I can. I think,
> the problem is the XMI-version:
> <xmi:XMI xmi:version="20131001" xmlns:xmi=".../XMI/20131001"
> With this detected XMI version the Eclipse Importer doesn't accept
> anymore ownedComments with a direct body-attribute like this:
> <ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985"
> annotatedElement="eee_1045467100313_135436_1" body="Author:andre.
> Created:27.03.15 14:26.
> Title:.
> Comment:.
> "/>
>
> The Eclipse Importer works fine with body as sub-element, which I
> observed through changing/saving the comment in Eclipse Ecore Viewer:
> <ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985"
> annotatedElement="eee_1045467100313_135436_1" >
> <body>Author:andre.
> Created:27.03.15 14:26.
> Title:.
> Comment:.
> </body>
> </ownedComment>
>
> Is this a known problem?
>
> Best regards,
> André Pankraz
Re: Empty comments in imported XMI-based UML [message #1690674 is a reply to message #1690673] Mon, 30 March 2015 14:19 Go to previous messageGo to next message
André  Pankraz is currently offline André PankrazFriend
Messages: 5
Registered: March 2015
Junior Member
Hi,

Might be a problem with your client? I used #xA and can see it in my post.

To avoid confusion, I reduced the example to:

Doesn't work:
<ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985" annotatedElement="eee_1045467100313_135436_1" body="TEST"/>

Works:
<ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985" annotatedElement="eee_1045467100313_135436_1" >
<body>TEST</body>
</ownedComment>


The interesting problem here is, that MD18 with Eclipse UML2 SDK v4.x exports the ownedComment-text as body-attribute, and Eclipse UML2 v5.x SDK cannot read this (it wants it as a sub element <body>).

Best regards,
André

Ed Willink wrote on Mon, 30 March 2015 13:56
Hi

That looks correct to me. I don't think that you are allowed to have
new-lines in non-data elements (in any XML version). Use &xA;

Regards

Ed Willink


Re: Empty comments in imported XMI-based UML [message #1690680 is a reply to message #1690674] Mon, 30 March 2015 15:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5843
Registered: July 2009
Senior Member
Hi

To be brutally honest.

"The interesting problem here is"

There is nothing interesting here without a complete file.

Regards

Ed Willink


On 30/03/2015 15:19, André Pankraz wrote:
> Hi,
>
> Might be a problem with your client? I used #xA and can see it in my
> post.
>
> To avoid confusion, I reduced the example to:
>
> Doesn't work:
> <ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985"
> annotatedElement="eee_1045467100313_135436_1" body="TEST"/>
>
> Works:
> <ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985"
> annotatedElement="eee_1045467100313_135436_1" >
> <body>TEST</body>
> </ownedComment>
>
>
> The interesting problem here is, that MD18 with Eclipse UML2 SDK v4.x
> exports the ownedComment-text as body-attribute, and Eclipse UML2 v5.x
> SDK cannot read this (it wants it as a sub element <body>).
>
> Best regards,
> André
>
> Ed Willink wrote on Mon, 30 March 2015 13:56
>> Hi
>>
>> That looks correct to me. I don't think that you are allowed to have
>> new-lines in non-data elements (in any XML version). Use &xA;
>>
>> Regards
>>
>> Ed Willink
>
>
Re: Empty comments in imported XMI-based UML [message #1690690 is a reply to message #1690680] Mon, 30 March 2015 15:55 Go to previous messageGo to next message
André  Pankraz is currently offline André PankrazFriend
Messages: 5
Registered: March 2015
Junior Member
You are right, this was uncalled for. Someone tries to copy Linus-attitude here.

I just have a MagicDraw Export, which has the feature: Export Eclipse UML2 v4. Internally they use org.eclipse.uml2.uml_4.0.1 for writing the attached XMI export from a minimal Model with a comment.


It could be possible to just do this in Eclipse with same UML2 SDK, just create Model with Model element, attach comment, save.
Comment text should be "body"-attribute in XMI.
Same with SDK v4: "body"-subelement.
But I have no old Eclipse with SDK v4.0.1 und I'm not an UML-XMI expert.


Ed Willink wrote on Mon, 30 March 2015 15:08
Hi

To be brutally honest.

"The interesting problem here is"

There is nothing interesting here without a complete file.

Regards

Ed Willink


On 30/03/2015 15:19, André Pankraz wrote:
> Hi,
>
> Might be a problem with your client? I used #xA and can see it in my
> post.
>
> To avoid confusion, I reduced the example to:
>
> Doesn't work:
> <ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985"
> annotatedElement="eee_1045467100313_135436_1" body="TEST"/>
>
> Works:
> <ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985"
> annotatedElement="eee_1045467100313_135436_1" >
> <body>TEST</body>
> </ownedComment>
>
>
> The interesting problem here is, that MD18 with Eclipse UML2 SDK v4.x
> exports the ownedComment-text as body-attribute, and Eclipse UML2 v5.x
> SDK cannot read this (it wants it as a sub element <body>).
>
> Best regards,
> André
>
> Ed Willink wrote on Mon, 30 March 2015 13:56
>> Hi
>>
>> That looks correct to me. I don't think that you are allowed to have
>> new-lines in non-data elements (in any XML version). Use &xA;
>>
>> Regards
>>
>> Ed Willink
>
>

  • Attachment: v4.zip
    (Size: 631.54KB, Downloaded 102 times)
Re: Empty comments in imported XMI-based UML [message #1690814 is a reply to message #1690690] Tue, 31 March 2015 13:01 Go to previous messageGo to next message
André  Pankraz is currently offline André PankrazFriend
Messages: 5
Registered: March 2015
Junior Member
Have now an Eclipse Luna with UML2 SDK 4 as last test.

UML2 SDK 4 also exports the body as sub-element, if I build a simple model by hand like described above. I don't know why it uses attributes in the MD-Export with the same UML2 lib version.

BUT: In opposition to UML2 SDK 5 it can also read ownedComments body-attributes.

Attached is the minimalistic example My.uml:
* UML2 SDK 4 can read it and shows the comment "test" in the model viewer - properties view.
* UML2 SDK 5 doesn't see the body-attribute (the XMI-Importer) and shows an empty comment in model viewer.

Can fix it for our use case, just like to give feedback to strange behaviour and don't yet know, if it's a bug or not. Take it or leave it.
  • Attachment: My.uml
    (Size: 0.28KB, Downloaded 88 times)
Re: Empty comments in imported XMI-based UML [message #1690817 is a reply to message #1690690] Tue, 31 March 2015 13:24 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5843
Registered: July 2009
Senior Member
Hi

You are right. I couldn't really believe that comments could go so
wrong. But with a concrete example it's difficult to argue.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=463551 raised.

Workaround: just change all your "http://www.eclipse.org/uml2/4.0.0/UML"
nsURIs to "http://www.eclipse.org/uml2/5.0.0/UML".

Regards

Ed Willink

On 30/03/2015 16:55, André Pankraz wrote:
> You are right, this was uncalled for. Someone tries to copy Linus-attitude here.
>
> I just have a MagicDraw Export, which has the feature: Export Eclipse UML2 v4. Internally they use org.eclipse.uml2.uml_4.0.1 for writing the attached XMI export from a minimal Model with a comment.
>
>
> It could be possible to just do this in Eclipse with same UML2 SDK, just create Model with Model element, attach comment, save.
> Comment text should be "body"-attribute in XMI.
> Same with SDK v4: "body"-subelement.
> But I have no old Eclipse with SDK v4.0.1 und I'm not an UML-XMI expert.
>
>
> Ed Willink wrote on Mon, 30 March 2015 15:08
>> Hi
>>
>> To be brutally honest.
>>
>> "The interesting problem here is"
>>
>> There is nothing interesting here without a complete file.
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 30/03/2015 15:19, André Pankraz wrote:
>>> Hi,
>>>
>>> Might be a problem with your client? I used #xA and can see it in my
>>> post.
>>>
>>> To avoid confusion, I reduced the example to:
>>>
>>> Doesn't work:
>>> <ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985"
>>> annotatedElement="eee_1045467100313_135436_1" body="TEST"/>
>>>
>>> Works:
>>> <ownedComment xmi:id="_18_0_2_617020b_1427462788135_117706_3985"
>>> annotatedElement="eee_1045467100313_135436_1" >
>>> <body>TEST</body>
>>> </ownedComment>
>>>
>>>
>>> The interesting problem here is, that MD18 with Eclipse UML2 SDK v4.x
>>> exports the ownedComment-text as body-attribute, and Eclipse UML2 v5.x
>>> SDK cannot read this (it wants it as a sub element <body>).
>>>
>>> Best regards,
>>> André
>>>
>>> Ed Willink wrote on Mon, 30 March 2015 13:56
>>>> Hi
>>>>
>>>> That looks correct to me. I don't think that you are allowed to have
>>>> new-lines in non-data elements (in any XML version). Use &xA;
>>>>
>>>> Regards
>>>>
>>>> Ed Willink
>>>
>
Re: Empty comments in imported XMI-based UML [message #1690857 is a reply to message #1690817] Tue, 31 March 2015 15:50 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
A fix for the bug will be available in the next build of UML2 5.1.0.
Re: Empty comments in imported XMI-based UML [message #1691011 is a reply to message #1690857] Wed, 01 April 2015 14:49 Go to previous message
André  Pankraz is currently offline André PankrazFriend
Messages: 5
Registered: March 2015
Junior Member
Many thx to all of you and for the very quick fix.
Great libs and a fantastic foundation for many tools.
Best regards,
André
Previous Topic:how to create a UML2 V2.1 model
Next Topic:Popup menu enabling for a specific named UML package?
Goto Forum:
  


Current Time: Thu Apr 26 17:43:15 GMT 2018

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

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