Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Feature annotation not found
Feature annotation not found [message #478399] Sat, 16 May 2009 06:23 Go to next message
John T.E. Timm is currently offline John T.E. Timm
Messages: 160
Registered: July 2009
Senior Member
I'm tring to convert a UML model to EMF using the UML2 model import under
RSM 7.5. I have specified some annotations in the "annotations" property
of the Ecore <<eClass>> stereotype and this is the exception that is
generated:

org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'annotation'
not found. (platform:/resource/MyProject/model/model.emx, 64, 17)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.reportUnknownFeatu re(Unknown
Source)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleUnknownFeatu re(Unknown
Source)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.handleUnknownFeatu re(Unknown
Source)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(Unkn own Source)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(Unk nown
Source)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(Unk nown
Source)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(Unkno wn Source)
at
com.ibm.xtools.emf.core.internal.resource.RMPLoad$RMPXMIHand ler.startElement(Unknown
Source)
at org.eclipse.emf.ecore.xmi.impl.SAXWrapper.startElement(Unkno wn Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unk nown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanSt artElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unk nown
Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(Unknown Source)
at org.eclipse.gmf.runtime.emf.core.resources.GMFLoad.load(Unkn own Source)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(Unknow n Source)
at com.ibm.xtools.emf.core.internal.resource.RMPResource.doLoad (Unknown
Source)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Unknow n Source)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Unknow n Source)
at com.ibm.xtools.emf.core.internal.resource.RMPResource.load(U nknown
Source)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(Unknown
Source)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Unknown
Source)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(Unknown
Source)
at
org.eclipse.uml2.uml.ecore.importer.UMLImporter.doComputeEPa ckages(Unknown
Source)
at org.eclipse.emf.importer.ModelImporter.computeEPackages(Unkn own Source)
at
org.eclipse.emf.importer.ui.contribution.base.ModelImporterD etailPage.refreshModel(Unknown
Source)
at
org.eclipse.emf.importer.ui.contribution.base.ModelImporterD etailPage$3.execute(Unknown
Source)
at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Unknow n Source)
at org.eclipse.core.internal.resources.Workspace.run(Unknown Source)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(Unknown Source)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread( Unknown
Source)
at org.eclipse.jface.operation.ModalContext.run(Unknown Source)
at org.eclipse.jface.wizard.WizardDialog.run(Unknown Source)
at
org.eclipse.emf.importer.ui.contribution.base.ModelImporterD etailPage.refreshModel(Unknown
Source)
at
org.eclipse.emf.importer.ui.contribution.base.ModelImporterD etailPage.browseWorkspace(Unknown
Source)
at
org.eclipse.emf.converter.ui.contribution.base.ModelConverte rURIPage.doHandleEvent(Unknown
Source)
at
org.eclipse.emf.importer.ui.contribution.base.ModelImporterD etailPage.doHandleEvent(Unknown
Source)
at
org.eclipse.emf.converter.ui.contribution.base.ModelConverte rPage.handleEvent(Unknown
Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.jface.window.Window.runEventLoop(Unknown Source)
at org.eclipse.jface.window.Window.open(Unknown Source)
at
org.eclipse.ui.internal.handlers.WizardHandler$New.executeHa ndler(Unknown
Source)
at org.eclipse.ui.internal.handlers.WizardHandler.execute(Unkno wn Source)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Unknow n Source)
at org.eclipse.core.commands.Command.executeWithChecks(Unknown Source)
at
org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(Unknown
Source)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(Unknown
Source)
at
org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(Unknown
Source)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(U nknown
Source)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(Unknown
Source)
at org.eclipse.jface.action.ActionContributionItem.access$2(Unk nown
Source)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(Unknown
Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
at org.eclipse.ui.internal.Workbench.access$4(Unknown Source)
at org.eclipse.ui.internal.Workbench$5.run(Unknown Source)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Unknown
Source)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unkn own Source)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (Unknown
Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknow n Source)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(Unknown
Source)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Unknown
Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
at org.eclipse.equinox.launcher.Main.run(Unknown Source)
at org.eclipse.equinox.launcher.Main.main(Unknown Source)

It is possible that the problem is in some RSM-specific code (something in
com.ibm.xtools.emf.core.internal.resource) but I thought I would post it
here in case someone else has run into this issue and has a workaround.

Thanks,

JT
Re: Feature annotation not found [message #478400 is a reply to message #478399] Sat, 16 May 2009 07:26 Go to previous messageGo to next message
John T.E. Timm is currently offline John T.E. Timm
Messages: 160
Registered: July 2009
Senior Member
I found the problem. The issue is in the RSM-specific code that saves the
UML model to an EMX file. It is incorrectly naming the "annotations"
element "annotation" which is not recognized on import (from UML to
Ecore). If I fix-up the EMX file and rename "annotation" elements to
"annotations", then everything works fine. I will follow up with Rational
team to get a more permanent fix in place.

Thanks,

JT
Re: Feature annotation not found [message #478415 is a reply to message #478400] Tue, 19 May 2009 14:47 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi John,

If I'm not mistaken, RSA has it's own way of dealing with annotations and
documentation (separate API).
Dave Steinberg (of EMF team) is looking at import/export issues currently.
He may be able to shed some light on the issue.

- James.

"John T.E. Timm" <johntimm@us.ibm.com> wrote in message
news:6de9ceb46107d5aa0451fbd894c978eb$1@www.eclipse.org...
>I found the problem. The issue is in the RSM-specific code that saves the
>UML model to an EMX file. It is incorrectly naming the "annotations"
>element "annotation" which is not recognized on import (from UML to Ecore).
>If I fix-up the EMX file and rename "annotation" elements to "annotations",
>then everything works fine. I will follow up with Rational team to get a
>more permanent fix in place.
>
> Thanks,
>
> JT
>
Re: Feature annotation not found [message #478422 is a reply to message #478415] Tue, 19 May 2009 18:53 Go to previous messageGo to next message
John T.E. Timm is currently offline John T.E. Timm
Messages: 160
Registered: July 2009
Senior Member
James:

I investigated this issue a bit more and it looks like the Eclipse MDT
UML2 .uml file format uses the same "<annotation></annotation>" elements
as the RSM .emx file. This would seem to indicate that the problem doesn't
occur in the .emx file format but instead somewhere in the custom Resource
implementation or XML Handler that is used to extend the UML-to-Ecore
model importer to handle RSM .emx files. For some reason, this
RSM-specific extension is expecting elements named "annotations" in the
emx file.

If the .emx file looks like this:

<Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
base_Class="_4t0AQESPEd66ToKxWS_1fg">
<annotation>http://www.example.org/MySpecialAnnotation
p1='v1'</annotation>
</Ecore:EClass>

it doesn't work. If I manually change the .emx file to this:

<Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
base_Class="_4t0AQESPEd66ToKxWS_1fg">
<annotations>http://www.example.org/MySpecialAnnotation
p1='v1'</annotations>
</Ecore:EClass>

everything works fine. I would export the .emx file to .uml first, but the
model exporter for .emx file completely ignores the annotations and
doesn't appear to give me an option to turn them on. Interestingly enough,
the RSM model exporter seems to ignore Ecore stereotypes in general.

Thanks,

JT

James Bruck wrote:

> Hi John,

> If I'm not mistaken, RSA has it's own way of dealing with annotations and
> documentation (separate API).
> Dave Steinberg (of EMF team) is looking at import/export issues currently.
> He may be able to shed some light on the issue.

> - James.

> "John T.E. Timm" <johntimm@us.ibm.com> wrote in message
> news:6de9ceb46107d5aa0451fbd894c978eb$1@www.eclipse.org...
>>I found the problem. The issue is in the RSM-specific code that saves the
>>UML model to an EMX file. It is incorrectly naming the "annotations"
>>element "annotation" which is not recognized on import (from UML to Ecore).
>>If I fix-up the EMX file and rename "annotation" elements to "annotations",
>>then everything works fine. I will follow up with Rational team to get a
>>more permanent fix in place.
>>
>> Thanks,
>>
>> JT
>>
Re: Feature annotation not found [message #478425 is a reply to message #478422] Tue, 19 May 2009 22:07 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi John,

The problem does not seem to exist in opensource UML2 and neither in RSM
7.6.
I'll try to reproduce using 7.5.

Cheers,
- James.

"John T.E. Timm" <johntimm@us.ibm.com> wrote in message
news:4525054396e06b52ff80b5ada5a69fdf$1@www.eclipse.org...
> James:
>
> I investigated this issue a bit more and it looks like the Eclipse MDT
> UML2 .uml file format uses the same "<annotation></annotation>" elements
> as the RSM .emx file. This would seem to indicate that the problem doesn't
> occur in the .emx file format but instead somewhere in the custom Resource
> implementation or XML Handler that is used to extend the UML-to-Ecore
> model importer to handle RSM .emx files. For some reason, this
> RSM-specific extension is expecting elements named "annotations" in the
> emx file.
>
> If the .emx file looks like this:
>
> <Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
> base_Class="_4t0AQESPEd66ToKxWS_1fg">
> <annotation>http://www.example.org/MySpecialAnnotation
> p1='v1'</annotation>
> </Ecore:EClass>
>
> it doesn't work. If I manually change the .emx file to this:
>
> <Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
> base_Class="_4t0AQESPEd66ToKxWS_1fg">
> <annotations>http://www.example.org/MySpecialAnnotation
> p1='v1'</annotations>
> </Ecore:EClass>
>
> everything works fine. I would export the .emx file to .uml first, but the
> model exporter for .emx file completely ignores the annotations and
> doesn't appear to give me an option to turn them on. Interestingly enough,
> the RSM model exporter seems to ignore Ecore stereotypes in general.
>
> Thanks,
>
> JT
>
> James Bruck wrote:
>
>> Hi John,
>
>> If I'm not mistaken, RSA has it's own way of dealing with annotations and
>> documentation (separate API).
>> Dave Steinberg (of EMF team) is looking at import/export issues
>> currently. He may be able to shed some light on the issue.
>
>> - James.
>
>> "John T.E. Timm" <johntimm@us.ibm.com> wrote in message
>> news:6de9ceb46107d5aa0451fbd894c978eb$1@www.eclipse.org...
>>>I found the problem. The issue is in the RSM-specific code that saves the
>>>UML model to an EMX file. It is incorrectly naming the "annotations"
>>>element "annotation" which is not recognized on import (from UML to
>>>Ecore). If I fix-up the EMX file and rename "annotation" elements to
>>>"annotations", then everything works fine. I will follow up with Rational
>>>team to get a more permanent fix in place.
>>>
>>> Thanks,
>>>
>>> JT
>>>
>
>
Re: Feature annotation not found [message #478438 is a reply to message #478422] Wed, 20 May 2009 14:15 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
Yes, the intended serialization for these elements is with the name
'annotation', as per the XML name setting (via the EAttribute stereotype) on
the "annotations" stereotype property. Since the intended XML name is
different from the feature name, deserialization will only work if/when
extended metadata is specified as a load option (see
XMLResource.OPTION_EXTENDED_META_DATA). You should check whether this is the
case for the resource that's being used to load your model...

Kenn

"John T.E. Timm" <johntimm@us.ibm.com> wrote in message
news:4525054396e06b52ff80b5ada5a69fdf$1@www.eclipse.org...
> James:
>
> I investigated this issue a bit more and it looks like the Eclipse MDT
> UML2 .uml file format uses the same "<annotation></annotation>" elements
> as the RSM .emx file. This would seem to indicate that the problem doesn't
> occur in the .emx file format but instead somewhere in the custom Resource
> implementation or XML Handler that is used to extend the UML-to-Ecore
> model importer to handle RSM .emx files. For some reason, this
> RSM-specific extension is expecting elements named "annotations" in the
> emx file.
>
> If the .emx file looks like this:
>
> <Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
> base_Class="_4t0AQESPEd66ToKxWS_1fg">
> <annotation>http://www.example.org/MySpecialAnnotation
> p1='v1'</annotation>
> </Ecore:EClass>
>
> it doesn't work. If I manually change the .emx file to this:
>
> <Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
> base_Class="_4t0AQESPEd66ToKxWS_1fg">
> <annotations>http://www.example.org/MySpecialAnnotation
> p1='v1'</annotations>
> </Ecore:EClass>
>
> everything works fine. I would export the .emx file to .uml first, but the
> model exporter for .emx file completely ignores the annotations and
> doesn't appear to give me an option to turn them on. Interestingly enough,
> the RSM model exporter seems to ignore Ecore stereotypes in general.
>
> Thanks,
>
> JT
>
> James Bruck wrote:
>
>> Hi John,
>
>> If I'm not mistaken, RSA has it's own way of dealing with annotations and
>> documentation (separate API).
>> Dave Steinberg (of EMF team) is looking at import/export issues
>> currently. He may be able to shed some light on the issue.
>
>> - James.
>
>> "John T.E. Timm" <johntimm@us.ibm.com> wrote in message
>> news:6de9ceb46107d5aa0451fbd894c978eb$1@www.eclipse.org...
>>>I found the problem. The issue is in the RSM-specific code that saves the
>>>UML model to an EMX file. It is incorrectly naming the "annotations"
>>>element "annotation" which is not recognized on import (from UML to
>>>Ecore). If I fix-up the EMX file and rename "annotation" elements to
>>>"annotations", then everything works fine. I will follow up with Rational
>>>team to get a more permanent fix in place.
>>>
>>> Thanks,
>>>
>>> JT
>>>
>
>
Re: Feature annotation not found [message #478441 is a reply to message #478438] Wed, 20 May 2009 17:16 Go to previous messageGo to next message
John T.E. Timm is currently offline John T.E. Timm
Messages: 160
Registered: July 2009
Senior Member
The resource that is used to load my model in this particular case is
internal to the RSM tooling. Specifically:

com.ibm.xtools.emf.core.internal.resource.RMPResource

It is on this resource, that I think we need to specify the
EXTENDED_META_DATA option.

Thanks,

JT
Re: Feature annotation not found [message #478442 is a reply to message #478441] Thu, 21 May 2009 16:52 Go to previous message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
It should be possible to specify this load option via the client API,
assuming you're doing it programmatically...

Kenn

"John T.E. Timm" <johntimm@us.ibm.com> wrote in message
news:3a8fb854693084c22399181144d1f289$1@www.eclipse.org...
> The resource that is used to load my model in this particular case is
> internal to the RSM tooling. Specifically:
>
> com.ibm.xtools.emf.core.internal.resource.RMPResource
>
> It is on this resource, that I think we need to specify the
> EXTENDED_META_DATA option.
>
> Thanks,
>
> JT
>
Re: Feature annotation not found [message #627587 is a reply to message #478399] Sat, 16 May 2009 07:26 Go to previous message
John T.E. Timm is currently offline John T.E. Timm
Messages: 160
Registered: July 2009
Senior Member
I found the problem. The issue is in the RSM-specific code that saves the
UML model to an EMX file. It is incorrectly naming the "annotations"
element "annotation" which is not recognized on import (from UML to
Ecore). If I fix-up the EMX file and rename "annotation" elements to
"annotations", then everything works fine. I will follow up with Rational
team to get a more permanent fix in place.

Thanks,

JT
Re: Feature annotation not found [message #627600 is a reply to message #478400] Tue, 19 May 2009 14:47 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi John,

If I'm not mistaken, RSA has it's own way of dealing with annotations and
documentation (separate API).
Dave Steinberg (of EMF team) is looking at import/export issues currently.
He may be able to shed some light on the issue.

- James.

"John T.E. Timm" <johntimm@us.ibm.com> wrote in message
news:6de9ceb46107d5aa0451fbd894c978eb$1@www.eclipse.org...
>I found the problem. The issue is in the RSM-specific code that saves the
>UML model to an EMX file. It is incorrectly naming the "annotations"
>element "annotation" which is not recognized on import (from UML to Ecore).
>If I fix-up the EMX file and rename "annotation" elements to "annotations",
>then everything works fine. I will follow up with Rational team to get a
>more permanent fix in place.
>
> Thanks,
>
> JT
>
Re: Feature annotation not found [message #627607 is a reply to message #478415] Tue, 19 May 2009 18:53 Go to previous message
John T.E. Timm is currently offline John T.E. Timm
Messages: 160
Registered: July 2009
Senior Member
James:

I investigated this issue a bit more and it looks like the Eclipse MDT
UML2 .uml file format uses the same "<annotation></annotation>" elements
as the RSM .emx file. This would seem to indicate that the problem doesn't
occur in the .emx file format but instead somewhere in the custom Resource
implementation or XML Handler that is used to extend the UML-to-Ecore
model importer to handle RSM .emx files. For some reason, this
RSM-specific extension is expecting elements named "annotations" in the
emx file.

If the .emx file looks like this:

<Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
base_Class="_4t0AQESPEd66ToKxWS_1fg">
<annotation>http://www.example.org/MySpecialAnnotation
p1='v1'</annotation>
</Ecore:EClass>

it doesn't work. If I manually change the .emx file to this:

<Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
base_Class="_4t0AQESPEd66ToKxWS_1fg">
<annotations>http://www.example.org/MySpecialAnnotation
p1='v1'</annotations>
</Ecore:EClass>

everything works fine. I would export the .emx file to .uml first, but the
model exporter for .emx file completely ignores the annotations and
doesn't appear to give me an option to turn them on. Interestingly enough,
the RSM model exporter seems to ignore Ecore stereotypes in general.

Thanks,

JT

James Bruck wrote:

> Hi John,

> If I'm not mistaken, RSA has it's own way of dealing with annotations and
> documentation (separate API).
> Dave Steinberg (of EMF team) is looking at import/export issues currently.
> He may be able to shed some light on the issue.

> - James.

> "John T.E. Timm" <johntimm@us.ibm.com> wrote in message
> news:6de9ceb46107d5aa0451fbd894c978eb$1@www.eclipse.org...
>>I found the problem. The issue is in the RSM-specific code that saves the
>>UML model to an EMX file. It is incorrectly naming the "annotations"
>>element "annotation" which is not recognized on import (from UML to Ecore).
>>If I fix-up the EMX file and rename "annotation" elements to "annotations",
>>then everything works fine. I will follow up with Rational team to get a
>>more permanent fix in place.
>>
>> Thanks,
>>
>> JT
>>
Re: Feature annotation not found [message #627611 is a reply to message #478422] Tue, 19 May 2009 22:07 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi John,

The problem does not seem to exist in opensource UML2 and neither in RSM
7.6.
I'll try to reproduce using 7.5.

Cheers,
- James.

"John T.E. Timm" <johntimm@us.ibm.com> wrote in message
news:4525054396e06b52ff80b5ada5a69fdf$1@www.eclipse.org...
> James:
>
> I investigated this issue a bit more and it looks like the Eclipse MDT
> UML2 .uml file format uses the same "<annotation></annotation>" elements
> as the RSM .emx file. This would seem to indicate that the problem doesn't
> occur in the .emx file format but instead somewhere in the custom Resource
> implementation or XML Handler that is used to extend the UML-to-Ecore
> model importer to handle RSM .emx files. For some reason, this
> RSM-specific extension is expecting elements named "annotations" in the
> emx file.
>
> If the .emx file looks like this:
>
> <Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
> base_Class="_4t0AQESPEd66ToKxWS_1fg">
> <annotation>http://www.example.org/MySpecialAnnotation
> p1='v1'</annotation>
> </Ecore:EClass>
>
> it doesn't work. If I manually change the .emx file to this:
>
> <Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
> base_Class="_4t0AQESPEd66ToKxWS_1fg">
> <annotations>http://www.example.org/MySpecialAnnotation
> p1='v1'</annotations>
> </Ecore:EClass>
>
> everything works fine. I would export the .emx file to .uml first, but the
> model exporter for .emx file completely ignores the annotations and
> doesn't appear to give me an option to turn them on. Interestingly enough,
> the RSM model exporter seems to ignore Ecore stereotypes in general.
>
> Thanks,
>
> JT
>
> James Bruck wrote:
>
>> Hi John,
>
>> If I'm not mistaken, RSA has it's own way of dealing with annotations and
>> documentation (separate API).
>> Dave Steinberg (of EMF team) is looking at import/export issues
>> currently. He may be able to shed some light on the issue.
>
>> - James.
>
>> "John T.E. Timm" <johntimm@us.ibm.com> wrote in message
>> news:6de9ceb46107d5aa0451fbd894c978eb$1@www.eclipse.org...
>>>I found the problem. The issue is in the RSM-specific code that saves the
>>>UML model to an EMX file. It is incorrectly naming the "annotations"
>>>element "annotation" which is not recognized on import (from UML to
>>>Ecore). If I fix-up the EMX file and rename "annotation" elements to
>>>"annotations", then everything works fine. I will follow up with Rational
>>>team to get a more permanent fix in place.
>>>
>>> Thanks,
>>>
>>> JT
>>>
>
>
Re: Feature annotation not found [message #627616 is a reply to message #478422] Wed, 20 May 2009 14:15 Go to previous message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
Yes, the intended serialization for these elements is with the name
'annotation', as per the XML name setting (via the EAttribute stereotype) on
the "annotations" stereotype property. Since the intended XML name is
different from the feature name, deserialization will only work if/when
extended metadata is specified as a load option (see
XMLResource.OPTION_EXTENDED_META_DATA). You should check whether this is the
case for the resource that's being used to load your model...

Kenn

"John T.E. Timm" <johntimm@us.ibm.com> wrote in message
news:4525054396e06b52ff80b5ada5a69fdf$1@www.eclipse.org...
> James:
>
> I investigated this issue a bit more and it looks like the Eclipse MDT
> UML2 .uml file format uses the same "<annotation></annotation>" elements
> as the RSM .emx file. This would seem to indicate that the problem doesn't
> occur in the .emx file format but instead somewhere in the custom Resource
> implementation or XML Handler that is used to extend the UML-to-Ecore
> model importer to handle RSM .emx files. For some reason, this
> RSM-specific extension is expecting elements named "annotations" in the
> emx file.
>
> If the .emx file looks like this:
>
> <Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
> base_Class="_4t0AQESPEd66ToKxWS_1fg">
> <annotation>http://www.example.org/MySpecialAnnotation
> p1='v1'</annotation>
> </Ecore:EClass>
>
> it doesn't work. If I manually change the .emx file to this:
>
> <Ecore:EClass xmi:id="_7Mg3UESPEd66ToKxWS_1fg"
> base_Class="_4t0AQESPEd66ToKxWS_1fg">
> <annotations>http://www.example.org/MySpecialAnnotation
> p1='v1'</annotations>
> </Ecore:EClass>
>
> everything works fine. I would export the .emx file to .uml first, but the
> model exporter for .emx file completely ignores the annotations and
> doesn't appear to give me an option to turn them on. Interestingly enough,
> the RSM model exporter seems to ignore Ecore stereotypes in general.
>
> Thanks,
>
> JT
>
> James Bruck wrote:
>
>> Hi John,
>
>> If I'm not mistaken, RSA has it's own way of dealing with annotations and
>> documentation (separate API).
>> Dave Steinberg (of EMF team) is looking at import/export issues
>> currently. He may be able to shed some light on the issue.
>
>> - James.
>
>> "John T.E. Timm" <johntimm@us.ibm.com> wrote in message
>> news:6de9ceb46107d5aa0451fbd894c978eb$1@www.eclipse.org...
>>>I found the problem. The issue is in the RSM-specific code that saves the
>>>UML model to an EMX file. It is incorrectly naming the "annotations"
>>>element "annotation" which is not recognized on import (from UML to
>>>Ecore). If I fix-up the EMX file and rename "annotation" elements to
>>>"annotations", then everything works fine. I will follow up with Rational
>>>team to get a more permanent fix in place.
>>>
>>> Thanks,
>>>
>>> JT
>>>
>
>
Re: Feature annotation not found [message #627619 is a reply to message #478438] Wed, 20 May 2009 17:16 Go to previous message
John T.E. Timm is currently offline John T.E. Timm
Messages: 160
Registered: July 2009
Senior Member
The resource that is used to load my model in this particular case is
internal to the RSM tooling. Specifically:

com.ibm.xtools.emf.core.internal.resource.RMPResource

It is on this resource, that I think we need to specify the
EXTENDED_META_DATA option.

Thanks,

JT
Re: Feature annotation not found [message #627620 is a reply to message #478441] Thu, 21 May 2009 16:52 Go to previous message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
It should be possible to specify this load option via the client API,
assuming you're doing it programmatically...

Kenn

"John T.E. Timm" <johntimm@us.ibm.com> wrote in message
news:3a8fb854693084c22399181144d1f289$1@www.eclipse.org...
> The resource that is used to load my model in this particular case is
> internal to the RSM tooling. Specifically:
>
> com.ibm.xtools.emf.core.internal.resource.RMPResource
>
> It is on this resource, that I think we need to specify the
> EXTENDED_META_DATA option.
>
> Thanks,
>
> JT
>
Previous Topic:Generating Java-classes?
Next Topic:Preserving uuid to xmi:id mapping converting uml2 to eCore
Goto Forum:
  


Current Time: Fri Oct 24 18:03:01 GMT 2014

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

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