Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [emfstore-dev] (no subject)

Hi Yan,

do you have the org.eclipse.emf.emfstore.ecore plugin installed? It is needed to version ECore, but it is not yet part of the SDK.

Best Regards,
Edgar


On Thu, Jul 10, 2014 at 10:35 AM, Yan Zhang <Yan.Zhang@xxxxxxxxxx> wrote:


Yan Zhang - KISTERS Shanghai Software Development Co., Ltd. - Pudong nan Road 12716. Level. Office Nr: 606 - 200122 Shanghai - China
Phone: +86 21 68670119 -801 | E-Mail: yan.zhang@xxxxxxxxxx | WWW: www.kisters.cn

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. ----- Forwarded by Yan Zhang/Shanghai/Kisters on 07/10/2014 04:35 PM -----

From: Yan Zhang/Shanghai/Kisters
To: mkoegel@xxxxxxxxxxxxxxxxx, jhelming@xxxxxxxxxxxxxxxxx,
Date: 07/04/2014 05:48 PM
Subject:




Hi All,

  I have a problem when I am using EMFStore.I can not version metamodel itself(ecore itself) using EMFStore.



  For example, I build a ecore using code below:


                final ESLocalProject demoProject = workspace.createLocalProject("DemoProject");
              final EcoreFactory ecoreFactory = EcoreFactory.eINSTANCE;
                final EClass purchaseOrderClass = ecoreFactory.createEClass();
                purchaseOrderClass.setName("PurchaseOrder");
                final EAttribute shipTo = ecoreFactory.createEAttribute();
                shipTo.setName("shipTo");
                shipTo.setEType(EcorePackage.Literals.ESTRING); //use inner Etype
                shipTo.setEGenericType(null);
                purchaseOrderClass.getEAttributes().add(shipTo);
                final EAttribute billTo = ecoreFactory.createEAttribute();
                billTo.setName("billTo");
                billTo.setEType(EcorePackage.Literals.ESTRING);
                billTo.setEGenericType(null);
                purchaseOrderClass.getEStructuralFeatures().add(billTo);
                final EClass itemClass = ecoreFactory.createEClass();
                itemClass.setName("Item");
                final EAttribute productName = ecoreFactory.createEAttribute();
                productName.setName("productName");
                productName.setEType(EcorePackage.Literals.ESTRING);
                productName.setEGenericType(null);
                itemClass.getEStructuralFeatures().add(productName);
                final EAttribute quantity = ecoreFactory.createEAttribute();
                quantity.setName("quantity");
                quantity.setEType(EcorePackage.Literals.EINT);
                quantity.setEGenericType(null);
                itemClass.getEStructuralFeatures().add(quantity);
                final EAttribute price = ecoreFactory.createEAttribute();
                price.setName("price");
                price.setEType(EcorePackage.Literals.EFLOAT);
                price.setEGenericType(null);
                itemClass.getEStructuralFeatures().add(price);
                final EReference items = ecoreFactory.createEReference();
                items.setName("items");
                items.setEType(itemClass);
                items.setUpperBound(ETypedElement.UNBOUNDED_MULTIPLICITY);
                items.setContainment(true);
                purchaseOrderClass.getEStructuralFeatures().add(items);
                final EPackage poPackage = ecoreFactory.createEPackage();
                poPackage.setName("po");
                poPackage.setNsPrefix("po");
                poPackage.setNsURI("http://www.example.com/SimplePO");
                poPackage.getEClassifiers().add(purchaseOrderClass);
                poPackage.getEClassifiers().add(itemClass);

            demoProject.getModelElements().add(poPackage);
            demoProject.commit("My message", null, new ESSystemOutProgressMonitor());

I want EMFStore to maintain this model, but it seems to be impossible.

Here are error stack trace:

!STACK 0
java.lang.IndexOutOfBoundsException: Index: 10, Size: 10
        at java.util.ArrayList.rangeCheck(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at org.eclipse.emf.emfstore.internal.client.model.impl.OperationRecorder.createCreateDeleteOperation(OperationRecorder.java:421)
        at org.eclipse.emf.emfstore.internal.client.model.impl.OperationRecorder.modelElementAdded(OperationRecorder.java:217)
        at org.eclipse.emf.emfstore.internal.client.model.impl.OperationManager.modelElementAdded(OperationManager.java:259)
        at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl$1.run(NotifiableIdEObjectCollectionImpl.java:108)
        at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl$2.run(NotifiableIdEObjectCollectionImpl.java:142)
        at org.eclipse.emf.emfstore.common.ESSafeRunner.run(ESSafeRunner.java:38)
        at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl.notifyIdEObjectCollectionChangeObservers(NotifiableIdEObjectCollectionImpl.java:165)
        at org.eclipse.emf.emfstore.internal.common.model.impl.NotifiableIdEObjectCollectionImpl.modelElementAdded(NotifiableIdEObjectCollectionImpl.java:111)
        at org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.addAdapter(EObjectChangeNotifier.java:90)
        at org.eclipse.emf.ecore.util.EContentAdapter.handleContainment(EContentAdapter.java:139)
        at org.eclipse.emf.ecore.util.EContentAdapter.selfAdapt(EContentAdapter.java:74)
        at org.eclipse.emf.ecore.util.EContentAdapter.notifyChanged(EContentAdapter.java:40)
        at org.eclipse.emf.emfstore.internal.common.model.util.EObjectChangeNotifier.notifyChanged(EObjectChangeNotifier.java:187)
        at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
        at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249)
        at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:294)
        at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:303)
        at org.eclipse.emf.emfstore.example.helloworld.Application.runClient(Application.java:243)
        at org.eclipse.emf.emfstore.example.helloworld.Application.start(Application.java:54)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.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(EclipseStarter.java:353)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
        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:629)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1414)



However, if I do not use EDataType (such as EString) or call setEGenericType(null) for each feature, this will work.
I think my question is same as http://www.eclipse.org/forums/index.php?t=msg&th=205009/

Waiting for your help, thank you very much.



Yan Zhang,
Best Regards.

_______________________________________________
emfstore-dev mailing list
emfstore-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/emfstore-dev


Back to the top