Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Mixed XMLResources and XMIResources in ModelSet?
Mixed XMLResources and XMIResources in ModelSet? [message #1016242] Tue, 05 March 2013 15:38 Go to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 127
Registered: September 2011
Senior Member
Hi,

I've registered a bunch of resources to the modelset of Papyrus (0.9.2) via the extension point org.eclipse.papyrus.infra.core.model. Two of my custom model files are XMLResources. Normally, everything works fine, but sometimes something happens and one of the files. Afterwards it looks like this:

<?xml version="1.0" encoding="ASCII"?>
<modelglue:Modelglue xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:modelglue="http://www.upb.de/rsdl/modelglue/0.1.0">
  <classes>
    <key href="requester.uml#_rHGZQC5VEeKp1K4vSYwS0A"/>
    <value href="requester.ecore#//AnonymousHotelService"/>
  </classes>
  <classes>
    <key href="requester.uml#_0OmJQC5VEeKp1K4vSYwS0A"/>
    <value href="requester.ecore#//Requester"/>
  </classes>
  <operations>
    <key href="requester.uml#_F_AsUC5VEeKp1K4vSYwS0A"/>
    <value href="requester.henshin#_F_KdUC5VEeKp1K4vSYwS0A"/>
  </operations>
  <operations>
    <key href="requester.uml#_I9TCYC5VEeKp1K4vSYwS0A"/>
    <value href="requester.henshin#_I9TCYS5VEeKp1K4vSYwS0A"/>
  </operations>
  <operations>
    <key href="requester.uml#_KPtsgC5VEeKp1K4vSYwS0A"/>
    <value href="requester.henshin#_KPtsgS5VEeKp1K4vSYwS0A"/>
  </operations>
  <operations>
    <key href="requester.uml#_MPqyEC5VEeKp1K4vSYwS0A"/>
    <value href="requester.henshin#_MPqyES5VEeKp1K4vSYwS0A"/>
  </operations>
</modelglue:Modelglue>


If I open the di file I get the error message "org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'version' not found. "

The file must look like this to be able to load it properly:

<?xml version="1.0" encoding="ASCII"?>
<modelglue:Modelglue xmlns:modelglue="http://www.upb.de/rsdl/modelglue/0.1.0">
  <classes key="requester.uml#_rHGZQC5VEeKp1K4vSYwS0A" value="requester.ecore#//AnonymousHotelService"/>
  <classes key="requester.uml#_0OmJQC5VEeKp1K4vSYwS0A" value="requester.ecore#//Requester"/>
  <operations key="requester.uml#_F_AsUC5VEeKp1K4vSYwS0A" value="requester.henshin#_F_KdUC5VEeKp1K4vSYwS0A"/>
  <operations key="requester.uml#_I9TCYC5VEeKp1K4vSYwS0A" value="requester.henshin#_I9TCYS5VEeKp1K4vSYwS0A"/>
  <operations key="requester.uml#_KPtsgC5VEeKp1K4vSYwS0A" value="requester.henshin#_KPtsgS5VEeKp1K4vSYwS0A"/>
  <operations key="requester.uml#_MPqyEC5VEeKp1K4vSYwS0A" value="requester.henshin#_MPqyES5VEeKp1K4vSYwS0A"/>
</modelglue:Modelglue>


For the moment I cannot reproduce this problem, because it happens silently in the background. I am not sure if the problem is due to the load and save service of Papyrus. Is it required that every resource in the modelset is a XMIResource?

Re: Mixed XMLResources and XMIResources in ModelSet? [message #1016299 is a reply to message #1016242] Tue, 05 March 2013 22:32 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi,

In my work on integration of CDO model repositories in Papyrus on the
cdo_kepler branch, I have fixed a few cases where various Papyrus
plug-ins assume that a resource is an XMI resource (and more places
where it is assumed to be in the Eclipse workspace!). and even one or
two cases where an XMI resource is forceably created instead of letting
the ModelSet create it. The first stable milestone of that work is
currently being merged into trunk for M6, so that may help you.

Otherwise, please do report in Bugzilla any occurrence that you find of
problems of these following kinds:

- assumption that a resource traces to an IFile/IResource (except where
it is required by the context, such as SVN team provider integration)

- assumption that a resource is an XMI resource, often in the form of
a cast. Even if the cast is guarded, sometimes there are other ways
to implement the code (for example, casting to XMIResource to get
an EObject's ID isn't necessary because you can ask any Resource
for an EObject's URI fragment)

- assumption that an EObject is not a Resource. This is a very pervasive
assumption (and quite understandable in a normal EMF context), but
in CDO, Resources are EObjects and generally shouldn't be treated
as EObjects by code that does EMF-style reflection

All of these may be hindrances to full CDO model repository support, so
it will help to report them.

HTH,

Christian


On 2013-03-05 15:38:52 +0000, Goood Guy said:

> Hi,
>
> I've registered a bunch of resources to the modelset of Papyrus (0.9.2)
> via the extension point org.eclipse.papyrus.infra.core.model. Two of my
> custom model files are XMLResources. Normally, everything works fine,
> but sometimes something happens and one of the files. Afterwards it
> looks like this:
>
>
> <?xml version="1.0" encoding="ASCII"?>
> <modelglue:Modelglue xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:modelglue="http://www.upb.de/rsdl/modelglue/0.1.0">
> <classes>
> <key href="requester.uml#_rHGZQC5VEeKp1K4vSYwS0A"/>
> <value href="requester.ecore#//AnonymousHotelService"/>
> </classes>
> <classes>
> <key href="requester.uml#_0OmJQC5VEeKp1K4vSYwS0A"/>
> <value href="requester.ecore#//Requester"/>
> </classes>
> <operations>
> <key href="requester.uml#_F_AsUC5VEeKp1K4vSYwS0A"/>
> <value href="requester.henshin#_F_KdUC5VEeKp1K4vSYwS0A"/>
> </operations>
> <operations>
> <key href="requester.uml#_I9TCYC5VEeKp1K4vSYwS0A"/>
> <value href="requester.henshin#_I9TCYS5VEeKp1K4vSYwS0A"/>
> </operations>
> <operations>
> <key href="requester.uml#_KPtsgC5VEeKp1K4vSYwS0A"/>
> <value href="requester.henshin#_KPtsgS5VEeKp1K4vSYwS0A"/>
> </operations>
> <operations>
> <key href="requester.uml#_MPqyEC5VEeKp1K4vSYwS0A"/>
> <value href="requester.henshin#_MPqyES5VEeKp1K4vSYwS0A"/>
> </operations>
> </modelglue:Modelglue>
>
>
> If I open the di file I get the error message
> "org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'version'
> not found. "
>
> The file must look like this to be able to load it properly:
>
>
> <?xml version="1.0" encoding="ASCII"?>
> <modelglue:Modelglue xmlns:modelglue="http://www.upb.de/rsdl/modelglue/0.1.0">
> <classes key="requester.uml#_rHGZQC5VEeKp1K4vSYwS0A"
> value="requester.ecore#//AnonymousHotelService"/>
> <classes key="requester.uml#_0OmJQC5VEeKp1K4vSYwS0A"
> value="requester.ecore#//Requester"/>
> <operations key="requester.uml#_F_AsUC5VEeKp1K4vSYwS0A"
> value="requester.henshin#_F_KdUC5VEeKp1K4vSYwS0A"/>
> <operations key="requester.uml#_I9TCYC5VEeKp1K4vSYwS0A"
> value="requester.henshin#_I9TCYS5VEeKp1K4vSYwS0A"/>
> <operations key="requester.uml#_KPtsgC5VEeKp1K4vSYwS0A"
> value="requester.henshin#_KPtsgS5VEeKp1K4vSYwS0A"/>
> <operations key="requester.uml#_MPqyEC5VEeKp1K4vSYwS0A"
> value="requester.henshin#_MPqyES5VEeKp1K4vSYwS0A"/>
> </modelglue:Modelglue>
>
>
> For the moment I cannot reproduce this problem, because it happens
> silently in the background. I am not sure if the problem is due to the
> load and save service of Papyrus. Is it required that every resource in
> the modelset is a XMIResource?
Re: Mixed XMLResources and XMIResources in ModelSet? [message #1016370 is a reply to message #1016299] Wed, 06 March 2013 09:26 Go to previous messageGo to next message
Simon Schwichtenberg is currently offline Simon SchwichtenbergFriend
Messages: 127
Registered: September 2011
Senior Member
Christian W. Damus wrote on Tue, 05 March 2013 17:32

- assumption that a resource traces to an IFile/IResource (except where
it is required by the context, such as SVN team provider integration)

What do you mean by 'traces'?



Additionally, I've got another idea, where this problem could come from.
I've implemented an analysis that only loads the set of model files and performs some operations. Because this analysis should work from outside of Eclipse, I am using that code http://www.vogella.com/articles/EclipseEMFPersistence/article.html#javacode_load. Here I am using ResourceSetImpl and not ModelSet.
Althrough I only read the models and do not write to it there, is it possible that EMF changes the file? I am asking because in the past I've noticed that when I just open a model file that has crossreferences to other model files with its standard EMF editor, it might happen that the files change automatically and silently (in particular e.g. some URI paths change)
Re: Mixed XMLResources and XMIResources in ModelSet? [message #1016491 is a reply to message #1016370] Wed, 06 March 2013 16:38 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

On 2013-03-06 09:26:06 +0000, Goood Guy said:

> Christian W. Damus wrote on Tue, 05 March 2013 17:32
>> - assumption that a resource traces to an IFile/IResource (except where
>> it is required by the context, such as SVN team provider integration)
>
> What do you mean by 'traces'?

I mean that an EMF Resource is persisted in a workspace IFile. It can
be "traced to" an IFile (not the best use of this term; sorry)


> Additionally, I've got another idea, where this problem could come from.
> I've implemented an analysis that only loads the set of model files and
> performs some operations. Because this analysis should work from
> outside of Eclipse, I am using that code
> http://www.vogella.com/articles/EclipseEMFPersistence/article.html#javacode_load.
> Here I am using ResourceSetImpl and not ModelSet.
> Althrough I only read the models and do not write to it there, is it
> possible that EMF changes the file? I am asking because in the past
> I've noticed that when I just open a model file that has
> crossreferences to other model files with its standard EMF editor, it
> might happen that the files change automatically and silently (in
> particular e.g. some URI paths change)

I suppose it's possible the HREF URIs and other content of an XML
resource fixes itself automatically. Best to ask about that on the EMF
newsgroup. That wouldn't be a Papyrus concern.
Previous Topic:Problem using Imported Elements in operations
Next Topic:Problem of reverse engineering with Modisco & Papyrus
Goto Forum:
  


Current Time: Thu Apr 25 13:29:04 GMT 2024

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

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

Back to the top