Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Inheritance with loaded resource and "Sample Reflective Ecore Model Editor"
Inheritance with loaded resource and "Sample Reflective Ecore Model Editor" [message #552532] Thu, 12 August 2010 14:27 Go to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 132
Registered: July 2010
Senior Member
Hi @all,

maybe I am doing something in the wrong way, but I have a problem with my ECore Model and the "Sample Reflective Ecore Model Editor".

I am using Helios 3.6.0 including most modeling components.

Please check the following ecore (the problem is reproducible very easily):

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="testmodel"
nsURI="http://someURI" nsPrefix="tm">
<eClassifiers xsi:type="ecore:EClass" name="ModelDerived" eSuperTypes=" platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Mode l "/>
<eClassifiers xsi:type="ecore:EClass" name="ClassDerived" eSuperTypes=" platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Clas s "/>
</ecore:EPackage>

In plain text:
----------
namespace tm
->ModelDerived -> Model (from UML)
->ClassDerived -> Class (from UML)
----------

Now I have created a model instance using the "Sample Reflective Ecore Model Editor" with the following structure:

ModelDerived
->Package (from UML)
-->ClassDerived

Validation OK, worked perfectly!

Here the resulting XMI file:
<?xml version="1.0" encoding="ASCII"?>
<tm:ModelDerived xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tm="http://someURI" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http://someURI testmodel.ecore http://www.eclipse.org/uml2/3.0.0/UML ../../../plugin/org.eclipse.uml2.uml/model/UML.ecore">
<packagedElement xsi:type="uml:Package">
<packagedElement xsi:type="tm:ClassDerived"/>
</packagedElement>
</tm:ModelDerived>

However, if I want to reload the XMI with "Sample Reflective Ecore Model Editor", I get the following error message:

org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@fb93b (eClass: org.eclipse.emf.ecore.impl.EClassImpl@49eb30 (name: ClassDerived) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/AMLMetaModel/model/Instance.xmi, 4, 50)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2663)


What's wrong? Bug? Feature? I cannot derive the way I do? The interesting point for me is, that validation was ok before, so I don't know what to do now.

Thanks a lot!
Kirsten

[Updated on: Thu, 12 August 2010 14:28]

Report message to a moderator

Re: Inheritance with loaded resource and "Sample Reflective Ecore Model Editor" [message #552576 is a reply to message #552532] Thu, 12 August 2010 16:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Kirsten,

Comments below.


vultur wrote:
> Hi @all,
>
> maybe I am doing something in the wrong way, but I have a problem with
> my ECore Model and the "Sample Reflective Ecore Model Editor".
>
> I am using Helios 3.6.0 including most modeling components.
>
> Please check the following ecore (the problem is reproducible very
> easily):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="testmodel"
> nsURI="http://someURI" nsPrefix="tm">
> <eClassifiers xsi:type="ecore:EClass" name="ModelDerived"
> eSuperTypes="
> platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Mode l "/>
You're extending the UML...
> <eClassifiers xsi:type="ecore:EClass" name="ClassDerived"
> eSuperTypes="
> platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Clas s "/>
> </ecore:EPackage>
>
> In plain text:
> ----------
> namespace tm
> ModelDerived -> Model (from UML)
> ClassDerived -> Class (from UML)
> ----------
>
> Now I have created a model instance using the "Sample Reflective Ecore
> Model Editor" with the following structure:
>
> ModelDerived
> Package (from UML)
> ClassDerived
>
> Validation OK, worked perfectly!
>
> Here the resulting XMI file:
> <?xml version="1.0" encoding="ASCII"?>
> <tm:ModelDerived xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:tm="http://someURI"
> xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML"
> xsi:schemaLocation="http://someURI testmodel.ecore
> http://www.eclipse.org/uml2/3.0.0/UML
> ../../../plugin/org.eclipse.uml2.uml/model/UML.ecore">
> <packagedElement xsi:type="uml:Package">
> <packagedElement xsi:type="tm:ClassDerived"/>
> </packagedElement>
> </tm:ModelDerived>
>
> However, if I want to reload the XMI with "Sample Reflective Ecore
> Model Editor", I get the following error message:
>
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> mailto:'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@fb93b (eClass:
> mailto:org.eclipse.emf.ecore.impl.EClassImpl@49eb30 (name:
> ClassDerived) (instanceClassName: null) (abstract: false, interface:
> false))' is not legal.
> (platform:/resource/AMLMetaModel/model/Instance.xmi, 4, 50)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM
> LHandler.java:2663)
>
>
> What's wrong? Bug? Feature? I cannot derive the way I do? The
> interesting point for me is, that validation was ok before, so I don't
> know what to do now.
It looks like a generated instance of the UML model is being created,
probably because of some URI mapping or registration done by UML itself,
and that generate instance is expecting instances that implement the
generated interfaces to be put in its list.

java.lang.ArrayStoreException
at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.jav a:124)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:424)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUn ique(NotifyingListImpl.java:331)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUniq ue(NotifyingListImpl.java:288)
at
org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHel perImpl.java:1179)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2658)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XM LHandler.java:2648)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTy peName(XMLHandler.java:2105)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:2031)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:134)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1840)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1023)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unk nown
Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyEle ment(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanSt artElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.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:1494)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
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)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at
org.eclipse.emf.ecore.presentation.EcoreEditor.createModelGe n(EcoreEditor.java:1062)
at
org.eclipse.emf.ecore.presentation.EcoreEditor.createModel(E coreEditor.java:1082)
at
org.eclipse.emf.ecore.presentation.EcoreEditor.createPages(E coreEditor.java:1147)
at
org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:348)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:670)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:465)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
at
org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:289)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2863)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2768)
at
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2760)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2711)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2707)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2691)
at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu. java:331)
at
org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMe nu.java:179)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:115)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
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:369)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

There's not much I can do about that from the core framework itself. If
you extended the generated version then the dynamic instances would
extend the generated instances, so that might work better, as long as
you aren't extending abstract classes...
>
> Thanks a lot!
> Kirsten
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Inheritance with loaded resource and "Sample Reflective Ecore Model Editor" [message #552713 is a reply to message #552576] Fri, 13 August 2010 09:12 Go to previous messageGo to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 132
Registered: July 2010
Senior Member
Hi Ed,

thanks for your help. However, I am sorry that I could not completely get your point. I still don't know if it is a problem in my theory (wrong derivation and usage of the EMF technology, maybe such derivations are prohibited by specification) or a technical problem, because tools and core cannot work that way.

I also don't know how a workaround could look like.

However, I found at least one way. Please comment, if it is understandable that it works this way and not the other way (which would be more convenient):

I have to run my EMF project as Eclipse Application / Plugin. Inside the new workbench instance, my model is registered. Creating the instance above and re-opening works there!

However, there is still a problem within the "Sample Reflective Ecore Model Editor": after I re-opened it, I cannot add "tm:ClassDerived" under the "uml:Package" node any more. In a new instance, I could.

Now another interesting fact: I also checked the "Acceleo Reflective Editor" (for my eyes, it is designed almost like "Sample Reflective Ecore Model Editor" and has the same intention). With this editor, the last-named problem does not show up.

Kirsten

[Updated on: Fri, 13 August 2010 09:13]

Report message to a moderator

Re: Inheritance with loaded resource and "Sample Reflective Ecore Model Editor" [message #552828 is a reply to message #552713] Fri, 13 August 2010 16:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Kirsten,

Comments below.

vultur wrote:
> Hi Ed,
>
> thanks for your help. However, I am sorry that I could not completely
> get your point. I still don't know if it is a problem in my theory
> (wrong derivation and usage of the EMF technology, maybe such
> derivations are prohibited by specification) or a technical problem,
> because tools and core cannot work that way.
Because there is a generated package for UML2, when you deserialize an
instance that refers to that generated package's namespace, the
generated package will be used. But your extending Ecore model refers
to the development time instances of UML2, so you end up with two
different EPackages for UML2; the generated one and the development time
one and the two are not compatible. So when you create instances of
your dynamic model, they're extensions of the development time version
of UML2 and can't be used with the generated version of UML2.
>
> I also don't know how a workaround could look like.
Refer to UML2 via it's nsURI rather than to the serialized instance in
the plugin.
>
> However, I found at least one way. Please comment, if it is
> understandable that it works this way and not the other way (which
> would be more convenient):
>
> I have to run my EMF project as Eclipse Application / Plugin. Inside
> the new workbench instance, my model is registered. Creating the
> instance above and re-opening it works!
Maybe the generated UML2 isn't registered there?
>
> However, there is still a problem within the "Sample Reflective Ecore
> Model Editor": after I re-opened it, I cannot add "tm:ClassDerived"
> under the "uml:Package" node any more. In a new instance, I could.
I couldn't reproduce this.
>
> Now another interesting fact: I also checked the "Acceleo Reflective
> Editor" (for my eyes, it is designed almost like "Sample Reflective
> Ecore Model Editor" and has the same intention). With this editor, the
> last-named problem does not show up.
>
> Kirsten


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Inheritance with loaded resource and "Sample Reflective Ecore Model Editor" [message #553165 is a reply to message #552828] Mon, 16 August 2010 15:17 Go to previous messageGo to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 132
Registered: July 2010
Senior Member
Hi,

I tried your suggestions today, thank you!

You have been right, using the nsURI (runtime versions) for UML2 works better. However, I should mention that I have still been confused, because I have to re-start Eclipse every time I update my ECore file. Otherwise changes, e.g. new elements, are neither shown for adding to my "dynamic instance" nor validation works (new types are not avaible until re-start).

Another, more important issue: what's wrong with the following ECore file?

---------------

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="testmodel"
nsURI="http://someURI" nsPrefix="tm">
<eClassifiers xsi:type="ecore:EClass" name="ClassDerived" eSuperTypes="http://www.eclipse.org/uml2/3.0.0/UML#//Class"/>
<eClassifiers xsi:type="ecore:EClass" name="ClassifierDerived" eSuperTypes="http://www.eclipse.org/uml2/3.0.0/UML#//Classifier"/>
</ecore:EPackage>

----------------

Please create a new "dynamic instance" from "ClassDerived" now (a "dynamic instance" of ClassifierDerived cannot even be created, nothing happens then). When the "Sample Reflective Ecore Model Editor" is opened, I get the following error message:

"An error has occurred when activating this view
The class 'Classifier' is not a valid classifier"

I encounter this problem always, if deriving from "Classifier" (but also "Behavior", etc.)

I am using Topcased 4.0.0 (Eclipse 3.6)

Regards,
Kirsten

[Updated on: Mon, 16 August 2010 15:19]

Report message to a moderator

Re: Inheritance with loaded resource and "Sample Reflective Ecore Model Editor" [message #553195 is a reply to message #553165] Mon, 16 August 2010 16:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Kirsten,

Comments below.


vultur wrote:
> Hi,
>
> I tried your suggestions today, thank you!
>
> You have been right, using the nsURI (runtime versions) for UML2 works
> better. However, I should mention that I have still been confused,
> because I have to re-start Eclipse every time I update my ECore file.
> Otherwise changes, e.g. new elements, are neither shown for adding to
> my "dynamic instance" nor validation works (new types are not avaible
> until re-start).
Changes you make won't affect an editor open on an existing instance,
but if you close the editor and start a new one, that instance of the
editor should read in your changed model.
>
> Another, more important issue: what's wrong with the following ECore
> file?
>
> ---------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="testmodel"
> nsURI="http://someURI" nsPrefix="tm">
> <eClassifiers xsi:type="ecore:EClass" name="ClassDerived"
> eSuperTypes="http://www.eclipse.org/uml2/3.0.0/UML#//Class"/>
> <eClassifiers xsi:type="ecore:EClass" name="ClassifierDerived"
> eSuperTypes="http://www.eclipse.org/uml2/3.0.0/UML#//Classifier"/>
> </ecore:EPackage>
>
> ----------------
>
> Please create a new "dynamic instance" from "ClassDerived" now (a
> "dynamic instance" of ClassifierDerived cannot even be create, nothing
> works). When "Sample Reflective Ecore Model Editor" is opened, I get
> the following error message:
>
> "An error has occurred when activating this view
> The class 'Classifier' is not a valid classifier"
>
> I encounter this problem always, if deriving from "Classifier" (but
> also "Behavior", etc.)
Remember I mentioned the problem of trying to create a dynamic instance
when the base class is abstract and generated? EMF will generally try
to create an instance of the closest generated base class, (it has to
produce instances that implement all the generated interfaces) and if
that class is abstract, it fails.
>
> I am using Topcased 4.0.0 (Eclipse 3.6)
>
> Regards,
> Kirsten


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Inheritance with loaded resource and "Sample Reflective Ecore Model Editor" [message #553290 is a reply to message #553195] Tue, 17 August 2010 01:25 Go to previous messageGo to next message
Kirsten M. Z. is currently offline Kirsten M. Z.Friend
Messages: 132
Registered: July 2010
Senior Member
Ed,

comments below.

>> Please create a new "dynamic instance" from "ClassDerived" now (a
>> "dynamic instance" of ClassifierDerived cannot even be create, nothing
>> works). When "Sample Reflective Ecore Model Editor" is opened, I get
>> the following error message:
>>
>> "An error has occurred when activating this view
>> The class 'Classifier' is not a valid classifier"
>>
>> I encounter this problem always, if deriving from "Classifier" (but
>> also "Behavior", etc.)
>
>Remember I mentioned the problem of trying to create a dynamic instance
>when the base class is abstract and generated? EMF will generally try
>to create an instance of the closest generated base class, (it has to
>produce instances that implement all the generated interfaces) and if
>that class is abstract, it fails.

Oh, I see. Sorry, but I could not see the relation between this new error and your comment before.

Well, all the problems I ran into are very disillusioning. After all, I cannot see a possibility to apply my ideas and the theory any more. I cannot run my model in the current instance as dynamic model, and I cannot run it as plug-in in another Eclipse instance (see also http://www.eclipse.org/forums/index.php?t=msg&th=173828, but I guess that there are some more problems I would run into Wink ).

Could you think about more possibilities I have? I simply want/have to create a valid UML extension based on EMF (just a research issue, please no discussion about lightweight/heavyweight, etc.). And I have been looking forward to use an Eclipse editor for creating some example models/instances afterwards. I also work with transformations, so I would really appreciate I nice tree view. Finally, I want run model validations, also based on my own OCL (OCLInEcore, which works fine right now).
Re: Inheritance with loaded resource and "Sample Reflective Ecore Model Editor" [message #553293 is a reply to message #553290] Tue, 17 August 2010 02:13 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Kirsten,

Comments below.

vultur wrote:
> Ed,
>
> comments below.
>
>>> Please create a new "dynamic instance" from "ClassDerived" now (a
>>> "dynamic instance" of ClassifierDerived cannot even be create,
>>> nothing works). When "Sample Reflective Ecore Model Editor" is
>>> opened, I get the following error message:
>>>
>>> "An error has occurred when activating this view
>>> The class 'Classifier' is not a valid classifier"
>>>
>>> I encounter this problem always, if deriving from "Classifier" (but
>>> also "Behavior", etc.)
>>
>> Remember I mentioned the problem of trying to create a dynamic
>> instance when the base class is abstract and generated? EMF will
>> generally try to create an instance of the closest generated base
>> class, (it has to produce instances that implement all the generated
>> interfaces) and if that class is abstract, it fails.
>
> Oh, I see. Sorry, but I could not see the relation between this new
> error and your comment before.
>
> Well, all the problems I ran into are very disillusioning. After all,
> I cannot see a possibility to apply my ideas and the theory any more.
> I cannot run my model in the current instance as dynamic model, and I
> cannot run it as plug-in in another Eclipse instance (see also
> http://www.eclipse.org/forums/index.php?t=msg&th=173828, but I guess
> that there are some more problems I would run into ;) ).
>
> Could you think about more possibilities I have? I simply want/have to
> create a valid UML extension based on EMF (just a research issue,
> please no discussion about lightweight/heavyweight, etc.).
Why does it have to be dynamic? I.e., why not generate a model for it,
launch a runtime workspace, and play with your instance there? Given
how much UML2's implementation has specialized implementation details
(to support things like subset and superset) it really does seem need to
use the generated version of it. If not, you could always make a copy
of UML2, change the namespace slightly, and use that for all your
dynamic work...
> And I have been looking forward to use an Eclipse editor for creating
> some example models/instances afterwards. I also work with
> transformations, so I would really appreciate I nice tree view.
> Finally, I want run model validations, also based on my own OCL
> (OCLInEcore, which works fine right now).


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:install and use model Query
Next Topic:Using EMF Model Query
Goto Forum:
  


Current Time: Thu Sep 19 09:00:44 GMT 2024

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

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

Back to the top