Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Using UML2 mechanism
Using UML2 mechanism [message #477852] Tue, 21 October 2008 05:45 Go to next message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

Salute,

i've a similar question as Timothy. I followed his discussions, and it seems
that we want to do exactly the same at the same time... sometimes it is very
mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to
realize these mechanisms in the resulting Ecore, like it is done in the
wonderful UML2 project. I've introspected the uml2 sources but didn't found
an hint how to include the UML2 generator instead of the ordinary EMF one,
which doesn't care about union/subsets. Is there somewhere an article
outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian
Re: Using UML2 mechanism [message #477853 is a reply to message #477852] Tue, 21 October 2008 09:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel,
change the xmlns:genmodel's namespace to
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
"Reloading..." this model will continue to create the UML2 derived GenModel.


Marc-Florian Wendland wrote:
> Salute,
>
> i've a similar question as Timothy. I followed his discussions, and it seems
> that we want to do exactly the same at the same time... sometimes it is very
> mystical :)
> Back to business:
>
> I have an UML2 model with some union/subsets relationships and i want to
> realize these mechanisms in the resulting Ecore, like it is done in the
> wonderful UML2 project. I've introspected the uml2 sources but didn't found
> an hint how to include the UML2 generator instead of the ordinary EMF one,
> which doesn't care about union/subsets. Is there somewhere an article
> outthere, how to integrate this code generator?
>
> Any help would be appreciated.
>
> Marc-Florian
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using UML2 mechanism [message #477854 is a reply to message #477853] Tue, 21 October 2008 10:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

Dear Ed,

i've done this instincly by myself before. And i've explored the same
phenomenon like Timothy. It is possible to construct a model hierarchy with
the generated editor, but once you have serialized it and try to reopen it,
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce the
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
that's the problem, because all the elements, which are participating in the
Union-Relationship of the root element (like UML::Element) couldn't be
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple
model, because i have to solve this problem for my masterthesis... does
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
news:gdk5sb$3b2$1@build.eclipse.org...
> Marc-Florian,
>
> Here's what I would try as a simple "hack". Open the *.genmodel, change
> the xmlns:genmodel's namespace to
> http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
> "Reloading..." this model will continue to create the UML2 derived
> GenModel.
>
>
> Marc-Florian Wendland wrote:
>> Salute,
>>
>> i've a similar question as Timothy. I followed his discussions, and it
>> seems that we want to do exactly the same at the same time... sometimes
>> it is very mystical :)
>> Back to business:
>>
>> I have an UML2 model with some union/subsets relationships and i want to
>> realize these mechanisms in the resulting Ecore, like it is done in the
>> wonderful UML2 project. I've introspected the uml2 sources but didn't
>> found an hint how to include the UML2 generator instead of the ordinary
>> EMF one, which doesn't care about union/subsets. Is there somewhere an
>> article outthere, how to integrate this code generator?
>>
>> Any help would be appreciated.
>>
>> Marc-Florian
>>
>>
Re: Using UML2 mechanism [message #477855 is a reply to message #477854] Tue, 21 October 2008 10:46 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030107000009080307050307
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Marc-Florian,

It's likely that folks will want to be able to reproduce this problem.
Could you share a test case?


Marc-Florian Wendland wrote:
> Dear Ed,
>
> i've done this instincly by myself before. And i've explored the same
> phenomenon like Timothy. It is possible to construct a model hierarchy with
> the generated editor, but once you have serialized it and try to reopen it,
> it fails with the exception:
>
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> 'subset.test.impl.AImpl@192322e' is not legal.
> (platform:/resource/de/My2.test, -1, -1)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
> at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
> at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
> at
> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
> at
> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
> at
> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
> at
> org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
> at
> org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
> at
> org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
> at
> org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
> at
> org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
> at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
> at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
> at
> org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
> at
> org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
> at
> org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
> at
> org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
> at
> org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
> at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
> at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
> at
> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
> at
> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
> at
> org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
> at
> org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
> at
> org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
> at
> org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
> at
> org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:880)
> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
> at
> org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
> at
> org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
> at
> org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
> at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
> at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
> at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
> 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(Main.java: 549)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> 'subset.test.impl.AImpl@192322e' is not legal.
> (platform:/resource/de/My2.test, -1, -1)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
> ... 79 more
> Caused by: java.lang.UnsupportedOperationException
> at
> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
> //cannot resolve the subsets?
> at java.util.AbstractSequentialList.add(Unknown Source)
> at
> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
> ... 95 more
>
> All the DerivedUnion-List are generated, but the genmodel didn't produce the
> SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
> that's the problem, because all the elements, which are participating in the
> Union-Relationship of the root element (like UML::Element) couldn't be
> computed, since the wrong List-type was selected.
>
> May be it is possible to send one member of the UML2 project this simple
> model, because i have to solve this problem for my masterthesis... does
> anyone of this project has the interest to solve this problem with me?
>
> Thanks for answering
> Marc-Florian
>
> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
> news:gdk5sb$3b2$1@build.eclipse.org...
>
>> Marc-Florian,
>>
>> Here's what I would try as a simple "hack". Open the *.genmodel, change
>> the xmlns:genmodel's namespace to
>> http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
>> "Reloading..." this model will continue to create the UML2 derived
>> GenModel.
>>
>>
>> Marc-Florian Wendland wrote:
>>
>>> Salute,
>>>
>>> i've a similar question as Timothy. I followed his discussions, and it
>>> seems that we want to do exactly the same at the same time... sometimes
>>> it is very mystical :)
>>> Back to business:
>>>
>>> I have an UML2 model with some union/subsets relationships and i want to
>>> realize these mechanisms in the resulting Ecore, like it is done in the
>>> wonderful UML2 project. I've introspected the uml2 sources but didn't
>>> found an hint how to include the UML2 generator instead of the ordinary
>>> EMF one, which doesn't care about union/subsets. Is there somewhere an
>>> article outthere, how to integrate this code generator?
>>>
>>> Any help would be appreciated.
>>>
>>> Marc-Florian
>>>
>>>
>>>
>
>
>

--------------030107000009080307050307
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Marc-Florian,<br>
<br>
It's likely that folks will want to be able to reproduce this problem.&nbsp;
Could you share a test case?<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkajc$kq1$1@build.eclipse.org" type="cite">
<pre wrap="">Dear Ed,

i've done this instincly by myself before. And i've explored the same
phenomenon like Timothy. It is possible to construct a model hierarchy with
the generated editor, but once you have serialized it and try to reopen it,
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce the
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
that's the problem, because all the elements, which are participating in the
Union-Relationship of the root element (like UML::Element) couldn't be
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple
model, because i have to solve this problem for my masterthesis... does
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext" href="news:gdk5sb$3b2$1@build.eclipse.org">news:gdk5sb$3b2$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, change
the xmlns:genmodel's namespace to
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/uml2/2.2.0/GenModel">http://www.eclipse.org/uml2/2.2.0/GenModel</a> and then see how it goes.
"Reloading..." this model will continue to create the UML2 derived
GenModel.


Marc-Florian Wendland wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Salute,

i've a similar question as Timothy. I followed his discussions, and it
seems that we want to do exactly the same at the same time... sometimes
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to
realize these mechanisms in the resulting Ecore, like it is done in the
wonderful UML2 project. I've introspected the uml2 sources but didn't
found an hint how to include the UML2 generator instead of the ordinary
EMF one, which doesn't care about union/subsets. Is there somewhere an
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</body>
</html>

--------------030107000009080307050307--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using UML2 mechanism [message #477856 is a reply to message #477855] Tue, 21 October 2008 10:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

This is a multi-part message in MIME format.

------=_NextPart_000_00D6_01C9337C.249F49F0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_00D7_01C9337C.249F49F0"


------=_NextPart_001_00D7_01C9337C.249F49F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Ed,

what kind of test case. I think th easiest way to reproduce this is to =
propagate the genmodel and ecore files, isn't it? I've attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce this problem. =
Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_001_00D7_01C9337C.249F49F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I think th =
easiest way to=20
reproduce this is to propagate the genmodel and ecore files, isn't it? =
I've=20
attached them.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A=20
=
href=3D"news:gdkbtd$vqh$1@build.eclipse.org">news:gdkbtd$vqh$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this =
problem.&nbsp; Could=20
you share a test case?<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</A> =
schrieb im Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org">news:gdk5sb$3b2$1@build.ecli=
pse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel">http://www.eclipse.or=
g/uml2/2.2.0/GenModel</A> and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

</PRE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_00D7_01C9337C.249F49F0--

------=_NextPart_000_00D6_01C9337C.249F49F0
Content-Type: application/octet-stream;
name="Ohne_Titel1.genmodel"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="Ohne_Titel1.genmodel"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<genmodel:GenModel xmi:version=3D"2.0"
xmlns:xmi=3D"http://www.omg.org/XMI" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore=3D"http://www.eclipse.org/emf/2002/Ecore" =
xmlns:genmodel=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
modelDirectory=3D"/x/src"
modelPluginID=3D"x" modelName=3D"Ohne_Titel1" =
importerID=3D"org.eclipse.uml2.uml.ecore.importer"
complianceLevel=3D"6.0" suppressGenModelAnnotations=3D"false" =
copyrightFields=3D"false"
factoryMethods=3D"true" pluralizedGetters=3D"true" =
cacheAdapterSupport=3D"true" invariantPrefix=3D"validate">
<genAnnotations =
source=3D" http://www.eclipse.org/emf/2002/GenModel/importer/org.eclips e.u=
ml2.uml.ecore.importer">
<details key=3D"ECORE_TAGGED_VALUES" value=3D"PROCESS"/>
<details key=3D"UNION_PROPERTIES" value=3D"PROCESS"/>
<details key=3D"DUPLICATE_FEATURES" value=3D"DISCARD"/>
<details key=3D"SUBSETTING_PROPERTIES" value=3D"PROCESS"/>
<details key=3D"COMMENTS" value=3D"PROCESS"/>
<details key=3D"DUPLICATE_FEATURE_INHERITANCE" value=3D"DISCARD"/>
<details key=3D"DUPLICATE_OPERATIONS" value=3D"DISCARD"/>
<details key=3D"INVARIANT_CONSTRAINTS" value=3D"PROCESS"/>
<details key=3D"REDEFINING_PROPERTIES" value=3D"PROCESS"/>
<details key=3D"ANNOTATION_DETAILS" value=3D"PROCESS"/>
<details key=3D"DUPLICATE_OPERATION_INHERITANCE" value=3D"DISCARD"/>
<details key=3D"REDEFINING_OPERATIONS" value=3D"PROCESS"/>
<details key=3D"DERIVED_FEATURES" value=3D"PROCESS"/>
<details key=3D"OPERATION_BODIES" value=3D"PROCESS"/>
<details key=3D"CAMEL_CASE_NAMES" value=3D"PROCESS"/>
<details key=3D"SUPER_CLASS_ORDER" value=3D"PROCESS"/>
</genAnnotations>
<foreignModel>../../t/model/x/Ohne_Titel1.uml</foreignModel >
<genPackages xsi:type=3D"genmodel:GenPackage" prefix=3D"Subset" =
disposableProviderFactory=3D"true"
ecorePackage=3D"subset.ecore#/">
<nestedGenPackages xsi:type=3D"genmodel:GenPackage" =
prefix=3D"UmlStandardProfile"
basePackage=3D"subset" disposableProviderFactory=3D"true" =
ecorePackage=3D"subset.ecore#//umlStandardProfile"/>
<nestedGenPackages xsi:type=3D"genmodel:GenPackage" prefix=3D"Test" =
basePackage=3D"subset"
disposableProviderFactory=3D"true" =
ecorePackage=3D"subset.ecore#//test">
<genClasses xsi:type=3D"genmodel:GenClass" =
ecoreClass=3D"subset.ecore#//test/ModelElement">
<genFeatures xsi:type=3D"genmodel:GenFeature" =
property=3D"Readonly" notify=3D"false"
createChild=3D"false" ecoreFeature=3D"ecore:EReference =
subset.ecore#//test/ModelElement/ownedElements"/>
<genFeatures xsi:type=3D"genmodel:GenFeature" =
property=3D"Readonly" notify=3D"false"
createChild=3D"false" ecoreFeature=3D"ecore:EReference =
subset.ecore#//test/ModelElement/owner"/>
</genClasses>
<genClasses xsi:type=3D"genmodel:GenClass" =
ecoreClass=3D"subset.ecore#//test/A">
<genFeatures xsi:type=3D"genmodel:GenFeature" property=3D"None" =
children=3D"true"
createChild=3D"true" ecoreFeature=3D"ecore:EReference =
subset.ecore#//test/A/theB"/>
</genClasses>
<genClasses xsi:type=3D"genmodel:GenClass" =
ecoreClass=3D"subset.ecore#//test/B">
<genFeatures xsi:type=3D"genmodel:GenFeature" property=3D"None" =
notify=3D"false"
createChild=3D"false" ecoreFeature=3D"ecore:EReference =
subset.ecore#//test/B/theA"/>
</genClasses>
<genClasses xsi:type=3D"genmodel:GenClass" =
ecoreClass=3D"subset.ecore#//test/C"/>
</nestedGenPackages>
</genPackages>
</genmodel:GenModel>

------=_NextPart_000_00D6_01C9337C.249F49F0
Content-Type: application/octet-stream;
name="subset.ecore"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="subset.ecore"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<ecore:EPackage xmi:version=3D"2.0"
xmlns:xmi=3D"http://www.omg.org/XMI" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore=3D"http://www.eclipse.org/emf/2002/Ecore" =
name=3D"subset"
nsURI=3D"http:///subset.ecore" nsPrefix=3D"subset">
<eAnnotations source=3D"http://www.eclipse.org/emf/2002/GenModel">
<details key=3D"documentation" =
value=3D"Author:mfw.&#xA;Created:19.10.08 =
22:22.&#xA;Title:.&#xA;Comment:.&#xA;"/>
</eAnnotations>
<eSubpackages name=3D"umlStandardProfile" =
nsURI=3D"http:///subset/umlStandardProfile.ecore"
nsPrefix=3D"subset.umlStandardProfile">
<eAnnotations source=3D"http://www.eclipse.org/emf/2002/GenModel">
<details key=3D"documentation" value=3D"UML Standard Profile =
contains several popular stereotypes, tag definitions and constraints =
described in UML 1.4 and UML 2.0 Specifications."/>
</eAnnotations>
</eSubpackages>
<eSubpackages name=3D"test" nsURI=3D"http:///subset/test.ecore" =
nsPrefix=3D"subset.test">
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" =
name=3D"ownedElements" ordered=3D"false"
upperBound=3D"-1" eType=3D"#//test/ModelElement" =
changeable=3D"false" volatile=3D"true"
derived=3D"true" eOpposite=3D"#//test/ModelElement/owner">
<eAnnotations source=3D"union"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"owner" =
ordered=3D"false"
eType=3D"#//test/ModelElement" changeable=3D"false" =
volatile=3D"true" derived=3D"true"
eOpposite=3D"#//test/ModelElement/ownedElements">
<eAnnotations source=3D"union"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"A2" =
eSuperTypes=3D"#//test/ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"theC2" =
eType=3D"#//test/C"
containment=3D"true">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/ownedElements"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"A" =
eSuperTypes=3D"#//test/ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"theB" =
ordered=3D"false"
upperBound=3D"-1" eType=3D"#//test/B" derived=3D"true" =
containment=3D"true" eOpposite=3D"#//test/B/theA">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/ownedElements"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"theC" =
upperBound=3D"-1"
eType=3D"#//test/C" containment=3D"true">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/ownedElements"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"B" =
eSuperTypes=3D"#//test/ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"theA" =
ordered=3D"false"
eType=3D"#//test/A" eOpposite=3D"#//test/A/theB">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/owner"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"C" =
eSuperTypes=3D"#//test/ModelElement"/>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"Model" =
eSuperTypes=3D"#//test/ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" =
name=3D"modeableElements" upperBound=3D"-1"
eType=3D"#//test/ModelElement" containment=3D"true">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/ownedElements"/>
</eStructuralFeatures>
</eClassifiers>
</eSubpackages>
</ecore:EPackage>

------=_NextPart_000_00D6_01C9337C.249F49F0--
Re: Using UML2 mechanism [message #477857 is a reply to message #477856] Tue, 21 October 2008 11:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000400060400000206070308
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Marc-Florian,

Probably a union should be transient. Looking at the example, it seems
redundant to serialize a union. Worse than that in fact. I.e., given
these union features aren't changeable, serializing them seems like a
really bad idea...


Marc-Florian Wendland wrote:
> Ed,
>
> what kind of test case. I think th easiest way to reproduce this is to
> propagate the genmodel and ecore files, isn't it? I've attached them.
>
> Marc-Florian
>
> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
> schrieb im Newsbeitrag news:gdkbtd$vqh$1@build.eclipse.org...
> Marc-Florian,
>
> It's likely that folks will want to be able to reproduce this
> problem. Could you share a test case?
>
>
> Marc-Florian Wendland wrote:
>> Dear Ed,
>>
>> i've done this instincly by myself before. And i've explored the same
>> phenomenon like Timothy. It is possible to construct a model hierarchy with
>> the generated editor, but once you have serialized it and try to reopen it,
>> it fails with the exception:
>>
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>> 'subset.test.impl.AImpl@192322e' is not legal.
>> (platform:/resource/de/My2.test, -1, -1)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>> at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
>> at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
>> at
>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
>> at
>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>> at
>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
>> at
>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
>> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
>> at
>> org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
>> at
>> org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
>> at
>> org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
>> at
>> org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
>> at
>> org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
>> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
>> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
>> at
>> org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
>> at
>> org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
>> at
>> org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
>> at
>> org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
>> at
>> org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
>> at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
>> at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
>> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
>> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
>> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
>> at
>> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
>> at
>> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
>> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
>> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
>> at
>> org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
>> at
>> org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
>> at
>> org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
>> at
>> org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
>> at
>> org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>> at org.eclipse.core.runtime.Platform.run(Platform.java:880)
>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
>> at
>> org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
>> at
>> org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
>> at
>> org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
>> at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
>> at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
>> at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>> at
>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>> 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(Main.java: 549)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
>> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>> 'subset.test.impl.AImpl@192322e' is not legal.
>> (platform:/resource/de/My2.test, -1, -1)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>> Source)
>> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>> Source)
>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>> ... 79 more
>> Caused by: java.lang.UnsupportedOperationException
>> at
>> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
>> //cannot resolve the subsets?
>> at java.util.AbstractSequentialList.add(Unknown Source)
>> at
>> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
>> ... 95 more
>>
>> All the DerivedUnion-List are generated, but the genmodel didn't produce the
>> SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
>> that's the problem, because all the elements, which are participating in the
>> Union-Relationship of the root element (like UML::Element) couldn't be
>> computed, since the wrong List-type was selected.
>>
>> May be it is possible to send one member of the UML2 project this simple
>> model, because i have to solve this problem for my masterthesis... does
>> anyone of this project has the interest to solve this problem with me?
>>
>> Thanks for answering
>> Marc-Florian
>>
>> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
>> news:gdk5sb$3b2$1@build.eclipse.org...
>>
>>> Marc-Florian,
>>>
>>> Here's what I would try as a simple "hack". Open the *.genmodel, change
>>> the xmlns:genmodel's namespace to
>>> http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
>>> "Reloading..." this model will continue to create the UML2 derived
>>> GenModel.
>>>
>>>
>>> Marc-Florian Wendland wrote:
>>>
>>>> Salute,
>>>>
>>>> i've a similar question as Timothy. I followed his discussions, and it
>>>> seems that we want to do exactly the same at the same time... sometimes
>>>> it is very mystical :)
>>>> Back to business:
>>>>
>>>> I have an UML2 model with some union/subsets relationships and i want to
>>>> realize these mechanisms in the resulting Ecore, like it is done in the
>>>> wonderful UML2 project. I've introspected the uml2 sources but didn't
>>>> found an hint how to include the UML2 generator instead of the ordinary
>>>> EMF one, which doesn't care about union/subsets. Is there somewhere an
>>>> article outthere, how to integrate this code generator?
>>>>
>>>> Any help would be appreciated.
>>>>
>>>> Marc-Florian
>>>>
>>>>
>>>>
>>
>>
>>
>

--------------000400060400000206070308
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Marc-Florian,<br>
<br>
Probably a union should be transient.&nbsp; Looking at the example, it seems
redundant to serialize a union.&nbsp; Worse than that in fact.&nbsp; I.e., given
these union features aren't changeable, serializing them seems like a
really bad idea...<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkc94$4qa$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2900.5659" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Ed,</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">what kind of test case. I think th
easiest way to reproduce this is to propagate the genmodel and ecore
files, isn't it? I've attached them.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Marc-Florian</font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a moz-do-not-send="true"
href="mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</a>&gt; schrieb im
Newsbeitrag <a moz-do-not-send="true"
href="news:gdkbtd$vqh$1@build.eclipse.org">news:gdkbtd$vqh$1@build.eclipse.org</a>...</div>
Marc-Florian,<br>
<br>
It's likely that folks will want to be able to reproduce this problem.&nbsp;
Could you share a test case?<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkajc$kq1$1@build.eclipse.org" type="cite">
<pre wrap="">Dear Ed,

i've done this instincly by myself before. And i've explored the same
phenomenon like Timothy. It is possible to construct a model hierarchy with
the generated editor, but once you have serialized it and try to reopen it,
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce the
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
that's the problem, because all the elements, which are participating in the
Union-Relationship of the root element (like UML::Element) couldn't be
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple
model, because i have to solve this problem for my masterthesis... does
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</a> schrieb im Newsbeitrag
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="news:gdk5sb$3b2$1@build.eclipse.org">news:gdk5sb$3b2$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, change
the xmlns:genmodel's namespace to
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.eclipse.org/uml2/2.2.0/GenModel">http://www.eclipse.org/uml2/2.2.0/GenModel</a> and then see how it goes.
"Reloading..." this model will continue to create the UML2 derived
GenModel.


Marc-Florian Wendland wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Salute,

i've a similar question as Timothy. I followed his discussions, and it
seems that we want to do exactly the same at the same time... sometimes
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to
realize these mechanisms in the resulting Ecore, like it is done in the
wonderful UML2 project. I've introspected the uml2 sources but didn't
found an hint how to include the UML2 generator instead of the ordinary
EMF one, which doesn't care about union/subsets. Is there somewhere an
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>

--------------000400060400000206070308--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using UML2 mechanism [message #477858 is a reply to message #477857] Tue, 21 October 2008 12:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

This is a multi-part message in MIME format.

------=_NextPart_000_0105_01C93386.32386240
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0106_01C93386.32386240"


------=_NextPart_001_0106_01C93386.32386240
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Ed,

okay, that was a good point. 1-0 for you, as we say in Germany. But, my =
point was also very good, because the elements, which i wanted to be =
participating in the union, aren't be computed correctly. Only the top =
level children of the root element are computed as "ownedElements". And =
i really think, that this missbehaviour is a result of using the wrong =
List for computing the subsets. I've attached a simple model, which =
illustrates this missbehaviour. Here it is with no overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is 2. In uml2 =
philosophie, this should be 5, because every containment reference is =
defined as a subset of the ownedElements reference, hence, the =
references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the example, it =
seems redundant to serialize a union. Worse than that in fact. I.e., =
given these union features aren't changeable, serializing them seems =
like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to reproduce this is =
to propagate the genmodel and ecore files, isn't it? I've attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce this =
problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_001_0106_01C93386.32386240
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. 1-0 for =
you, as we say=20
in Germany. But, my point was also very good, because the elements, =
which i=20
wanted to be participating in the union, aren't be computed correctly. =
Only the=20
top level children of the root element are computed as "ownedElements". =
And i=20
really think, that this missbehaviour is a result of using the wrong =
List for=20
computing the subsets. I've attached a simple model, which illustrates =
this=20
missbehaviour. Here it is with no overhead:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the references =
as=20
follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner =
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owningModel(subsets=20
owner)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
modeableElements(subsets=20
ownedElements)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB (subsets=20
ownedElements)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA(subsets =
owner)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC (subsets=20
ownedElements)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 (subsets=20
owner)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements in the =
Root model, the=20
result is 2. In uml2 philosophie, this should be 5, because every =
containment=20
reference is defined as a subset of the ownedElements reference, hence, =
the=20
references should contribute themself into the derived union =
relationship. But=20
this isn't done... and again, i think this relates to the choice of the=20
generated lists. But i'm really not sure. If i would know, why this =
approach=20
fails, i wouldn't post here :-)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A=20
=
href=3D"news:gdkedv$trt$1@build.eclipse.org">news:gdkedv$trt$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, it seems =
redundant=20
to serialize a union.&nbsp; Worse than that in fact.&nbsp; I.e., given =
these=20
union features aren't changeable, serializing them seems like a really =
bad=20
idea...<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I think th =
easiest way=20
to reproduce this is to propagate the genmodel and ecore files, =
isn't it?=20
I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =
Newsbeitrag=20
<A href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this =
problem.&nbsp;=20
Could you share a test case?<BR><BR><BR>Marc-Florian Wendland =
wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BODY></HTML>

------=_NextPart_001_0106_01C93386.32386240--

------=_NextPart_000_0105_01C93386.32386240
Content-Type: application/octet-stream;
name="My3.test"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="My3.test"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<subset.test:Model xmi:version=3D"2.0" =
xmlns:xmi=3D"http://www.omg.org/XMI" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:subset.test=3D"http:///subset/test.ecore">
<modeableElements xsi:type=3D"subset.test:A">
<theB/>
<theB/>
</modeableElements>
<modeableElements xsi:type=3D"subset.test:A2">
<theC2/>
</modeableElements>
</subset.test:Model>

------=_NextPart_000_0105_01C93386.32386240--
Re: Using UML2 mechanism [message #477859 is a reply to message #477858] Tue, 21 October 2008 12:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080309010204070903070403
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:
> Dear Ed,
>
> okay, that was a good point. 1-0 for you, as we say in Germany.
Darned, we're keeping score!
> But, my point was also very good, because the elements, which i wanted
> to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P
> Only the top level children of the root element are computed as
> "ownedElements". And i really think, that this missbehaviour is a
> result of using the wrong List for computing the subsets. I've
> attached a simple model, which illustrates this missbehaviour. Here it
> is with no overhead:
>
> Root
> A
> B
> B
> A2
> C
>
> while metamodel defines the references as follows:
>
> Element
> ownedElements (union)
> owner (union)
> owningModel(subsets owner)
>
> Root : Element
> modeableElements(subsets ownedElements)
>
> A:Element
> theB (subsets ownedElements)
>
> B:Element
> theA(subsets owner)
>
> A2:Element
> theC (subsets ownedElements)
>
> C:Element
> theA2 (subsets owner)
>
> When i call getOwnedElements in the Root model, the result is 2. In
> uml2 philosophie, this should be 5, because every containment
> reference is defined as a subset of the ownedElements reference,
> hence, the references should contribute themself into the derived
> union relationship. But this isn't done... and again, i think this
> relates to the choice of the generated lists. But i'm really not sure.
> If i would know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned these
concepts. I was hoping to live in ignorant bliss a little longer. :-P
>
> Marc-Florian
>
> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
> schrieb im Newsbeitrag news:gdkedv$trt$1@build.eclipse.org...
> Marc-Florian,
>
> Probably a union should be transient. Looking at the example, it
> seems redundant to serialize a union. Worse than that in fact.
> I.e., given these union features aren't changeable, serializing
> them seems like a really bad idea...
>
>
> Marc-Florian Wendland wrote:
>> Ed,
>>
>> what kind of test case. I think th easiest way to reproduce this
>> is to propagate the genmodel and ecore files, isn't it? I've
>> attached them.
>>
>> Marc-Florian
>>
>> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
>> schrieb im Newsbeitrag news:gdkbtd$vqh$1@build.eclipse.org...
>> Marc-Florian,
>>
>> It's likely that folks will want to be able to reproduce this
>> problem. Could you share a test case?
>>
>>
>> Marc-Florian Wendland wrote:
>>> Dear Ed,
>>>
>>> i've done this instincly by myself before. And i've explored the same
>>> phenomenon like Timothy. It is possible to construct a model hierarchy with
>>> the generated editor, but once you have serialized it and try to reopen it,
>>> it fails with the exception:
>>>
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>> 'subset.test.impl.AImpl@192322e' is not legal.
>>> (platform:/resource/de/My2.test, -1, -1)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>> at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
>>> at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
>>> at
>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
>>> at
>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>> at
>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
>>> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
>>> at
>>> org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
>>> at
>>> org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
>>> at
>>> org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
>>> at
>>> org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
>>> at
>>> org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
>>> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
>>> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
>>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
>>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
>>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
>>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
>>> at
>>> org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
>>> at
>>> org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
>>> at
>>> org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
>>> at
>>> org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
>>> at
>>> org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
>>> at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
>>> at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
>>> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
>>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
>>> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
>>> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
>>> at
>>> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
>>> at
>>> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
>>> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
>>> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
>>> at
>>> org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
>>> at
>>> org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
>>> at
>>> org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
>>> at
>>> org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>> at org.eclipse.core.runtime.Platform.run(Platform.java:880)
>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
>>> at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
>>> at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
>>> at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>> at
>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
>>> at
>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>>> 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(Main.java: 549)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
>>> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>> 'subset.test.impl.AImpl@192322e' is not legal.
>>> (platform:/resource/de/My2.test, -1, -1)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>> Source)
>>> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>> Source)
>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>> ... 79 more
>>> Caused by: java.lang.UnsupportedOperationException
>>> at
>>> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
>>> //cannot resolve the subsets?
>>> at java.util.AbstractSequentialList.add(Unknown Source)
>>> at
>>> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
>>> ... 95 more
>>>
>>> All the DerivedUnion-List are generated, but the genmodel didn't produce the
>>> SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
>>> that's the problem, because all the elements, which are participating in the
>>> Union-Relationship of the root element (like UML::Element) couldn't be
>>> computed, since the wrong List-type was selected.
>>>
>>> May be it is possible to send one member of the UML2 project this simple
>>> model, because i have to solve this problem for my masterthesis... does
>>> anyone of this project has the interest to solve this problem with me?
>>>
>>> Thanks for answering
>>> Marc-Florian
>>>
>>> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
>>> news:gdk5sb$3b2$1@build.eclipse.org...
>>>
>>>> Marc-Florian,
>>>>
>>>> Here's what I would try as a simple "hack". Open the *.genmodel, change
>>>> the xmlns:genmodel's namespace to
>>>> http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
>>>> "Reloading..." this model will continue to create the UML2 derived
>>>> GenModel.
>>>>
>>>>
>>>> Marc-Florian Wendland wrote:
>>>>
>>>>> Salute,
>>>>>
>>>>> i've a similar question as Timothy. I followed his discussions, and it
>>>>> seems that we want to do exactly the same at the same time... sometimes
>>>>> it is very mystical :)
>>>>> Back to business:
>>>>>
>>>>> I have an UML2 model with some union/subsets relationships and i want to
>>>>> realize these mechanisms in the resulting Ecore, like it is done in the
>>>>> wonderful UML2 project. I've introspected the uml2 sources but didn't
>>>>> found an hint how to include the UML2 generator instead of the ordinary
>>>>> EMF one, which doesn't care about union/subsets. Is there somewhere an
>>>>> article outthere, how to integrate this code generator?
>>>>>
>>>>> Any help would be appreciated.
>>>>>
>>>>> Marc-Florian
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>

--------------080309010204070903070403
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Marc-Florian,<br>
<br>
Comments below.<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkgfp$i3d$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2900.5659" name="GENERATOR">
<div><font face="Arial" size="2">Dear Ed,</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">okay, that was a good point. 1-0 for
you, as we say in Germany. </font></div>
</blockquote>
Darned, we're keeping score!<br>
<blockquote cite="mid:gdkgfp$i3d$1@build.eclipse.org" type="cite">
<div><font face="Arial" size="2">But, my point was also very good,
because the elements, which i wanted to be participating in the union,
aren't be computed correctly.</font></div>
</blockquote>
I wouldn't know correct if I saw it. :-P<br>
<blockquote cite="mid:gdkgfp$i3d$1@build.eclipse.org" type="cite">
<div><font face="Arial" size="2"> Only the top level children of the
root element are computed as "ownedElements". And i really think, that
this missbehaviour is a result of using the wrong List for computing
the subsets. I've attached a simple model, which illustrates this
missbehaviour. Here it is with no overhead:</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Root</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; A</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; B</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; B</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; A2</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; C</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">while metamodel defines the
references as follows:</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; ownedElements (union)</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; owner (union)</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; owningModel(subsets owner)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Root : Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; modeableElements(subsets
ownedElements)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">A:Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; theB (subsets ownedElements)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">B:Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; theA(subsets owner)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">A2:Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; theC (subsets ownedElements)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">C:Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; theA2 (subsets owner)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">When i call getOwnedElements in the
Root model, the result is 2. In uml2 philosophie, this should be 5,
because every containment reference is defined as a subset of the
ownedElements reference, hence, the references should contribute
themself into the derived union relationship. But this isn't done...
and again, i think this relates to the choice of the generated lists.
But i'm really not sure. If i would know, why this approach fails, i
wouldn't post here :-)</font></div>
</blockquote>
I think this require Kenn's attention because I've never learned these
concepts.&nbsp; I was hoping to live in ignorant bliss a little longer. :-P<br>
<blockquote cite="mid:gdkgfp$i3d$1@build.eclipse.org" type="cite">
<div>&nbsp;</div>
<div><font face="Arial" size="2">Marc-Florian</font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a moz-do-not-send="true"
href="mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</a>&gt; schrieb im
Newsbeitrag <a moz-do-not-send="true"
href="news:gdkedv$trt$1@build.eclipse.org">news:gdkedv$trt$1@build.eclipse.org</a>...</div>
Marc-Florian,<br>
<br>
Probably a union should be transient.&nbsp; Looking at the example, it seems
redundant to serialize a union.&nbsp; Worse than that in fact.&nbsp; I.e., given
these union features aren't changeable, serializing them seems like a
really bad idea...<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkc94$4qa$1@build.eclipse.org" type="cite">
<meta content="MSHTML 6.00.2900.5659" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Ed,</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">what kind of test case. I think
th easiest way to reproduce this is to propagate the genmodel and ecore
files, isn't it? I've attached them.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Marc-Florian</font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a href="mailto:Ed.Merks@gmail.com"
moz-do-not-send="true">Ed.Merks@gmail.com</a>&gt; schrieb im
Newsbeitrag <a href="news:gdkbtd$vqh$1@build.eclipse.org"
moz-do-not-send="true">news:gdkbtd$vqh$1@build.eclipse.org</a>...</div>
Marc-Florian,<br>
<br>
It's likely that folks will want to be able to reproduce this problem.&nbsp;
Could you share a test case?<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkajc$kq1$1@build.eclipse.org"
type="cite">
<pre wrap="">Dear Ed,

i've done this instincly by myself before. And i've explored the same
phenomenon like Timothy. It is possible to construct a model hierarchy with
the generated editor, but once you have serialized it and try to reopen it,
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce the
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
that's the problem, because all the elements, which are participating in the
Union-Relationship of the root element (like UML::Element) couldn't be
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple
model, because i have to solve this problem for my masterthesis... does
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <a class="moz-txt-link-rfc2396E"
href="mailto:Ed.Merks@gmail.com" moz-do-not-send="true">&lt;Ed.Merks@gmail.com&gt;</a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext"
href="news:gdk5sb$3b2$1@build.eclipse.org" moz-do-not-send="true">news:gdk5sb$3b2$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, change
the xmlns:genmodel's namespace to
<a class="moz-txt-link-freetext"
href="http://www.eclipse.org/uml2/2.2.0/GenModel"
moz-do-not-send="true">http://www.eclipse.org/uml2/2.2.0/GenModel</a> and then see how it goes.
"Reloading..." this model will continue to create the UML2 derived
GenModel.


Marc-Florian Wendland wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Salute,

i've a similar question as Timothy. I followed his discussions, and it
seems that we want to do exactly the same at the same time... sometimes
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to
realize these mechanisms in the resulting Ecore, like it is done in the
wonderful UML2 project. I've introspected the uml2 sources but didn't
found an hint how to include the UML2 generator instead of the ordinary
EMF one, which doesn't care about union/subsets. Is there somewhere an
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>

--------------080309010204070903070403--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using UML2 mechanism [message #477860 is a reply to message #477859] Tue, 21 October 2008 14:54 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_003B_01C9336B.57CFE750
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

... comments below ...
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdkh14$ms1$1@build.eclipse.org...
Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:=20
Dear Ed,

okay, that was a good point. 1-0 for you, as we say in Germany.=20
Darned, we're keeping score!

But, my point was also very good, because the elements, which i =
wanted to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P

Only the top level children of the root element are computed as =
"ownedElements". And i really think, that this missbehaviour is a result =
of using the wrong List for computing the subsets. I've attached a =
simple model, which illustrates this missbehaviour. Here it is with no =
overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is 2. In =
uml2 philosophie, this should be 5, because every containment reference =
is defined as a subset of the ownedElements reference, hence, the =
references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned these =
concepts. I was hoping to live in ignorant bliss a little longer. :-P


[James] Without a doubt, Kenn is the master of subsets and derived =
unions but in my humble opinion, calling getOwnedElements in the root =
model and retrieving 2 elements is fine. This can be considered all the =
"direct" owned elements. If you want all the direct and indirect =
elements a special query, allOwnedElements, is defined in the spec. =
see section 7.3.14 in the "Additional Operations" section.



Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the example, it =
seems redundant to serialize a union. Worse than that in fact. I.e., =
given these union features aren't changeable, serializing them seems =
like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to reproduce this =
is to propagate the genmodel and ecore files, isn't it? I've attached =
them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce this =
problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_000_003B_01C9336B.57CFE750
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.3395" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>.. comments below ...</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:gdkh14$ms1$1@build.eclipse.org">news:gdkh14$ms1$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Comments=20
below.<BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. 1-0 =
for you, as we=20
say in Germany. </FONT></DIV></BLOCKQUOTE>Darned, we're keeping =
score!<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>But, my point was also very good, =
because the=20
elements, which i wanted to be participating in the union, aren't be =

computed correctly.</FONT></DIV></BLOCKQUOTE>I wouldn't know correct =
if I saw=20
it. :-P<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>Only the top level children of the =
root element=20
are computed as "ownedElements". And i really think, that this =
missbehaviour=20
is a result of using the wrong List for computing the subsets. I've =
attached=20
a simple model, which illustrates this missbehaviour. Here it is =
with no=20
overhead:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the =
references as=20
follows:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner =
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
owningModel(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
modeableElements(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB (subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC (subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 (subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements in the =
Root model,=20
the result is 2. In uml2 philosophie, this should be 5, because =
every=20
containment reference is defined as a subset of the ownedElements =
reference,=20
hence, the references should contribute themself into the derived =
union=20
relationship. But this isn't done... and again, i think this relates =
to the=20
choice of the generated lists. But i'm really not sure. If i would =
know, why=20
this approach fails, i wouldn't post here =
:-)</FONT></DIV></BLOCKQUOTE>
<DIV>I think this require Kenn's attention because I've never learned =
these=20
concepts.&nbsp; I was hoping to live in ignorant bliss a little =
longer.=20
:-P</DIV>
<DIV><BR>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>[James]&nbsp;&nbsp; =
Witho</FONT><FONT=20
face=3DArial size=3D2>ut a doubt, Kenn is the master of subsets and =
derived=20
unions but in my humble opinion, calling getOwnedElements in the =
root model=20
and retrieving 2 elements is fine.&nbsp; This can be considered all =
the=20
"direct" owned elements. &nbsp;&nbsp;&nbsp;If you want all the =
direct and=20
indirect elements a special query, <EM>allOwnedElements, =
</EM>&nbsp;is=20
defined in the spec.&nbsp; see section 7.3.14 in the "Additional =
Operations"=20
section.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =
Newsbeitrag=20
<A href=3D"news:gdkedv$trt$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkedv$trt$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, it =
seems=20
redundant to serialize a union.&nbsp; Worse than that in =
fact.&nbsp; I.e.,=20
given these union features aren't changeable, serializing them =
seems like=20
a really bad idea...<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I think =
th easiest=20
way to reproduce this is to propagate the genmodel and ecore =
files,=20
isn't it? I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =

Newsbeitrag <A href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this=20
problem.&nbsp; Could you share a test =
case?<BR><BR><BR>Marc-Florian=20
Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_003B_01C9336B.57CFE750--
Re: Using UML2 mechanism [message #477862 is a reply to message #477860] Tue, 21 October 2008 18:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

This is a multi-part message in MIME format.

------=_NextPart_000_0052_01C933BB.994819F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear James,
dear Ed,

the allOwnedElements is an option, that's right.=20
I just thought, that the content of the union ownedElements would =
include any element, that participate in that relationship via subset =
mechanism, in whatever hierarchy level they are defined. But the way it =
now works isn't so far from that, what i've expected. I've tried to add =
a containment relationship that doesn't participate in the ownedElement =
relationship and it wasn't selected, when i call getOwnedElements(). So =
far so good.

May be, i got a wrong imagination from the union/subsets mechanism.=20

Thanks=20
Marc-Florian
"James Bruck" <jbruck@ca.ibm.com> schrieb im Newsbeitrag =
news:gdkqbh$tk3$1@build.eclipse.org...
.. comments below ...
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdkh14$ms1$1@build.eclipse.org...
Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:=20
Dear Ed,

okay, that was a good point. 1-0 for you, as we say in Germany.=20
Darned, we're keeping score!

But, my point was also very good, because the elements, which i =
wanted to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P

Only the top level children of the root element are computed as =
"ownedElements". And i really think, that this missbehaviour is a result =
of using the wrong List for computing the subsets. I've attached a =
simple model, which illustrates this missbehaviour. Here it is with no =
overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is 2. =
In uml2 philosophie, this should be 5, because every containment =
reference is defined as a subset of the ownedElements reference, hence, =
the references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned =
these concepts. I was hoping to live in ignorant bliss a little longer. =
:-P

=20
[James] Without a doubt, Kenn is the master of subsets and =
derived unions but in my humble opinion, calling getOwnedElements in the =
root model and retrieving 2 elements is fine. This can be considered =
all the "direct" owned elements. If you want all the direct and =
indirect elements a special query, allOwnedElements, is defined in the =
spec. see section 7.3.14 in the "Additional Operations" section.



Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the example, =
it seems redundant to serialize a union. Worse than that in fact. =
I.e., given these union features aren't changeable, serializing them =
seems like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to reproduce =
this is to propagate the genmodel and ecore files, isn't it? I've =
attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce =
this problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_000_0052_01C933BB.994819F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear James,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dear&nbsp;Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>the allOwnedElements is an option, =
that's=20
right.&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I just thought, that the content of the =
union=20
ownedElements would include any element, that participate in that =
relationship=20
via subset mechanism, in whatever hierarchy level they are defined. But =
the way=20
it now works isn't so far from that, what i've expected. I've tried to =
add a=20
containment relationship that doesn't participate in the ownedElement=20
relationship and it wasn't selected, when i call getOwnedElements(). So =
far so=20
good.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>May be, i got a wrong imagination from =
the=20
union/subsets&nbsp;mechanism. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"James Bruck" &lt;<A=20
href=3D"mailto:jbruck@ca.ibm.com">jbruck@ca.ibm.com</A>&gt; schrieb im =

Newsbeitrag <A=20
=
href=3D"news:gdkqbh$tk3$1@build.eclipse.org">news:gdkqbh$tk3$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>.. comments below ...</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:gdkh14$ms1$1@build.eclipse.org">news:gdkh14$ms1$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Comments=20
below.<BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. 1-0 =
for you, as=20
we say in Germany. </FONT></DIV></BLOCKQUOTE>Darned, we're keeping =

score!<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>But, my point was also very good, =
because the=20
elements, which i wanted to be participating in the union, aren't =
be=20
computed correctly.</FONT></DIV></BLOCKQUOTE>I wouldn't know =
correct if I=20
saw it. :-P<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>Only the top level children of =
the root=20
element are computed as "ownedElements". And i really think, that =
this=20
missbehaviour is a result of using the wrong List for computing =
the=20
subsets. I've attached a simple model, which illustrates this=20
missbehaviour. Here it is with no overhead:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the =
references as=20
follows:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner =
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
owningModel(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
modeableElements(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB (subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC (subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 (subsets =

owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements in =
the Root=20
model, the result is 2. In uml2 philosophie, this should be 5, =
because=20
every containment reference is defined as a subset of the =
ownedElements=20
reference, hence, the references should contribute themself into =
the=20
derived union relationship. But this isn't done... and again, i =
think this=20
relates to the choice of the generated lists. But i'm really not =
sure. If=20
i would know, why this approach fails, i wouldn't post here=20
:-)</FONT></DIV></BLOCKQUOTE>
<DIV>I think this require Kenn's attention because I've never =
learned these=20
concepts.&nbsp; I was hoping to live in ignorant bliss a little =
longer.=20
:-P</DIV>
<DIV><BR>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>[James]&nbsp;&nbsp; =
Witho</FONT><FONT=20
face=3DArial size=3D2>ut a doubt, Kenn is the master of subsets =
and derived=20
unions but in my humble opinion, calling getOwnedElements in the =
root=20
model and retrieving 2 elements is fine.&nbsp; This can be =
considered all=20
the "direct" owned elements. &nbsp;&nbsp;&nbsp;If you want all the =
direct=20
and indirect elements a special query, <EM>allOwnedElements, =
</EM>&nbsp;is=20
defined in the spec.&nbsp; see section 7.3.14 in the "Additional=20
Operations" section.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =
Newsbeitrag=20
<A href=3D"news:gdkedv$trt$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkedv$trt$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, it =
seems=20
redundant to serialize a union.&nbsp; Worse than that in =
fact.&nbsp;=20
I.e., given these union features aren't changeable, serializing =
them=20
seems like a really bad idea...<BR><BR><BR>Marc-Florian Wendland =
wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I =
think th=20
easiest way to reproduce this is to propagate the genmodel and =
ecore=20
files, isn't it? I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this=20
problem.&nbsp; Could you share a test =
case?<BR><BR><BR>Marc-Florian=20
Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0052_01C933BB.994819F0--
Re: Using UML2 mechanism [message #477875 is a reply to message #477862] Thu, 23 October 2008 16:42 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_00A6_01C9350C.CD769470
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

It's a well-established convention (for better or worse) in the UML =
specification to use "foo" to refer to directly associated elements and =
"allFoo" to refer to a greater set of associated elements which takes a =
hierarchy (such as composition or generalization) into consideration...

In terms of subsets and unions, the semantics are (not surprisingly) =
vague on whether inclusion in the set is recursive, but given the above =
mentioned convention, we made the assumption that it shouldn't be =
(otherwise the definition of the allOwnedElements() operation would be =
redundant)...

Kenn
"Marc-Florian Wendland" <florianwendland@freenet.de> wrote in message =
news:gdl6si$47m$1@build.eclipse.org...
Dear James,
dear Ed,

the allOwnedElements is an option, that's right.=20
I just thought, that the content of the union ownedElements would =
include any element, that participate in that relationship via subset =
mechanism, in whatever hierarchy level they are defined. But the way it =
now works isn't so far from that, what i've expected. I've tried to add =
a containment relationship that doesn't participate in the ownedElement =
relationship and it wasn't selected, when i call getOwnedElements(). So =
far so good.

May be, i got a wrong imagination from the union/subsets mechanism.=20

Thanks=20
Marc-Florian
"James Bruck" <jbruck@ca.ibm.com> schrieb im Newsbeitrag =
news:gdkqbh$tk3$1@build.eclipse.org...
.. comments below ...
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdkh14$ms1$1@build.eclipse.org...
Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:=20
Dear Ed,

okay, that was a good point. 1-0 for you, as we say in Germany.=20
Darned, we're keeping score!

But, my point was also very good, because the elements, which i =
wanted to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P

Only the top level children of the root element are computed as =
"ownedElements". And i really think, that this missbehaviour is a result =
of using the wrong List for computing the subsets. I've attached a =
simple model, which illustrates this missbehaviour. Here it is with no =
overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is 2. =
In uml2 philosophie, this should be 5, because every containment =
reference is defined as a subset of the ownedElements reference, hence, =
the references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned =
these concepts. I was hoping to live in ignorant bliss a little longer. =
:-P

=20
[James] Without a doubt, Kenn is the master of subsets and =
derived unions but in my humble opinion, calling getOwnedElements in the =
root model and retrieving 2 elements is fine. This can be considered =
all the "direct" owned elements. If you want all the direct and =
indirect elements a special query, allOwnedElements, is defined in the =
spec. see section 7.3.14 in the "Additional Operations" section.



Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the example, =
it seems redundant to serialize a union. Worse than that in fact. =
I.e., given these union features aren't changeable, serializing them =
seems like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to reproduce =
this is to propagate the genmodel and ecore files, isn't it? I've =
attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce =
this problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_000_00A6_01C9350C.CD769470
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16705" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>It's a well-established convention (for =
better or=20
worse) in the UML specification to use "foo" to refer to directly =
associated=20
elements and "allFoo" to refer to a greater set of associated elements =
which=20
takes a hierarchy (such as composition or generalization) into=20
consideration...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In terms of subsets and unions, the =
semantics are=20
(not surprisingly) vague on whether inclusion in the set is recursive, =
but given=20
the above mentioned convention, we made the assumption that it shouldn't =
be=20
(otherwise the definition of the allOwnedElements() operation would be=20
redundant)...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Kenn</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Marc-Florian Wendland" &lt;<A=20
=
href=3D"mailto:florianwendland@freenet.de">florianwendland@freenet.de</A>=
&gt;=20
wrote in message <A=20
=
href=3D"news:gdl6si$47m$1@build.eclipse.org">news:gdl6si$47m$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Dear James,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dear&nbsp;Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>the allOwnedElements is an option, =
that's=20
right.&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I just thought, that the content of =
the union=20
ownedElements would include any element, that participate in that =
relationship=20
via subset mechanism, in whatever hierarchy level they are defined. =
But the=20
way it now works isn't so far from that, what i've expected. I've =
tried to add=20
a containment relationship that doesn't participate in the =
ownedElement=20
relationship and it wasn't selected, when i call getOwnedElements(). =
So far so=20
good.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>May be, i got a wrong imagination =
from the=20
union/subsets&nbsp;mechanism. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"James Bruck" &lt;<A=20
href=3D"mailto:jbruck@ca.ibm.com">jbruck@ca.ibm.com</A>&gt; schrieb =
im=20
Newsbeitrag <A=20
=
href=3D"news:gdkqbh$tk3$1@build.eclipse.org">news:gdkqbh$tk3$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>.. comments below ...</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:gdkh14$ms1$1@build.eclipse.org">news:gdkh14$ms1$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Comments=20
below.<BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. =
1-0 for you,=20
as we say in Germany. </FONT></DIV></BLOCKQUOTE>Darned, we're =
keeping=20
score!<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>But, my point was also very =
good, because=20
the elements, which i wanted to be participating in the union, =
aren't be=20
computed correctly.</FONT></DIV></BLOCKQUOTE>I wouldn't know =
correct if I=20
saw it. :-P<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>Only the top level children of =
the root=20
element are computed as "ownedElements". And i really think, =
that this=20
missbehaviour is a result of using the wrong List for computing =
the=20
subsets. I've attached a simple model, which illustrates this=20
missbehaviour. Here it is with no overhead:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the =
references as=20
follows:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
owningModel(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
modeableElements(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB =
(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA(subsets =

owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC =
(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 =
(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements in =
the Root=20
model, the result is 2. In uml2 philosophie, this should be 5, =
because=20
every containment reference is defined as a subset of the =
ownedElements=20
reference, hence, the references should contribute themself into =
the=20
derived union relationship. But this isn't done... and again, i =
think=20
this relates to the choice of the generated lists. But i'm =
really not=20
sure. If i would know, why this approach fails, i wouldn't post =
here=20
:-)</FONT></DIV></BLOCKQUOTE>
<DIV>I think this require Kenn's attention because I've never =
learned=20
these concepts.&nbsp; I was hoping to live in ignorant bliss a =
little=20
longer. :-P</DIV>
<DIV><BR>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>[James]&nbsp;&nbsp; =
Witho</FONT><FONT=20
face=3DArial size=3D2>ut a doubt, Kenn is the master of subsets =
and derived=20
unions but in my humble opinion, calling getOwnedElements in the =
root=20
model and retrieving 2 elements is fine.&nbsp; This can be =
considered=20
all the "direct" owned elements. &nbsp;&nbsp;&nbsp;If you want =
all the=20
direct and indirect elements a special query, =
<EM>allOwnedElements,=20
</EM>&nbsp;is defined in the spec.&nbsp; see section 7.3.14 in =
the=20
"Additional Operations" section.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =

Newsbeitrag <A href=3D"news:gdkedv$trt$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkedv$trt$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, it =
seems=20
redundant to serialize a union.&nbsp; Worse than that in =
fact.&nbsp;=20
I.e., given these union features aren't changeable, =
serializing them=20
seems like a really bad idea...<BR><BR><BR>Marc-Florian =
Wendland=20
wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I =
think th=20
easiest way to reproduce this is to propagate the genmodel =
and ecore=20
files, isn't it? I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; =
schrieb im=20
Newsbeitrag <A =
href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this=20
problem.&nbsp; Could you share a test=20
case?<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00A6_01C9350C.CD769470--
Re: Using UML2 mechanism [message #477880 is a reply to message #477875] Fri, 24 October 2008 10:19 Go to previous message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

This is a multi-part message in MIME format.

------=_NextPart_000_01F4_01C935D2.CCEC43D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Kenn,

thank you for your detailled answer. I agree with your definition =
totally and will realize the allOwnedElements() method for the case, =
that anyone needs access to all directly or indirectly owned elements.

Have a nice day.
Marc-Florian
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> schrieb im Newsbeitrag =
news:gdq9hj$dam$1@build.eclipse.org...
It's a well-established convention (for better or worse) in the UML =
specification to use "foo" to refer to directly associated elements and =
"allFoo" to refer to a greater set of associated elements which takes a =
hierarchy (such as composition or generalization) into consideration...

In terms of subsets and unions, the semantics are (not surprisingly) =
vague on whether inclusion in the set is recursive, but given the above =
mentioned convention, we made the assumption that it shouldn't be =
(otherwise the definition of the allOwnedElements() operation would be =
redundant)...

Kenn
"Marc-Florian Wendland" <florianwendland@freenet.de> wrote in =
message news:gdl6si$47m$1@build.eclipse.org...
Dear James,
dear Ed,

the allOwnedElements is an option, that's right.=20
I just thought, that the content of the union ownedElements would =
include any element, that participate in that relationship via subset =
mechanism, in whatever hierarchy level they are defined. But the way it =
now works isn't so far from that, what i've expected. I've tried to add =
a containment relationship that doesn't participate in the ownedElement =
relationship and it wasn't selected, when i call getOwnedElements(). So =
far so good.

May be, i got a wrong imagination from the union/subsets mechanism.=20

Thanks=20
Marc-Florian
"James Bruck" <jbruck@ca.ibm.com> schrieb im Newsbeitrag =
news:gdkqbh$tk3$1@build.eclipse.org...
.. comments below ...
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdkh14$ms1$1@build.eclipse.org...
Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:=20
Dear Ed,

okay, that was a good point. 1-0 for you, as we say in =
Germany.=20
Darned, we're keeping score!

But, my point was also very good, because the elements, which =
i wanted to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P

Only the top level children of the root element are computed =
as "ownedElements". And i really think, that this missbehaviour is a =
result of using the wrong List for computing the subsets. I've attached =
a simple model, which illustrates this missbehaviour. Here it is with no =
overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is =
2. In uml2 philosophie, this should be 5, because every containment =
reference is defined as a subset of the ownedElements reference, hence, =
the references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned =
these concepts. I was hoping to live in ignorant bliss a little longer. =
:-P

=20
[James] Without a doubt, Kenn is the master of subsets and =
derived unions but in my humble opinion, calling getOwnedElements in the =
root model and retrieving 2 elements is fine. This can be considered =
all the "direct" owned elements. If you want all the direct and =
indirect elements a special query, allOwnedElements, is defined in the =
spec. see section 7.3.14 in the "Additional Operations" section.



Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the =
example, it seems redundant to serialize a union. Worse than that in =
fact. I.e., given these union features aren't changeable, serializing =
them seems like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to =
reproduce this is to propagate the genmodel and ecore files, isn't it? =
I've attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce =
this problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_000_01F4_01C935D2.CCEC43D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Kenn,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thank you for your detailled answer. I =
agree with=20
your definition totally and will realize the allOwnedElements() method =
for the=20
case, that anyone needs access to all directly or indirectly owned=20
elements.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Have a nice day.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Kenn Hussey" &lt;<A=20
=
href=3D"mailto:Kenn.Hussey@embarcadero.com">Kenn.Hussey@embarcadero.com</=
A>&gt;=20
schrieb im Newsbeitrag <A=20
=
href=3D"news:gdq9hj$dam$1@build.eclipse.org">news:gdq9hj$dam$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>It's a well-established convention =
(for better or=20
worse) in the UML specification to use "foo" to refer to directly =
associated=20
elements and "allFoo" to refer to a greater set of associated elements =
which=20
takes a hierarchy (such as composition or generalization) into=20
consideration...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In terms of subsets and unions, the =
semantics are=20
(not surprisingly) vague on whether inclusion in the set is recursive, =
but=20
given the above mentioned convention, we made the assumption that it =
shouldn't=20
be (otherwise the definition of the allOwnedElements() operation would =
be=20
redundant)...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Kenn</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Marc-Florian Wendland" &lt;<A=20
=
href=3D"mailto:florianwendland@freenet.de">florianwendland@freenet.de</A>=
&gt;=20
wrote in message <A=20
=
href=3D"news:gdl6si$47m$1@build.eclipse.org">news:gdl6si$47m$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Dear James,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dear&nbsp;Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>the allOwnedElements is an option, =
that's=20
right.&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I just thought, that the content of =
the union=20
ownedElements would include any element, that participate in that=20
relationship via subset mechanism, in whatever hierarchy level they =
are=20
defined. But the way it now works isn't so far from that, what i've=20
expected. I've tried to add a containment relationship that doesn't=20
participate in the ownedElement relationship and it wasn't selected, =
when i=20
call getOwnedElements(). So far so good.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>May be, i got a wrong imagination =
from the=20
union/subsets&nbsp;mechanism. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"James Bruck" &lt;<A=20
href=3D"mailto:jbruck@ca.ibm.com">jbruck@ca.ibm.com</A>&gt; =
schrieb im=20
Newsbeitrag <A=20
=
href=3D"news:gdkqbh$tk3$1@build.eclipse.org">news:gdkqbh$tk3$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>.. comments below =
....</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:gdkh14$ms1$1@build.eclipse.org">news:gdkh14$ms1$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Comments=20
below.<BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. =
1-0 for you,=20
as we say in Germany. </FONT></DIV></BLOCKQUOTE>Darned, we're =
keeping=20
score!<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>But, my point was also very =
good, because=20
the elements, which i wanted to be participating in the union, =
aren't=20
be computed correctly.</FONT></DIV></BLOCKQUOTE>I wouldn't =
know correct=20
if I saw it. :-P<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>Only the top level children =
of the root=20
element are computed as "ownedElements". And i really think, =
that this=20
missbehaviour is a result of using the wrong List for =
computing the=20
subsets. I've attached a simple model, which illustrates this=20
missbehaviour. Here it is with no overhead:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the =
references as=20
follows:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
owningModel(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
modeableElements(subsets ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB =
(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
theA(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC =
(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 =
(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements =
in the Root=20
model, the result is 2. In uml2 philosophie, this should be 5, =
because=20
every containment reference is defined as a subset of the=20
ownedElements reference, hence, the references should =
contribute=20
themself into the derived union relationship. But this isn't =
done...=20
and again, i think this relates to the choice of the generated =
lists.=20
But i'm really not sure. If i would know, why this approach =
fails, i=20
wouldn't post here :-)</FONT></DIV></BLOCKQUOTE>
<DIV>I think this require Kenn's attention because I've never =
learned=20
these concepts.&nbsp; I was hoping to live in ignorant bliss a =
little=20
longer. :-P</DIV>
<DIV><BR>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>[James]&nbsp;&nbsp; =
Witho</FONT><FONT=20
face=3DArial size=3D2>ut a doubt, Kenn is the master of =
subsets and=20
derived unions but in my humble opinion, calling =
getOwnedElements in=20
the root model and retrieving 2 elements is fine.&nbsp; This =
can be=20
considered all the "direct" owned elements. =
&nbsp;&nbsp;&nbsp;If you=20
want all the direct and indirect elements a special query,=20
<EM>allOwnedElements, </EM>&nbsp;is defined in the spec.&nbsp; =
see=20
section 7.3.14 in the "Additional Operations" =
section.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A href=3D"news:gdkedv$trt$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkedv$trt$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, =
it seems=20
redundant to serialize a union.&nbsp; Worse than that in =
fact.&nbsp;=20
I.e., given these union features aren't changeable, =
serializing them=20
seems like a really bad idea...<BR><BR><BR>Marc-Florian =
Wendland=20
wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I =
think th=20
easiest way to reproduce this is to propagate the genmodel =
and=20
ecore files, isn't it? I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; =
MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; =
schrieb im=20
Newsbeitrag <A =
href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this =

problem.&nbsp; Could you share a test=20
case?<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY ></HTML>

------=_NextPart_000_01F4_01C935D2.CCEC43D0--
Re: Using UML2 mechanism [message #627056 is a reply to message #477852] Tue, 21 October 2008 09:03 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel,
change the xmlns:genmodel's namespace to
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
"Reloading..." this model will continue to create the UML2 derived GenModel.


Marc-Florian Wendland wrote:
> Salute,
>
> i've a similar question as Timothy. I followed his discussions, and it seems
> that we want to do exactly the same at the same time... sometimes it is very
> mystical :)
> Back to business:
>
> I have an UML2 model with some union/subsets relationships and i want to
> realize these mechanisms in the resulting Ecore, like it is done in the
> wonderful UML2 project. I've introspected the uml2 sources but didn't found
> an hint how to include the UML2 generator instead of the ordinary EMF one,
> which doesn't care about union/subsets. Is there somewhere an article
> outthere, how to integrate this code generator?
>
> Any help would be appreciated.
>
> Marc-Florian
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using UML2 mechanism [message #627057 is a reply to message #477853] Tue, 21 October 2008 10:25 Go to previous message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

Dear Ed,

i've done this instincly by myself before. And i've explored the same
phenomenon like Timothy. It is possible to construct a model hierarchy with
the generated editor, but once you have serialized it and try to reopen it,
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce the
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
that's the problem, because all the elements, which are participating in the
Union-Relationship of the root element (like UML::Element) couldn't be
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple
model, because i have to solve this problem for my masterthesis... does
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
news:gdk5sb$3b2$1@build.eclipse.org...
> Marc-Florian,
>
> Here's what I would try as a simple "hack". Open the *.genmodel, change
> the xmlns:genmodel's namespace to
> http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
> "Reloading..." this model will continue to create the UML2 derived
> GenModel.
>
>
> Marc-Florian Wendland wrote:
>> Salute,
>>
>> i've a similar question as Timothy. I followed his discussions, and it
>> seems that we want to do exactly the same at the same time... sometimes
>> it is very mystical :)
>> Back to business:
>>
>> I have an UML2 model with some union/subsets relationships and i want to
>> realize these mechanisms in the resulting Ecore, like it is done in the
>> wonderful UML2 project. I've introspected the uml2 sources but didn't
>> found an hint how to include the UML2 generator instead of the ordinary
>> EMF one, which doesn't care about union/subsets. Is there somewhere an
>> article outthere, how to integrate this code generator?
>>
>> Any help would be appreciated.
>>
>> Marc-Florian
>>
>>
Re: Using UML2 mechanism [message #627058 is a reply to message #477854] Tue, 21 October 2008 10:46 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030107000009080307050307
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Marc-Florian,

It's likely that folks will want to be able to reproduce this problem.
Could you share a test case?


Marc-Florian Wendland wrote:
> Dear Ed,
>
> i've done this instincly by myself before. And i've explored the same
> phenomenon like Timothy. It is possible to construct a model hierarchy with
> the generated editor, but once you have serialized it and try to reopen it,
> it fails with the exception:
>
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> 'subset.test.impl.AImpl@192322e' is not legal.
> (platform:/resource/de/My2.test, -1, -1)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
> at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
> at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
> at
> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
> at
> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
> at
> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
> at
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
> at
> org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
> at
> org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
> at
> org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
> at
> org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
> at
> org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
> at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
> at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
> at
> org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
> at
> org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
> at
> org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
> at
> org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
> at
> org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
> at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
> at
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
> at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
> at
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
> at
> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
> at
> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
> at
> org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
> at
> org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
> at
> org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
> at
> org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
> at
> org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:880)
> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
> at
> org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
> at
> org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
> at
> org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
> at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
> at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
> at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
> 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(Main.java: 549)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> 'subset.test.impl.AImpl@192322e' is not legal.
> (platform:/resource/de/My2.test, -1, -1)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
> ... 79 more
> Caused by: java.lang.UnsupportedOperationException
> at
> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
> //cannot resolve the subsets?
> at java.util.AbstractSequentialList.add(Unknown Source)
> at
> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
> ... 95 more
>
> All the DerivedUnion-List are generated, but the genmodel didn't produce the
> SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
> that's the problem, because all the elements, which are participating in the
> Union-Relationship of the root element (like UML::Element) couldn't be
> computed, since the wrong List-type was selected.
>
> May be it is possible to send one member of the UML2 project this simple
> model, because i have to solve this problem for my masterthesis... does
> anyone of this project has the interest to solve this problem with me?
>
> Thanks for answering
> Marc-Florian
>
> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
> news:gdk5sb$3b2$1@build.eclipse.org...
>
>> Marc-Florian,
>>
>> Here's what I would try as a simple "hack". Open the *.genmodel, change
>> the xmlns:genmodel's namespace to
>> http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
>> "Reloading..." this model will continue to create the UML2 derived
>> GenModel.
>>
>>
>> Marc-Florian Wendland wrote:
>>
>>> Salute,
>>>
>>> i've a similar question as Timothy. I followed his discussions, and it
>>> seems that we want to do exactly the same at the same time... sometimes
>>> it is very mystical :)
>>> Back to business:
>>>
>>> I have an UML2 model with some union/subsets relationships and i want to
>>> realize these mechanisms in the resulting Ecore, like it is done in the
>>> wonderful UML2 project. I've introspected the uml2 sources but didn't
>>> found an hint how to include the UML2 generator instead of the ordinary
>>> EMF one, which doesn't care about union/subsets. Is there somewhere an
>>> article outthere, how to integrate this code generator?
>>>
>>> Any help would be appreciated.
>>>
>>> Marc-Florian
>>>
>>>
>>>
>
>
>

--------------030107000009080307050307
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Marc-Florian,<br>
<br>
It's likely that folks will want to be able to reproduce this problem.&nbsp;
Could you share a test case?<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkajc$kq1$1@build.eclipse.org" type="cite">
<pre wrap="">Dear Ed,

i've done this instincly by myself before. And i've explored the same
phenomenon like Timothy. It is possible to construct a model hierarchy with
the generated editor, but once you have serialized it and try to reopen it,
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce the
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
that's the problem, because all the elements, which are participating in the
Union-Relationship of the root element (like UML::Element) couldn't be
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple
model, because i have to solve this problem for my masterthesis... does
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext" href="news:gdk5sb$3b2$1@build.eclipse.org">news:gdk5sb$3b2$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, change
the xmlns:genmodel's namespace to
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/uml2/2.2.0/GenModel">http://www.eclipse.org/uml2/2.2.0/GenModel</a> and then see how it goes.
"Reloading..." this model will continue to create the UML2 derived
GenModel.


Marc-Florian Wendland wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Salute,

i've a similar question as Timothy. I followed his discussions, and it
seems that we want to do exactly the same at the same time... sometimes
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to
realize these mechanisms in the resulting Ecore, like it is done in the
wonderful UML2 project. I've introspected the uml2 sources but didn't
found an hint how to include the UML2 generator instead of the ordinary
EMF one, which doesn't care about union/subsets. Is there somewhere an
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</body>
</html>

--------------030107000009080307050307--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using UML2 mechanism [message #627059 is a reply to message #477855] Tue, 21 October 2008 10:54 Go to previous message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

This is a multi-part message in MIME format.

------=_NextPart_000_00D6_01C9337C.249F49F0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_00D7_01C9337C.249F49F0"


------=_NextPart_001_00D7_01C9337C.249F49F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Ed,

what kind of test case. I think th easiest way to reproduce this is to =
propagate the genmodel and ecore files, isn't it? I've attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce this problem. =
Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_001_00D7_01C9337C.249F49F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I think th =
easiest way to=20
reproduce this is to propagate the genmodel and ecore files, isn't it? =
I've=20
attached them.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A=20
=
href=3D"news:gdkbtd$vqh$1@build.eclipse.org">news:gdkbtd$vqh$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this =
problem.&nbsp; Could=20
you share a test case?<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</A> =
schrieb im Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org">news:gdk5sb$3b2$1@build.ecli=
pse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel">http://www.eclipse.or=
g/uml2/2.2.0/GenModel</A> and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

</PRE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_00D7_01C9337C.249F49F0--

------=_NextPart_000_00D6_01C9337C.249F49F0
Content-Type: application/octet-stream;
name="Ohne_Titel1.genmodel"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="Ohne_Titel1.genmodel"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<genmodel:GenModel xmi:version=3D"2.0"
xmlns:xmi=3D"http://www.omg.org/XMI" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore=3D"http://www.eclipse.org/emf/2002/Ecore" =
xmlns:genmodel=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
modelDirectory=3D"/x/src"
modelPluginID=3D"x" modelName=3D"Ohne_Titel1" =
importerID=3D"org.eclipse.uml2.uml.ecore.importer"
complianceLevel=3D"6.0" suppressGenModelAnnotations=3D"false" =
copyrightFields=3D"false"
factoryMethods=3D"true" pluralizedGetters=3D"true" =
cacheAdapterSupport=3D"true" invariantPrefix=3D"validate">
<genAnnotations =
source=3D" http://www.eclipse.org/emf/2002/GenModel/importer/org.eclips e.u=
ml2.uml.ecore.importer">
<details key=3D"ECORE_TAGGED_VALUES" value=3D"PROCESS"/>
<details key=3D"UNION_PROPERTIES" value=3D"PROCESS"/>
<details key=3D"DUPLICATE_FEATURES" value=3D"DISCARD"/>
<details key=3D"SUBSETTING_PROPERTIES" value=3D"PROCESS"/>
<details key=3D"COMMENTS" value=3D"PROCESS"/>
<details key=3D"DUPLICATE_FEATURE_INHERITANCE" value=3D"DISCARD"/>
<details key=3D"DUPLICATE_OPERATIONS" value=3D"DISCARD"/>
<details key=3D"INVARIANT_CONSTRAINTS" value=3D"PROCESS"/>
<details key=3D"REDEFINING_PROPERTIES" value=3D"PROCESS"/>
<details key=3D"ANNOTATION_DETAILS" value=3D"PROCESS"/>
<details key=3D"DUPLICATE_OPERATION_INHERITANCE" value=3D"DISCARD"/>
<details key=3D"REDEFINING_OPERATIONS" value=3D"PROCESS"/>
<details key=3D"DERIVED_FEATURES" value=3D"PROCESS"/>
<details key=3D"OPERATION_BODIES" value=3D"PROCESS"/>
<details key=3D"CAMEL_CASE_NAMES" value=3D"PROCESS"/>
<details key=3D"SUPER_CLASS_ORDER" value=3D"PROCESS"/>
</genAnnotations>
<foreignModel>../../t/model/x/Ohne_Titel1.uml</foreignModel >
<genPackages xsi:type=3D"genmodel:GenPackage" prefix=3D"Subset" =
disposableProviderFactory=3D"true"
ecorePackage=3D"subset.ecore#/">
<nestedGenPackages xsi:type=3D"genmodel:GenPackage" =
prefix=3D"UmlStandardProfile"
basePackage=3D"subset" disposableProviderFactory=3D"true" =
ecorePackage=3D"subset.ecore#//umlStandardProfile"/>
<nestedGenPackages xsi:type=3D"genmodel:GenPackage" prefix=3D"Test" =
basePackage=3D"subset"
disposableProviderFactory=3D"true" =
ecorePackage=3D"subset.ecore#//test">
<genClasses xsi:type=3D"genmodel:GenClass" =
ecoreClass=3D"subset.ecore#//test/ModelElement">
<genFeatures xsi:type=3D"genmodel:GenFeature" =
property=3D"Readonly" notify=3D"false"
createChild=3D"false" ecoreFeature=3D"ecore:EReference =
subset.ecore#//test/ModelElement/ownedElements"/>
<genFeatures xsi:type=3D"genmodel:GenFeature" =
property=3D"Readonly" notify=3D"false"
createChild=3D"false" ecoreFeature=3D"ecore:EReference =
subset.ecore#//test/ModelElement/owner"/>
</genClasses>
<genClasses xsi:type=3D"genmodel:GenClass" =
ecoreClass=3D"subset.ecore#//test/A">
<genFeatures xsi:type=3D"genmodel:GenFeature" property=3D"None" =
children=3D"true"
createChild=3D"true" ecoreFeature=3D"ecore:EReference =
subset.ecore#//test/A/theB"/>
</genClasses>
<genClasses xsi:type=3D"genmodel:GenClass" =
ecoreClass=3D"subset.ecore#//test/B">
<genFeatures xsi:type=3D"genmodel:GenFeature" property=3D"None" =
notify=3D"false"
createChild=3D"false" ecoreFeature=3D"ecore:EReference =
subset.ecore#//test/B/theA"/>
</genClasses>
<genClasses xsi:type=3D"genmodel:GenClass" =
ecoreClass=3D"subset.ecore#//test/C"/>
</nestedGenPackages>
</genPackages>
</genmodel:GenModel>

------=_NextPart_000_00D6_01C9337C.249F49F0
Content-Type: application/octet-stream;
name="subset.ecore"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="subset.ecore"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<ecore:EPackage xmi:version=3D"2.0"
xmlns:xmi=3D"http://www.omg.org/XMI" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore=3D"http://www.eclipse.org/emf/2002/Ecore" =
name=3D"subset"
nsURI=3D"http:///subset.ecore" nsPrefix=3D"subset">
<eAnnotations source=3D"http://www.eclipse.org/emf/2002/GenModel">
<details key=3D"documentation" =
value=3D"Author:mfw.&#xA;Created:19.10.08 =
22:22.&#xA;Title:.&#xA;Comment:.&#xA;"/>
</eAnnotations>
<eSubpackages name=3D"umlStandardProfile" =
nsURI=3D"http:///subset/umlStandardProfile.ecore"
nsPrefix=3D"subset.umlStandardProfile">
<eAnnotations source=3D"http://www.eclipse.org/emf/2002/GenModel">
<details key=3D"documentation" value=3D"UML Standard Profile =
contains several popular stereotypes, tag definitions and constraints =
described in UML 1.4 and UML 2.0 Specifications."/>
</eAnnotations>
</eSubpackages>
<eSubpackages name=3D"test" nsURI=3D"http:///subset/test.ecore" =
nsPrefix=3D"subset.test">
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" =
name=3D"ownedElements" ordered=3D"false"
upperBound=3D"-1" eType=3D"#//test/ModelElement" =
changeable=3D"false" volatile=3D"true"
derived=3D"true" eOpposite=3D"#//test/ModelElement/owner">
<eAnnotations source=3D"union"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"owner" =
ordered=3D"false"
eType=3D"#//test/ModelElement" changeable=3D"false" =
volatile=3D"true" derived=3D"true"
eOpposite=3D"#//test/ModelElement/ownedElements">
<eAnnotations source=3D"union"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"A2" =
eSuperTypes=3D"#//test/ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"theC2" =
eType=3D"#//test/C"
containment=3D"true">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/ownedElements"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"A" =
eSuperTypes=3D"#//test/ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"theB" =
ordered=3D"false"
upperBound=3D"-1" eType=3D"#//test/B" derived=3D"true" =
containment=3D"true" eOpposite=3D"#//test/B/theA">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/ownedElements"/>
</eStructuralFeatures>
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"theC" =
upperBound=3D"-1"
eType=3D"#//test/C" containment=3D"true">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/ownedElements"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"B" =
eSuperTypes=3D"#//test/ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" name=3D"theA" =
ordered=3D"false"
eType=3D"#//test/A" eOpposite=3D"#//test/A/theB">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/owner"/>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"C" =
eSuperTypes=3D"#//test/ModelElement"/>
<eClassifiers xsi:type=3D"ecore:EClass" name=3D"Model" =
eSuperTypes=3D"#//test/ModelElement">
<eStructuralFeatures xsi:type=3D"ecore:EReference" =
name=3D"modeableElements" upperBound=3D"-1"
eType=3D"#//test/ModelElement" containment=3D"true">
<eAnnotations source=3D"subsets" =
references=3D"#//test/ModelElement/ownedElements"/>
</eStructuralFeatures>
</eClassifiers>
</eSubpackages>
</ecore:EPackage>

------=_NextPart_000_00D6_01C9337C.249F49F0--
Re: Using UML2 mechanism [message #627060 is a reply to message #477856] Tue, 21 October 2008 11:29 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000400060400000206070308
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Marc-Florian,

Probably a union should be transient. Looking at the example, it seems
redundant to serialize a union. Worse than that in fact. I.e., given
these union features aren't changeable, serializing them seems like a
really bad idea...


Marc-Florian Wendland wrote:
> Ed,
>
> what kind of test case. I think th easiest way to reproduce this is to
> propagate the genmodel and ecore files, isn't it? I've attached them.
>
> Marc-Florian
>
> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
> schrieb im Newsbeitrag news:gdkbtd$vqh$1@build.eclipse.org...
> Marc-Florian,
>
> It's likely that folks will want to be able to reproduce this
> problem. Could you share a test case?
>
>
> Marc-Florian Wendland wrote:
>> Dear Ed,
>>
>> i've done this instincly by myself before. And i've explored the same
>> phenomenon like Timothy. It is possible to construct a model hierarchy with
>> the generated editor, but once you have serialized it and try to reopen it,
>> it fails with the exception:
>>
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>> 'subset.test.impl.AImpl@192322e' is not legal.
>> (platform:/resource/de/My2.test, -1, -1)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>> at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
>> at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
>> at
>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
>> at
>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>> at
>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
>> at
>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
>> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
>> at
>> org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
>> at
>> org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
>> at
>> org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
>> at
>> org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
>> at
>> org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
>> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
>> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
>> at
>> org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
>> at
>> org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
>> at
>> org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
>> at
>> org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
>> at
>> org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
>> at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
>> at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
>> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
>> at
>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
>> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
>> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
>> at
>> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
>> at
>> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
>> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
>> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
>> at
>> org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
>> at
>> org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
>> at
>> org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
>> at
>> org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
>> at
>> org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>> at org.eclipse.core.runtime.Platform.run(Platform.java:880)
>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
>> at
>> org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
>> at
>> org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
>> at
>> org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
>> at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
>> at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
>> at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>> at
>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
>> at
>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>> at
>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
>> at
>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>> 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(Main.java: 549)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
>> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>> 'subset.test.impl.AImpl@192322e' is not legal.
>> (platform:/resource/de/My2.test, -1, -1)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>> Source)
>> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>> Source)
>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>> ... 79 more
>> Caused by: java.lang.UnsupportedOperationException
>> at
>> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
>> //cannot resolve the subsets?
>> at java.util.AbstractSequentialList.add(Unknown Source)
>> at
>> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
>> ... 95 more
>>
>> All the DerivedUnion-List are generated, but the genmodel didn't produce the
>> SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
>> that's the problem, because all the elements, which are participating in the
>> Union-Relationship of the root element (like UML::Element) couldn't be
>> computed, since the wrong List-type was selected.
>>
>> May be it is possible to send one member of the UML2 project this simple
>> model, because i have to solve this problem for my masterthesis... does
>> anyone of this project has the interest to solve this problem with me?
>>
>> Thanks for answering
>> Marc-Florian
>>
>> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
>> news:gdk5sb$3b2$1@build.eclipse.org...
>>
>>> Marc-Florian,
>>>
>>> Here's what I would try as a simple "hack". Open the *.genmodel, change
>>> the xmlns:genmodel's namespace to
>>> http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
>>> "Reloading..." this model will continue to create the UML2 derived
>>> GenModel.
>>>
>>>
>>> Marc-Florian Wendland wrote:
>>>
>>>> Salute,
>>>>
>>>> i've a similar question as Timothy. I followed his discussions, and it
>>>> seems that we want to do exactly the same at the same time... sometimes
>>>> it is very mystical :)
>>>> Back to business:
>>>>
>>>> I have an UML2 model with some union/subsets relationships and i want to
>>>> realize these mechanisms in the resulting Ecore, like it is done in the
>>>> wonderful UML2 project. I've introspected the uml2 sources but didn't
>>>> found an hint how to include the UML2 generator instead of the ordinary
>>>> EMF one, which doesn't care about union/subsets. Is there somewhere an
>>>> article outthere, how to integrate this code generator?
>>>>
>>>> Any help would be appreciated.
>>>>
>>>> Marc-Florian
>>>>
>>>>
>>>>
>>
>>
>>
>

--------------000400060400000206070308
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Marc-Florian,<br>
<br>
Probably a union should be transient.&nbsp; Looking at the example, it seems
redundant to serialize a union.&nbsp; Worse than that in fact.&nbsp; I.e., given
these union features aren't changeable, serializing them seems like a
really bad idea...<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkc94$4qa$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2900.5659" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Ed,</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">what kind of test case. I think th
easiest way to reproduce this is to propagate the genmodel and ecore
files, isn't it? I've attached them.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Marc-Florian</font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a moz-do-not-send="true"
href="mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</a>&gt; schrieb im
Newsbeitrag <a moz-do-not-send="true"
href="news:gdkbtd$vqh$1@build.eclipse.org">news:gdkbtd$vqh$1@build.eclipse.org</a>...</div>
Marc-Florian,<br>
<br>
It's likely that folks will want to be able to reproduce this problem.&nbsp;
Could you share a test case?<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkajc$kq1$1@build.eclipse.org" type="cite">
<pre wrap="">Dear Ed,

i've done this instincly by myself before. And i've explored the same
phenomenon like Timothy. It is possible to construct a model hierarchy with
the generated editor, but once you have serialized it and try to reopen it,
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce the
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
that's the problem, because all the elements, which are participating in the
Union-Relationship of the root element (like UML::Element) couldn't be
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple
model, because i have to solve this problem for my masterthesis... does
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</a> schrieb im Newsbeitrag
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="news:gdk5sb$3b2$1@build.eclipse.org">news:gdk5sb$3b2$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, change
the xmlns:genmodel's namespace to
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.eclipse.org/uml2/2.2.0/GenModel">http://www.eclipse.org/uml2/2.2.0/GenModel</a> and then see how it goes.
"Reloading..." this model will continue to create the UML2 derived
GenModel.


Marc-Florian Wendland wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Salute,

i've a similar question as Timothy. I followed his discussions, and it
seems that we want to do exactly the same at the same time... sometimes
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to
realize these mechanisms in the resulting Ecore, like it is done in the
wonderful UML2 project. I've introspected the uml2 sources but didn't
found an hint how to include the UML2 generator instead of the ordinary
EMF one, which doesn't care about union/subsets. Is there somewhere an
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>

--------------000400060400000206070308--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using UML2 mechanism [message #627061 is a reply to message #477857] Tue, 21 October 2008 12:06 Go to previous message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

This is a multi-part message in MIME format.

------=_NextPart_000_0105_01C93386.32386240
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0106_01C93386.32386240"


------=_NextPart_001_0106_01C93386.32386240
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Ed,

okay, that was a good point. 1-0 for you, as we say in Germany. But, my =
point was also very good, because the elements, which i wanted to be =
participating in the union, aren't be computed correctly. Only the top =
level children of the root element are computed as "ownedElements". And =
i really think, that this missbehaviour is a result of using the wrong =
List for computing the subsets. I've attached a simple model, which =
illustrates this missbehaviour. Here it is with no overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is 2. In uml2 =
philosophie, this should be 5, because every containment reference is =
defined as a subset of the ownedElements reference, hence, the =
references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the example, it =
seems redundant to serialize a union. Worse than that in fact. I.e., =
given these union features aren't changeable, serializing them seems =
like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to reproduce this is =
to propagate the genmodel and ecore files, isn't it? I've attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce this =
problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_001_0106_01C93386.32386240
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. 1-0 for =
you, as we say=20
in Germany. But, my point was also very good, because the elements, =
which i=20
wanted to be participating in the union, aren't be computed correctly. =
Only the=20
top level children of the root element are computed as "ownedElements". =
And i=20
really think, that this missbehaviour is a result of using the wrong =
List for=20
computing the subsets. I've attached a simple model, which illustrates =
this=20
missbehaviour. Here it is with no overhead:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the references =
as=20
follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner =
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owningModel(subsets=20
owner)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
modeableElements(subsets=20
ownedElements)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB (subsets=20
ownedElements)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA(subsets =
owner)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC (subsets=20
ownedElements)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 (subsets=20
owner)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements in the =
Root model, the=20
result is 2. In uml2 philosophie, this should be 5, because every =
containment=20
reference is defined as a subset of the ownedElements reference, hence, =
the=20
references should contribute themself into the derived union =
relationship. But=20
this isn't done... and again, i think this relates to the choice of the=20
generated lists. But i'm really not sure. If i would know, why this =
approach=20
fails, i wouldn't post here :-)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A=20
=
href=3D"news:gdkedv$trt$1@build.eclipse.org">news:gdkedv$trt$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, it seems =
redundant=20
to serialize a union.&nbsp; Worse than that in fact.&nbsp; I.e., given =
these=20
union features aren't changeable, serializing them seems like a really =
bad=20
idea...<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I think th =
easiest way=20
to reproduce this is to propagate the genmodel and ecore files, =
isn't it?=20
I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =
Newsbeitrag=20
<A href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this =
problem.&nbsp;=20
Could you share a test case?<BR><BR><BR>Marc-Florian Wendland =
wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BODY></HTML>

------=_NextPart_001_0106_01C93386.32386240--

------=_NextPart_000_0105_01C93386.32386240
Content-Type: application/octet-stream;
name="My3.test"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="My3.test"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<subset.test:Model xmi:version=3D"2.0" =
xmlns:xmi=3D"http://www.omg.org/XMI" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:subset.test=3D"http:///subset/test.ecore">
<modeableElements xsi:type=3D"subset.test:A">
<theB/>
<theB/>
</modeableElements>
<modeableElements xsi:type=3D"subset.test:A2">
<theC2/>
</modeableElements>
</subset.test:Model>

------=_NextPart_000_0105_01C93386.32386240--
Re: Using UML2 mechanism [message #627062 is a reply to message #477858] Tue, 21 October 2008 12:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080309010204070903070403
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:
> Dear Ed,
>
> okay, that was a good point. 1-0 for you, as we say in Germany.
Darned, we're keeping score!
> But, my point was also very good, because the elements, which i wanted
> to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P
> Only the top level children of the root element are computed as
> "ownedElements". And i really think, that this missbehaviour is a
> result of using the wrong List for computing the subsets. I've
> attached a simple model, which illustrates this missbehaviour. Here it
> is with no overhead:
>
> Root
> A
> B
> B
> A2
> C
>
> while metamodel defines the references as follows:
>
> Element
> ownedElements (union)
> owner (union)
> owningModel(subsets owner)
>
> Root : Element
> modeableElements(subsets ownedElements)
>
> A:Element
> theB (subsets ownedElements)
>
> B:Element
> theA(subsets owner)
>
> A2:Element
> theC (subsets ownedElements)
>
> C:Element
> theA2 (subsets owner)
>
> When i call getOwnedElements in the Root model, the result is 2. In
> uml2 philosophie, this should be 5, because every containment
> reference is defined as a subset of the ownedElements reference,
> hence, the references should contribute themself into the derived
> union relationship. But this isn't done... and again, i think this
> relates to the choice of the generated lists. But i'm really not sure.
> If i would know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned these
concepts. I was hoping to live in ignorant bliss a little longer. :-P
>
> Marc-Florian
>
> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
> schrieb im Newsbeitrag news:gdkedv$trt$1@build.eclipse.org...
> Marc-Florian,
>
> Probably a union should be transient. Looking at the example, it
> seems redundant to serialize a union. Worse than that in fact.
> I.e., given these union features aren't changeable, serializing
> them seems like a really bad idea...
>
>
> Marc-Florian Wendland wrote:
>> Ed,
>>
>> what kind of test case. I think th easiest way to reproduce this
>> is to propagate the genmodel and ecore files, isn't it? I've
>> attached them.
>>
>> Marc-Florian
>>
>> "Ed Merks" <Ed.Merks@gmail.com <mailto:Ed.Merks@gmail.com>>
>> schrieb im Newsbeitrag news:gdkbtd$vqh$1@build.eclipse.org...
>> Marc-Florian,
>>
>> It's likely that folks will want to be able to reproduce this
>> problem. Could you share a test case?
>>
>>
>> Marc-Florian Wendland wrote:
>>> Dear Ed,
>>>
>>> i've done this instincly by myself before. And i've explored the same
>>> phenomenon like Timothy. It is possible to construct a model hierarchy with
>>> the generated editor, but once you have serialized it and try to reopen it,
>>> it fails with the exception:
>>>
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>> 'subset.test.impl.AImpl@192322e' is not legal.
>>> (platform:/resource/de/My2.test, -1, -1)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>> at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
>>> at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
>>> at
>>> org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
>>> at
>>> org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
>>> at
>>> org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
>>> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
>>> at
>>> org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
>>> at
>>> org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
>>> at
>>> org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
>>> at
>>> org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
>>> at
>>> org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
>>> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
>>> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
>>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
>>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
>>> at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
>>> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
>>> at
>>> org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
>>> at
>>> org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
>>> at
>>> org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
>>> at
>>> org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
>>> at
>>> org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
>>> at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
>>> at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
>>> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
>>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
>>> at
>>> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
>>> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
>>> at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
>>> at
>>> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
>>> at
>>> org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
>>> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
>>> at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
>>> at
>>> org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
>>> at
>>> org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
>>> at
>>> org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
>>> at
>>> org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>> at org.eclipse.core.runtime.Platform.run(Platform.java:880)
>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
>>> at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
>>> at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
>>> at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
>>> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
>>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
>>> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
>>> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
>>> at
>>> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
>>> at
>>> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
>>> at
>>> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
>>> 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(Main.java: 549)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
>>> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
>>> 'subset.test.impl.AImpl@192322e' is not legal.
>>> (platform:/resource/de/My2.test, -1, -1)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>> Source)
>>> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>> Source)
>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>> ... 79 more
>>> Caused by: java.lang.UnsupportedOperationException
>>> at
>>> org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
>>> //cannot resolve the subsets?
>>> at java.util.AbstractSequentialList.add(Unknown Source)
>>> at
>>> org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
>>> ... 95 more
>>>
>>> All the DerivedUnion-List are generated, but the genmodel didn't produce the
>>> SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
>>> that's the problem, because all the elements, which are participating in the
>>> Union-Relationship of the root element (like UML::Element) couldn't be
>>> computed, since the wrong List-type was selected.
>>>
>>> May be it is possible to send one member of the UML2 project this simple
>>> model, because i have to solve this problem for my masterthesis... does
>>> anyone of this project has the interest to solve this problem with me?
>>>
>>> Thanks for answering
>>> Marc-Florian
>>>
>>> "Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag
>>> news:gdk5sb$3b2$1@build.eclipse.org...
>>>
>>>> Marc-Florian,
>>>>
>>>> Here's what I would try as a simple "hack". Open the *.genmodel, change
>>>> the xmlns:genmodel's namespace to
>>>> http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.
>>>> "Reloading..." this model will continue to create the UML2 derived
>>>> GenModel.
>>>>
>>>>
>>>> Marc-Florian Wendland wrote:
>>>>
>>>>> Salute,
>>>>>
>>>>> i've a similar question as Timothy. I followed his discussions, and it
>>>>> seems that we want to do exactly the same at the same time... sometimes
>>>>> it is very mystical :)
>>>>> Back to business:
>>>>>
>>>>> I have an UML2 model with some union/subsets relationships and i want to
>>>>> realize these mechanisms in the resulting Ecore, like it is done in the
>>>>> wonderful UML2 project. I've introspected the uml2 sources but didn't
>>>>> found an hint how to include the UML2 generator instead of the ordinary
>>>>> EMF one, which doesn't care about union/subsets. Is there somewhere an
>>>>> article outthere, how to integrate this code generator?
>>>>>
>>>>> Any help would be appreciated.
>>>>>
>>>>> Marc-Florian
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>

--------------080309010204070903070403
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Marc-Florian,<br>
<br>
Comments below.<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkgfp$i3d$1@build.eclipse.org" type="cite">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2900.5659" name="GENERATOR">
<div><font face="Arial" size="2">Dear Ed,</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">okay, that was a good point. 1-0 for
you, as we say in Germany. </font></div>
</blockquote>
Darned, we're keeping score!<br>
<blockquote cite="mid:gdkgfp$i3d$1@build.eclipse.org" type="cite">
<div><font face="Arial" size="2">But, my point was also very good,
because the elements, which i wanted to be participating in the union,
aren't be computed correctly.</font></div>
</blockquote>
I wouldn't know correct if I saw it. :-P<br>
<blockquote cite="mid:gdkgfp$i3d$1@build.eclipse.org" type="cite">
<div><font face="Arial" size="2"> Only the top level children of the
root element are computed as "ownedElements". And i really think, that
this missbehaviour is a result of using the wrong List for computing
the subsets. I've attached a simple model, which illustrates this
missbehaviour. Here it is with no overhead:</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Root</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; A</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; B</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; B</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; A2</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; C</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">while metamodel defines the
references as follows:</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; ownedElements (union)</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; owner (union)</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; owningModel(subsets owner)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Root : Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; modeableElements(subsets
ownedElements)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">A:Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; theB (subsets ownedElements)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">B:Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; theA(subsets owner)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">A2:Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; theC (subsets ownedElements)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">C:Element</font></div>
<div><font face="Arial" size="2">&nbsp;&nbsp;&nbsp; theA2 (subsets owner)</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">When i call getOwnedElements in the
Root model, the result is 2. In uml2 philosophie, this should be 5,
because every containment reference is defined as a subset of the
ownedElements reference, hence, the references should contribute
themself into the derived union relationship. But this isn't done...
and again, i think this relates to the choice of the generated lists.
But i'm really not sure. If i would know, why this approach fails, i
wouldn't post here :-)</font></div>
</blockquote>
I think this require Kenn's attention because I've never learned these
concepts.&nbsp; I was hoping to live in ignorant bliss a little longer. :-P<br>
<blockquote cite="mid:gdkgfp$i3d$1@build.eclipse.org" type="cite">
<div>&nbsp;</div>
<div><font face="Arial" size="2">Marc-Florian</font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a moz-do-not-send="true"
href="mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</a>&gt; schrieb im
Newsbeitrag <a moz-do-not-send="true"
href="news:gdkedv$trt$1@build.eclipse.org">news:gdkedv$trt$1@build.eclipse.org</a>...</div>
Marc-Florian,<br>
<br>
Probably a union should be transient.&nbsp; Looking at the example, it seems
redundant to serialize a union.&nbsp; Worse than that in fact.&nbsp; I.e., given
these union features aren't changeable, serializing them seems like a
really bad idea...<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkc94$4qa$1@build.eclipse.org" type="cite">
<meta content="MSHTML 6.00.2900.5659" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Ed,</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">what kind of test case. I think
th easiest way to reproduce this is to propagate the genmodel and ecore
files, isn't it? I've attached them.</font></div>
<div>&nbsp;</div>
<div><font face="Arial" size="2">Marc-Florian</font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a href="mailto:Ed.Merks@gmail.com"
moz-do-not-send="true">Ed.Merks@gmail.com</a>&gt; schrieb im
Newsbeitrag <a href="news:gdkbtd$vqh$1@build.eclipse.org"
moz-do-not-send="true">news:gdkbtd$vqh$1@build.eclipse.org</a>...</div>
Marc-Florian,<br>
<br>
It's likely that folks will want to be able to reproduce this problem.&nbsp;
Could you share a test case?<br>
<br>
<br>
Marc-Florian Wendland wrote:
<blockquote cite="mid:gdkajc$kq1$1@build.eclipse.org"
type="cite">
<pre wrap="">Dear Ed,

i've done this instincly by myself before. And i've explored the same
phenomenon like Timothy. It is possible to construct a model hierarchy with
the generated editor, but once you have serialized it and try to reopen it,
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:310)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:428)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:217)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:207)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:779)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:678)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2817)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:318)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorUtility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:274)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handleOpen(PackageExplorerActionGroup.java:363)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(PackageExplorerPart.java:603)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java:818)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.java:1079)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
'subset.test.impl.AImpl@192322e' is not legal.
(platform:/resource/de/My2.test, -1, -1)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2647)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHandler.java:1135)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:1214)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(DerivedEObjectEList.java:278)
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObjectEList.java:636)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1192)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce the
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,
that's the problem, because all the elements, which are participating in the
Union-Relationship of the root element (like UML::Element) couldn't be
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple
model, because i have to solve this problem for my masterthesis... does
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <a class="moz-txt-link-rfc2396E"
href="mailto:Ed.Merks@gmail.com" moz-do-not-send="true">&lt;Ed.Merks@gmail.com&gt;</a> schrieb im Newsbeitrag
<a class="moz-txt-link-freetext"
href="news:gdk5sb$3b2$1@build.eclipse.org" moz-do-not-send="true">news:gdk5sb$3b2$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, change
the xmlns:genmodel's namespace to
<a class="moz-txt-link-freetext"
href="http://www.eclipse.org/uml2/2.2.0/GenModel"
moz-do-not-send="true">http://www.eclipse.org/uml2/2.2.0/GenModel</a> and then see how it goes.
"Reloading..." this model will continue to create the UML2 derived
GenModel.


Marc-Florian Wendland wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Salute,

i've a similar question as Timothy. I followed his discussions, and it
seems that we want to do exactly the same at the same time... sometimes
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to
realize these mechanisms in the resulting Ecore, like it is done in the
wonderful UML2 project. I've introspected the uml2 sources but didn't
found an hint how to include the UML2 generator instead of the ordinary
EMF one, which doesn't care about union/subsets. Is there somewhere an
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>

--------------080309010204070903070403--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using UML2 mechanism [message #627063 is a reply to message #477859] Tue, 21 October 2008 14:54 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_003B_01C9336B.57CFE750
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

... comments below ...
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdkh14$ms1$1@build.eclipse.org...
Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:=20
Dear Ed,

okay, that was a good point. 1-0 for you, as we say in Germany.=20
Darned, we're keeping score!

But, my point was also very good, because the elements, which i =
wanted to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P

Only the top level children of the root element are computed as =
"ownedElements". And i really think, that this missbehaviour is a result =
of using the wrong List for computing the subsets. I've attached a =
simple model, which illustrates this missbehaviour. Here it is with no =
overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is 2. In =
uml2 philosophie, this should be 5, because every containment reference =
is defined as a subset of the ownedElements reference, hence, the =
references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned these =
concepts. I was hoping to live in ignorant bliss a little longer. :-P


[James] Without a doubt, Kenn is the master of subsets and derived =
unions but in my humble opinion, calling getOwnedElements in the root =
model and retrieving 2 elements is fine. This can be considered all the =
"direct" owned elements. If you want all the direct and indirect =
elements a special query, allOwnedElements, is defined in the spec. =
see section 7.3.14 in the "Additional Operations" section.



Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the example, it =
seems redundant to serialize a union. Worse than that in fact. I.e., =
given these union features aren't changeable, serializing them seems =
like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to reproduce this =
is to propagate the genmodel and ecore files, isn't it? I've attached =
them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce this =
problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_000_003B_01C9336B.57CFE750
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.3395" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>.. comments below ...</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote in =
message=20
<A=20
=
href=3D"news:gdkh14$ms1$1@build.eclipse.org">news:gdkh14$ms1$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Comments=20
below.<BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. 1-0 =
for you, as we=20
say in Germany. </FONT></DIV></BLOCKQUOTE>Darned, we're keeping =
score!<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>But, my point was also very good, =
because the=20
elements, which i wanted to be participating in the union, aren't be =

computed correctly.</FONT></DIV></BLOCKQUOTE>I wouldn't know correct =
if I saw=20
it. :-P<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>Only the top level children of the =
root element=20
are computed as "ownedElements". And i really think, that this =
missbehaviour=20
is a result of using the wrong List for computing the subsets. I've =
attached=20
a simple model, which illustrates this missbehaviour. Here it is =
with no=20
overhead:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the =
references as=20
follows:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner =
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
owningModel(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
modeableElements(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB (subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC (subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 (subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements in the =
Root model,=20
the result is 2. In uml2 philosophie, this should be 5, because =
every=20
containment reference is defined as a subset of the ownedElements =
reference,=20
hence, the references should contribute themself into the derived =
union=20
relationship. But this isn't done... and again, i think this relates =
to the=20
choice of the generated lists. But i'm really not sure. If i would =
know, why=20
this approach fails, i wouldn't post here =
:-)</FONT></DIV></BLOCKQUOTE>
<DIV>I think this require Kenn's attention because I've never learned =
these=20
concepts.&nbsp; I was hoping to live in ignorant bliss a little =
longer.=20
:-P</DIV>
<DIV><BR>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>[James]&nbsp;&nbsp; =
Witho</FONT><FONT=20
face=3DArial size=3D2>ut a doubt, Kenn is the master of subsets and =
derived=20
unions but in my humble opinion, calling getOwnedElements in the =
root model=20
and retrieving 2 elements is fine.&nbsp; This can be considered all =
the=20
"direct" owned elements. &nbsp;&nbsp;&nbsp;If you want all the =
direct and=20
indirect elements a special query, <EM>allOwnedElements, =
</EM>&nbsp;is=20
defined in the spec.&nbsp; see section 7.3.14 in the "Additional =
Operations"=20
section.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =
Newsbeitrag=20
<A href=3D"news:gdkedv$trt$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkedv$trt$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, it =
seems=20
redundant to serialize a union.&nbsp; Worse than that in =
fact.&nbsp; I.e.,=20
given these union features aren't changeable, serializing them =
seems like=20
a really bad idea...<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I think =
th easiest=20
way to reproduce this is to propagate the genmodel and ecore =
files,=20
isn't it? I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =

Newsbeitrag <A href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this=20
problem.&nbsp; Could you share a test =
case?<BR><BR><BR>Marc-Florian=20
Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_003B_01C9336B.57CFE750--
Re: Using UML2 mechanism [message #627065 is a reply to message #477860] Tue, 21 October 2008 18:28 Go to previous message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

This is a multi-part message in MIME format.

------=_NextPart_000_0052_01C933BB.994819F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear James,
dear Ed,

the allOwnedElements is an option, that's right.=20
I just thought, that the content of the union ownedElements would =
include any element, that participate in that relationship via subset =
mechanism, in whatever hierarchy level they are defined. But the way it =
now works isn't so far from that, what i've expected. I've tried to add =
a containment relationship that doesn't participate in the ownedElement =
relationship and it wasn't selected, when i call getOwnedElements(). So =
far so good.

May be, i got a wrong imagination from the union/subsets mechanism.=20

Thanks=20
Marc-Florian
"James Bruck" <jbruck@ca.ibm.com> schrieb im Newsbeitrag =
news:gdkqbh$tk3$1@build.eclipse.org...
.. comments below ...
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdkh14$ms1$1@build.eclipse.org...
Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:=20
Dear Ed,

okay, that was a good point. 1-0 for you, as we say in Germany.=20
Darned, we're keeping score!

But, my point was also very good, because the elements, which i =
wanted to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P

Only the top level children of the root element are computed as =
"ownedElements". And i really think, that this missbehaviour is a result =
of using the wrong List for computing the subsets. I've attached a =
simple model, which illustrates this missbehaviour. Here it is with no =
overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is 2. =
In uml2 philosophie, this should be 5, because every containment =
reference is defined as a subset of the ownedElements reference, hence, =
the references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned =
these concepts. I was hoping to live in ignorant bliss a little longer. =
:-P

=20
[James] Without a doubt, Kenn is the master of subsets and =
derived unions but in my humble opinion, calling getOwnedElements in the =
root model and retrieving 2 elements is fine. This can be considered =
all the "direct" owned elements. If you want all the direct and =
indirect elements a special query, allOwnedElements, is defined in the =
spec. see section 7.3.14 in the "Additional Operations" section.



Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the example, =
it seems redundant to serialize a union. Worse than that in fact. =
I.e., given these union features aren't changeable, serializing them =
seems like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to reproduce =
this is to propagate the genmodel and ecore files, isn't it? I've =
attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce =
this problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_000_0052_01C933BB.994819F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear James,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dear&nbsp;Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>the allOwnedElements is an option, =
that's=20
right.&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I just thought, that the content of the =
union=20
ownedElements would include any element, that participate in that =
relationship=20
via subset mechanism, in whatever hierarchy level they are defined. But =
the way=20
it now works isn't so far from that, what i've expected. I've tried to =
add a=20
containment relationship that doesn't participate in the ownedElement=20
relationship and it wasn't selected, when i call getOwnedElements(). So =
far so=20
good.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>May be, i got a wrong imagination from =
the=20
union/subsets&nbsp;mechanism. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"James Bruck" &lt;<A=20
href=3D"mailto:jbruck@ca.ibm.com">jbruck@ca.ibm.com</A>&gt; schrieb im =

Newsbeitrag <A=20
=
href=3D"news:gdkqbh$tk3$1@build.eclipse.org">news:gdkqbh$tk3$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>.. comments below ...</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:gdkh14$ms1$1@build.eclipse.org">news:gdkh14$ms1$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Comments=20
below.<BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. 1-0 =
for you, as=20
we say in Germany. </FONT></DIV></BLOCKQUOTE>Darned, we're keeping =

score!<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>But, my point was also very good, =
because the=20
elements, which i wanted to be participating in the union, aren't =
be=20
computed correctly.</FONT></DIV></BLOCKQUOTE>I wouldn't know =
correct if I=20
saw it. :-P<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>Only the top level children of =
the root=20
element are computed as "ownedElements". And i really think, that =
this=20
missbehaviour is a result of using the wrong List for computing =
the=20
subsets. I've attached a simple model, which illustrates this=20
missbehaviour. Here it is with no overhead:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the =
references as=20
follows:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner =
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
owningModel(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
modeableElements(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB (subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC (subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 (subsets =

owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements in =
the Root=20
model, the result is 2. In uml2 philosophie, this should be 5, =
because=20
every containment reference is defined as a subset of the =
ownedElements=20
reference, hence, the references should contribute themself into =
the=20
derived union relationship. But this isn't done... and again, i =
think this=20
relates to the choice of the generated lists. But i'm really not =
sure. If=20
i would know, why this approach fails, i wouldn't post here=20
:-)</FONT></DIV></BLOCKQUOTE>
<DIV>I think this require Kenn's attention because I've never =
learned these=20
concepts.&nbsp; I was hoping to live in ignorant bliss a little =
longer.=20
:-P</DIV>
<DIV><BR>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org type=3D"cite">
<DIV><FONT face=3DArial size=3D2>[James]&nbsp;&nbsp; =
Witho</FONT><FONT=20
face=3DArial size=3D2>ut a doubt, Kenn is the master of subsets =
and derived=20
unions but in my humble opinion, calling getOwnedElements in the =
root=20
model and retrieving 2 elements is fine.&nbsp; This can be =
considered all=20
the "direct" owned elements. &nbsp;&nbsp;&nbsp;If you want all the =
direct=20
and indirect elements a special query, <EM>allOwnedElements, =
</EM>&nbsp;is=20
defined in the spec.&nbsp; see section 7.3.14 in the "Additional=20
Operations" section.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =
Newsbeitrag=20
<A href=3D"news:gdkedv$trt$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkedv$trt$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, it =
seems=20
redundant to serialize a union.&nbsp; Worse than that in =
fact.&nbsp;=20
I.e., given these union features aren't changeable, serializing =
them=20
seems like a really bad idea...<BR><BR><BR>Marc-Florian Wendland =
wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I =
think th=20
easiest way to reproduce this is to propagate the genmodel and =
ecore=20
files, isn't it? I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this=20
problem.&nbsp; Could you share a test =
case?<BR><BR><BR>Marc-Florian=20
Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0052_01C933BB.994819F0--
Re: Using UML2 mechanism [message #627075 is a reply to message #477862] Thu, 23 October 2008 16:42 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_00A6_01C9350C.CD769470
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

It's a well-established convention (for better or worse) in the UML =
specification to use "foo" to refer to directly associated elements and =
"allFoo" to refer to a greater set of associated elements which takes a =
hierarchy (such as composition or generalization) into consideration...

In terms of subsets and unions, the semantics are (not surprisingly) =
vague on whether inclusion in the set is recursive, but given the above =
mentioned convention, we made the assumption that it shouldn't be =
(otherwise the definition of the allOwnedElements() operation would be =
redundant)...

Kenn
"Marc-Florian Wendland" <florianwendland@freenet.de> wrote in message =
news:gdl6si$47m$1@build.eclipse.org...
Dear James,
dear Ed,

the allOwnedElements is an option, that's right.=20
I just thought, that the content of the union ownedElements would =
include any element, that participate in that relationship via subset =
mechanism, in whatever hierarchy level they are defined. But the way it =
now works isn't so far from that, what i've expected. I've tried to add =
a containment relationship that doesn't participate in the ownedElement =
relationship and it wasn't selected, when i call getOwnedElements(). So =
far so good.

May be, i got a wrong imagination from the union/subsets mechanism.=20

Thanks=20
Marc-Florian
"James Bruck" <jbruck@ca.ibm.com> schrieb im Newsbeitrag =
news:gdkqbh$tk3$1@build.eclipse.org...
.. comments below ...
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdkh14$ms1$1@build.eclipse.org...
Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:=20
Dear Ed,

okay, that was a good point. 1-0 for you, as we say in Germany.=20
Darned, we're keeping score!

But, my point was also very good, because the elements, which i =
wanted to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P

Only the top level children of the root element are computed as =
"ownedElements". And i really think, that this missbehaviour is a result =
of using the wrong List for computing the subsets. I've attached a =
simple model, which illustrates this missbehaviour. Here it is with no =
overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is 2. =
In uml2 philosophie, this should be 5, because every containment =
reference is defined as a subset of the ownedElements reference, hence, =
the references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned =
these concepts. I was hoping to live in ignorant bliss a little longer. =
:-P

=20
[James] Without a doubt, Kenn is the master of subsets and =
derived unions but in my humble opinion, calling getOwnedElements in the =
root model and retrieving 2 elements is fine. This can be considered =
all the "direct" owned elements. If you want all the direct and =
indirect elements a special query, allOwnedElements, is defined in the =
spec. see section 7.3.14 in the "Additional Operations" section.



Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the example, =
it seems redundant to serialize a union. Worse than that in fact. =
I.e., given these union features aren't changeable, serializing them =
seems like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to reproduce =
this is to propagate the genmodel and ecore files, isn't it? I've =
attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce =
this problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_000_00A6_01C9350C.CD769470
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16705" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>It's a well-established convention (for =
better or=20
worse) in the UML specification to use "foo" to refer to directly =
associated=20
elements and "allFoo" to refer to a greater set of associated elements =
which=20
takes a hierarchy (such as composition or generalization) into=20
consideration...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In terms of subsets and unions, the =
semantics are=20
(not surprisingly) vague on whether inclusion in the set is recursive, =
but given=20
the above mentioned convention, we made the assumption that it shouldn't =
be=20
(otherwise the definition of the allOwnedElements() operation would be=20
redundant)...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Kenn</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Marc-Florian Wendland" &lt;<A=20
=
href=3D"mailto:florianwendland@freenet.de">florianwendland@freenet.de</A>=
&gt;=20
wrote in message <A=20
=
href=3D"news:gdl6si$47m$1@build.eclipse.org">news:gdl6si$47m$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Dear James,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dear&nbsp;Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>the allOwnedElements is an option, =
that's=20
right.&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I just thought, that the content of =
the union=20
ownedElements would include any element, that participate in that =
relationship=20
via subset mechanism, in whatever hierarchy level they are defined. =
But the=20
way it now works isn't so far from that, what i've expected. I've =
tried to add=20
a containment relationship that doesn't participate in the =
ownedElement=20
relationship and it wasn't selected, when i call getOwnedElements(). =
So far so=20
good.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>May be, i got a wrong imagination =
from the=20
union/subsets&nbsp;mechanism. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"James Bruck" &lt;<A=20
href=3D"mailto:jbruck@ca.ibm.com">jbruck@ca.ibm.com</A>&gt; schrieb =
im=20
Newsbeitrag <A=20
=
href=3D"news:gdkqbh$tk3$1@build.eclipse.org">news:gdkqbh$tk3$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>.. comments below ...</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:gdkh14$ms1$1@build.eclipse.org">news:gdkh14$ms1$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Comments=20
below.<BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. =
1-0 for you,=20
as we say in Germany. </FONT></DIV></BLOCKQUOTE>Darned, we're =
keeping=20
score!<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>But, my point was also very =
good, because=20
the elements, which i wanted to be participating in the union, =
aren't be=20
computed correctly.</FONT></DIV></BLOCKQUOTE>I wouldn't know =
correct if I=20
saw it. :-P<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>Only the top level children of =
the root=20
element are computed as "ownedElements". And i really think, =
that this=20
missbehaviour is a result of using the wrong List for computing =
the=20
subsets. I've attached a simple model, which illustrates this=20
missbehaviour. Here it is with no overhead:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the =
references as=20
follows:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
owningModel(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
modeableElements(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB =
(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA(subsets =

owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC =
(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 =
(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements in =
the Root=20
model, the result is 2. In uml2 philosophie, this should be 5, =
because=20
every containment reference is defined as a subset of the =
ownedElements=20
reference, hence, the references should contribute themself into =
the=20
derived union relationship. But this isn't done... and again, i =
think=20
this relates to the choice of the generated lists. But i'm =
really not=20
sure. If i would know, why this approach fails, i wouldn't post =
here=20
:-)</FONT></DIV></BLOCKQUOTE>
<DIV>I think this require Kenn's attention because I've never =
learned=20
these concepts.&nbsp; I was hoping to live in ignorant bliss a =
little=20
longer. :-P</DIV>
<DIV><BR>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>[James]&nbsp;&nbsp; =
Witho</FONT><FONT=20
face=3DArial size=3D2>ut a doubt, Kenn is the master of subsets =
and derived=20
unions but in my humble opinion, calling getOwnedElements in the =
root=20
model and retrieving 2 elements is fine.&nbsp; This can be =
considered=20
all the "direct" owned elements. &nbsp;&nbsp;&nbsp;If you want =
all the=20
direct and indirect elements a special query, =
<EM>allOwnedElements,=20
</EM>&nbsp;is defined in the spec.&nbsp; see section 7.3.14 in =
the=20
"Additional Operations" section.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb im =

Newsbeitrag <A href=3D"news:gdkedv$trt$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkedv$trt$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, it =
seems=20
redundant to serialize a union.&nbsp; Worse than that in =
fact.&nbsp;=20
I.e., given these union features aren't changeable, =
serializing them=20
seems like a really bad idea...<BR><BR><BR>Marc-Florian =
Wendland=20
wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I =
think th=20
easiest way to reproduce this is to propagate the genmodel =
and ecore=20
files, isn't it? I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; =
schrieb im=20
Newsbeitrag <A =
href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this=20
problem.&nbsp; Could you share a test=20
case?<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00A6_01C9350C.CD769470--
Re: Using UML2 mechanism [message #627080 is a reply to message #477875] Fri, 24 October 2008 10:19 Go to previous message
Eclipse UserFriend
Originally posted by: florianwendland.freenet.de

This is a multi-part message in MIME format.

------=_NextPart_000_01F4_01C935D2.CCEC43D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Kenn,

thank you for your detailled answer. I agree with your definition =
totally and will realize the allOwnedElements() method for the case, =
that anyone needs access to all directly or indirectly owned elements.

Have a nice day.
Marc-Florian
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> schrieb im Newsbeitrag =
news:gdq9hj$dam$1@build.eclipse.org...
It's a well-established convention (for better or worse) in the UML =
specification to use "foo" to refer to directly associated elements and =
"allFoo" to refer to a greater set of associated elements which takes a =
hierarchy (such as composition or generalization) into consideration...

In terms of subsets and unions, the semantics are (not surprisingly) =
vague on whether inclusion in the set is recursive, but given the above =
mentioned convention, we made the assumption that it shouldn't be =
(otherwise the definition of the allOwnedElements() operation would be =
redundant)...

Kenn
"Marc-Florian Wendland" <florianwendland@freenet.de> wrote in =
message news:gdl6si$47m$1@build.eclipse.org...
Dear James,
dear Ed,

the allOwnedElements is an option, that's right.=20
I just thought, that the content of the union ownedElements would =
include any element, that participate in that relationship via subset =
mechanism, in whatever hierarchy level they are defined. But the way it =
now works isn't so far from that, what i've expected. I've tried to add =
a containment relationship that doesn't participate in the ownedElement =
relationship and it wasn't selected, when i call getOwnedElements(). So =
far so good.

May be, i got a wrong imagination from the union/subsets mechanism.=20

Thanks=20
Marc-Florian
"James Bruck" <jbruck@ca.ibm.com> schrieb im Newsbeitrag =
news:gdkqbh$tk3$1@build.eclipse.org...
.. comments below ...
"Ed Merks" <Ed.Merks@gmail.com> wrote in message =
news:gdkh14$ms1$1@build.eclipse.org...
Marc-Florian,

Comments below.

Marc-Florian Wendland wrote:=20
Dear Ed,

okay, that was a good point. 1-0 for you, as we say in =
Germany.=20
Darned, we're keeping score!

But, my point was also very good, because the elements, which =
i wanted to be participating in the union, aren't be computed correctly.
I wouldn't know correct if I saw it. :-P

Only the top level children of the root element are computed =
as "ownedElements". And i really think, that this missbehaviour is a =
result of using the wrong List for computing the subsets. I've attached =
a simple model, which illustrates this missbehaviour. Here it is with no =
overhead:

Root
A
B
B
A2
C

while metamodel defines the references as follows:

Element
ownedElements (union)
owner (union)
owningModel(subsets owner)

Root : Element
modeableElements(subsets ownedElements)

A:Element
theB (subsets ownedElements)

B:Element
theA(subsets owner)

A2:Element
theC (subsets ownedElements)

C:Element
theA2 (subsets owner)

When i call getOwnedElements in the Root model, the result is =
2. In uml2 philosophie, this should be 5, because every containment =
reference is defined as a subset of the ownedElements reference, hence, =
the references should contribute themself into the derived union =
relationship. But this isn't done... and again, i think this relates to =
the choice of the generated lists. But i'm really not sure. If i would =
know, why this approach fails, i wouldn't post here :-)
I think this require Kenn's attention because I've never learned =
these concepts. I was hoping to live in ignorant bliss a little longer. =
:-P

=20
[James] Without a doubt, Kenn is the master of subsets and =
derived unions but in my humble opinion, calling getOwnedElements in the =
root model and retrieving 2 elements is fine. This can be considered =
all the "direct" owned elements. If you want all the direct and =
indirect elements a special query, allOwnedElements, is defined in the =
spec. see section 7.3.14 in the "Additional Operations" section.



Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkedv$trt$1@build.eclipse.org...
Marc-Florian,

Probably a union should be transient. Looking at the =
example, it seems redundant to serialize a union. Worse than that in =
fact. I.e., given these union features aren't changeable, serializing =
them seems like a really bad idea...


Marc-Florian Wendland wrote:=20
Ed,

what kind of test case. I think th easiest way to =
reproduce this is to propagate the genmodel and ecore files, isn't it? =
I've attached them.

Marc-Florian
"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag =
news:gdkbtd$vqh$1@build.eclipse.org...
Marc-Florian,

It's likely that folks will want to be able to reproduce =
this problem. Could you share a test case?


Marc-Florian Wendland wrote:=20
Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <Ed.Merks@gmail.com> schrieb im Newsbeitrag=20
news:gdk5sb$3b2$1@build.eclipse.org...
Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
http://www.eclipse.org/uml2/2.2.0/GenModel and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


=20


------=_NextPart_000_01F4_01C935D2.CCEC43D0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR></HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Kenn,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thank you for your detailled answer. I =
agree with=20
your definition totally and will realize the allOwnedElements() method =
for the=20
case, that anyone needs access to all directly or indirectly owned=20
elements.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Have a nice day.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Kenn Hussey" &lt;<A=20
=
href=3D"mailto:Kenn.Hussey@embarcadero.com">Kenn.Hussey@embarcadero.com</=
A>&gt;=20
schrieb im Newsbeitrag <A=20
=
href=3D"news:gdq9hj$dam$1@build.eclipse.org">news:gdq9hj$dam$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>It's a well-established convention =
(for better or=20
worse) in the UML specification to use "foo" to refer to directly =
associated=20
elements and "allFoo" to refer to a greater set of associated elements =
which=20
takes a hierarchy (such as composition or generalization) into=20
consideration...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In terms of subsets and unions, the =
semantics are=20
(not surprisingly) vague on whether inclusion in the set is recursive, =
but=20
given the above mentioned convention, we made the assumption that it =
shouldn't=20
be (otherwise the definition of the allOwnedElements() operation would =
be=20
redundant)...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Kenn</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Marc-Florian Wendland" &lt;<A=20
=
href=3D"mailto:florianwendland@freenet.de">florianwendland@freenet.de</A>=
&gt;=20
wrote in message <A=20
=
href=3D"news:gdl6si$47m$1@build.eclipse.org">news:gdl6si$47m$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Dear James,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>dear&nbsp;Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>the allOwnedElements is an option, =
that's=20
right.&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I just thought, that the content of =
the union=20
ownedElements would include any element, that participate in that=20
relationship via subset mechanism, in whatever hierarchy level they =
are=20
defined. But the way it now works isn't so far from that, what i've=20
expected. I've tried to add a containment relationship that doesn't=20
participate in the ownedElement relationship and it wasn't selected, =
when i=20
call getOwnedElements(). So far so good.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>May be, i got a wrong imagination =
from the=20
union/subsets&nbsp;mechanism. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"James Bruck" &lt;<A=20
href=3D"mailto:jbruck@ca.ibm.com">jbruck@ca.ibm.com</A>&gt; =
schrieb im=20
Newsbeitrag <A=20
=
href=3D"news:gdkqbh$tk3$1@build.eclipse.org">news:gdkqbh$tk3$1@build.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>.. comments below =
....</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A=20
href=3D"mailto:Ed.Merks@gmail.com">Ed.Merks@gmail.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:gdkh14$ms1$1@build.eclipse.org">news:gdkh14$ms1$1@build.ecli=
pse.org</A>...</DIV>Marc-Florian,<BR><BR>Comments=20
below.<BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<DIV><FONT face=3DArial size=3D2>Dear Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>okay, that was a good point. =
1-0 for you,=20
as we say in Germany. </FONT></DIV></BLOCKQUOTE>Darned, we're =
keeping=20
score!<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>But, my point was also very =
good, because=20
the elements, which i wanted to be participating in the union, =
aren't=20
be computed correctly.</FONT></DIV></BLOCKQUOTE>I wouldn't =
know correct=20
if I saw it. :-P<BR>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>Only the top level children =
of the root=20
element are computed as "ownedElements". And i really think, =
that this=20
missbehaviour is a result of using the wrong List for =
computing the=20
subsets. I've attached a simple model, which illustrates this=20
missbehaviour. Here it is with no overhead:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
B</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
A2</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
C</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while metamodel defines the =
references as=20
follows:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
ownedElements=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; owner=20
(union)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
owningModel(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Root : Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
modeableElements(subsets ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theB =
(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>B:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
theA(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A2:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theC =
(subsets=20
ownedElements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>C:Element</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; theA2 =
(subsets=20
owner)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>When i call getOwnedElements =
in the Root=20
model, the result is 2. In uml2 philosophie, this should be 5, =
because=20
every containment reference is defined as a subset of the=20
ownedElements reference, hence, the references should =
contribute=20
themself into the derived union relationship. But this isn't =
done...=20
and again, i think this relates to the choice of the generated =
lists.=20
But i'm really not sure. If i would know, why this approach =
fails, i=20
wouldn't post here :-)</FONT></DIV></BLOCKQUOTE>
<DIV>I think this require Kenn's attention because I've never =
learned=20
these concepts.&nbsp; I was hoping to live in ignorant bliss a =
little=20
longer. :-P</DIV>
<DIV><BR>&nbsp;</DIV>
<BLOCKQUOTE cite=3Dmid:gdkgfp$i3d$1@build.eclipse.org =
type=3D"cite">
<DIV><FONT face=3DArial size=3D2>[James]&nbsp;&nbsp; =
Witho</FONT><FONT=20
face=3DArial size=3D2>ut a doubt, Kenn is the master of =
subsets and=20
derived unions but in my humble opinion, calling =
getOwnedElements in=20
the root model and retrieving 2 elements is fine.&nbsp; This =
can be=20
considered all the "direct" owned elements. =
&nbsp;&nbsp;&nbsp;If you=20
want all the direct and indirect elements a special query,=20
<EM>allOwnedElements, </EM>&nbsp;is defined in the spec.&nbsp; =
see=20
section 7.3.14 in the "Additional Operations" =
section.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; schrieb =
im=20
Newsbeitrag <A href=3D"news:gdkedv$trt$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkedv$trt$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>Probably=20
a union should be transient.&nbsp; Looking at the example, =
it seems=20
redundant to serialize a union.&nbsp; Worse than that in =
fact.&nbsp;=20
I.e., given these union features aren't changeable, =
serializing them=20
seems like a really bad idea...<BR><BR><BR>Marc-Florian =
Wendland=20
wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkc94$4qa$1@build.eclipse.org =
type=3D"cite">
<META content=3D"MSHTML 6.00.2900.5659" name=3DGENERATOR>
<STYLE></STYLE>

<DIV><FONT face=3DArial size=3D2>Ed,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>what kind of test case. I =
think th=20
easiest way to reproduce this is to propagate the genmodel =
and=20
ecore files, isn't it? I've attached them.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Marc-Florian</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; =
MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:Ed.Merks@gmail.com"=20
moz-do-not-send=3D"true">Ed.Merks@gmail.com</A>&gt; =
schrieb im=20
Newsbeitrag <A =
href=3D"news:gdkbtd$vqh$1@build.eclipse.org"=20
=
moz-do-not-send=3D"true">news:gdkbtd$vqh$1@build.eclipse.org</A>...</DIV>=
Marc-Florian,<BR><BR>It's=20
likely that folks will want to be able to reproduce this =

problem.&nbsp; Could you share a test=20
case?<BR><BR><BR>Marc-Florian Wendland wrote:=20
<BLOCKQUOTE cite=3Dmid:gdkajc$kq1$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Dear Ed,

i've done this instincly by myself before. And i've explored the same=20
phenomenon like Timothy. It is possible to construct a model hierarchy =
with=20
the generated editor, but once you have serialized it and try to reopen =
it,=20
it fails with the exception:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedExc=
eption:=20
org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadExcep=
tion(ResourceSetImpl.java:315)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:274)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceS=
etImpl.java:397)
at subset.test.presentation.TestEditor.createModel(TestEditor.j ava:952)
at =
subset.test.presentation.TestEditor.createPages(TestEditor.j ava:1009)
at=20
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditor=
Part.java:310)
at=20
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.=
java:661)
at=20
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:4=
28)
at=20
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartRefer=
ence.java:594)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:30 6)
at=20
org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(Presenta=
blePart.java:180)
at=20
org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(P=
resentablePartFolder.java:270)
at=20
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(Lef=
tToRightTabOrder.java:65)
at=20
org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.select=
Part(TabbedStackPresentation.java:473)
at=20
org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.=
java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 08)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at=20
org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer=
..java:63)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.jav=
a:217)
at=20
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:=
207)
at=20
org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:=
779)
at=20
org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorMana=
ger.java:678)
at =
org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:639)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage=
..java:2817)
at=20
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2=
729)
at =
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2721)
at =
org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2673)
at =
org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2668)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2652)=

at=20
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2643)=

at org.eclipse.ui.ide.IDE.openEditor(IDE.java:646)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:605)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:318)
at=20
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInE ditor(EditorU=
tility.java:160)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:22 8)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:20 7)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionD=
ispatchAction.java:274)
at=20
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchA=
ction.java:250)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActio nGroup.handle=
Open(PackageExplorerActionGroup.java:363)
at=20
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$ 5.open(Packag=
eExplorerPart.java:603)
at=20
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredV iewer.java:82=
0)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at=20
org.eclipse.jface.viewers.StructuredViewer.fireOpen(Structur edViewer.java=
:818)
at=20
org.eclipse.jface.viewers.StructuredViewer.handleOpen(Struct uredViewer.ja=
va:1079)
at=20
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(Stru cturedViewer.=
java:1183)
at =
org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrate gy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.ja va:257)
at =
org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at=20
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:2=
88)
at=20
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:48=
8)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at=20
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplicati=
on.java:113)
at=20
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.ja=
va:193)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplicati=
on(EclipseAppLauncher.java:110)
at=20
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(Eclips=
eAppLauncher.java:79)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:3=
82)
at=20
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:1=
79)
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(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value=20
'subset.test.impl.AImpl@192322e' is not legal.=20
(platform:/resource/de/My2.test, -1, -1)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2647)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardRefer ences(XMLHand=
ler.java:1135)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHan dler.java:121=
4)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .endDocument(=
Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.sc=
anDocument(Unknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unkno=
wn=20
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown=20
Source)
at=20
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknow=
n=20
Source)
at=20
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse=
(Unknown=20
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at =
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.jav=
a:180)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
445)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1=
241)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSe=
tImpl.java:255)
at=20
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Reso=
urceSetImpl.java:270)
... 79 more
Caused by: java.lang.UnsupportedOperationException
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList$DerivedList Iterator.add(=
DerivedEObjectEList.java:278)=20
//cannot resolve the subsets?
at java.util.AbstractSequentialList.add(Unknown Source)
at=20
org.eclipse.uml2.common.util.DerivedEObjectEList.addUnique(D erivedEObject=
EList.java:636)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:=
1192)
at=20
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java=
:2642)
... 95 more

All the DerivedUnion-List are generated, but the genmodel didn't produce =
the=20
SupersetSupset-Lists. Instead of, ordinary EMF-Lists are used. I think,=20
that's the problem, because all the elements, which are participating in =
the=20
Union-Relationship of the root element (like UML::Element) couldn't be=20
computed, since the wrong List-type was selected.

May be it is possible to send one member of the UML2 project this simple =

model, because i have to solve this problem for my masterthesis... does=20
anyone of this project has the interest to solve this problem with me?

Thanks for answering
Marc-Florian

"Ed Merks" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:Ed.Merks@gmail.com" =
moz-do-not-send=3D"true">&lt;Ed.Merks@gmail.com&gt;</A> schrieb im =
Newsbeitrag=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:gdk5sb$3b2$1@build.eclipse.org" =
moz-do-not-send=3D"true">news:gdk5sb$3b2$1@build.eclipse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Marc-Florian,

Here's what I would try as a simple "hack". Open the *.genmodel, =
change=20
the xmlns:genmodel's namespace to=20
<A class=3Dmoz-txt-link-freetext =
href=3D"http://www.eclipse.org/uml2/2.2.0/GenModel" =
moz-do-not-send=3D"true">http://www.eclipse.org/uml2/2.2.0/GenModel</A> =
and then see how it goes.=20
"Reloading..." this model will continue to create the UML2 derived=20
GenModel.


Marc-Florian Wendland wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Salute,

i've a similar question as Timothy. I followed his discussions, and it=20
seems that we want to do exactly the same at the same time... sometimes=20
it is very mystical :)
Back to business:

I have an UML2 model with some union/subsets relationships and i want to =

realize these mechanisms in the resulting Ecore, like it is done in the=20
wonderful UML2 project. I've introspected the uml2 sources but didn't=20
found an hint how to include the UML2 generator instead of the ordinary=20
EMF one, which doesn't care about union/subsets. Is there somewhere an=20
article outthere, how to integrate this code generator?

Any help would be appreciated.

Marc-Florian


</PRE></BLOCKQUOTE></BLOCKQUOTE><PRE wrap=3D""><!---->

=
</PRE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE ></BLOCKQUOTE></=
BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY ></HTML>

------=_NextPart_000_01F4_01C935D2.CCEC43D0--
Previous Topic:EMF Code generation from UML2 model fails
Next Topic:Difference in treating redfinded properties
Goto Forum:
  


Current Time: Thu Mar 28 09:35:14 GMT 2024

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

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

Back to the top