Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL Tuples in pivot
OCL Tuples in pivot [message #1159385] Mon, 28 October 2013 09:49 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 500
Registered: June 2011
Senior Member
I am having an operation with return type as tuple in my pivot based ECore.

i am getting following exception while i try to save the instantiation of Ecore model (the resource).

org.eclipse.emf.ecore.resource.Resource$IOWrappedException: The object 'org.eclipse.ocl.ecore.impl.TupleTypeImpl@1b12ee3 (name: null) (instanceClassName: org.eclipse.ocl.util.Tuple) (abstract: false, interface: false) (serializable: true)' is not contained in a resource.
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.endSave(XMLSaveImpl.java:301)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:265)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:365)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
Caused by: org.eclipse.emf.ecore.xmi.DanglingHREFException: The object 'org.eclipse.ocl.ecore.impl.TupleTypeImpl@1b12ee3 (name: null) (instanceClassName: org.eclipse.ocl.util.Tuple) (abstract: false, interface: false) (serializable: true)' is not contained in a resource.
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.handleDanglingHREF(XMLHelperImpl.java:754)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.getHREF(XMLHelperImpl.java:788)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveEObjectSingle(XMLSaveImpl.java:1880)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1319)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1176)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1037)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2412)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1548)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1176)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElement(XMLSaveImpl.java:1037)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveContainedMany(XMLSaveImpl.java:2412)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1548)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveFeatures(XMLSaveImpl.java:1219)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.saveElementID(XMLSaveImpl.java:2711)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.writeTopObject(XMLSaveImpl.java:678)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.traverse(XMLSaveImpl.java:586)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:251)

do you have idea why it is so?

Cheers,
Re: OCL Tuples in pivot [message #1159418 is a reply to message #1159385] Mon, 28 October 2013 10:17 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 500
Registered: June 2011
Senior Member
I have tried to save all defined tuple types in ressource and now do not get earlier mentioned exception.

But now when i try to evaluate using delegates then i get the following exception...
java.lang.ClassCastException: org.eclipse.ocl.ecore.impl.TupleTypeImpl cannot be cast to org.eclipse.emf.ecore.EOperation
at org.eclipse.emf.ecore.util.EcoreSwitch.doSwitch(EcoreSwitch.java:177)
at org.eclipse.ocl.examples.pivot.ecore.Ecore2PivotReferenceSwitch.doInPackageSwitch(Ecore2PivotReferenceSwitch.java:320)
at org.eclipse.ocl.examples.pivot.ecore.Ecore2Pivot.update(Ecore2Pivot.java:754)
at org.eclipse.ocl.examples.pivot.ecore.Ecore2Pivot.importObjects(Ecore2Pivot.java:467)
at org.eclipse.ocl.examples.pivot.ecore.Ecore2Pivot.getPivotRoot(Ecore2Pivot.java:412)
at org.eclipse.ocl.examples.pivot.ecore.Ecore2Pivot.getPivotOfEcore(Ecore2Pivot.java:337)
at org.eclipse.ocl.examples.pivot.ecore.Ecore2Pivot.getCreated(Ecore2Pivot.java:319)
at org.eclipse.ocl.examples.pivot.manager.MetaModelManager.getPivotOfEcore(MetaModelManager.java:1929)
at org.eclipse.ocl.examples.pivot.ecore.Ecore2Pivot$Factory.getPivotOf(Ecore2Pivot.java:112)
at org.eclipse.ocl.examples.pivot.manager.MetaModelManager.getPivotOf(MetaModelManager.java:1911)
at org.eclipse.ocl.examples.pivot.delegate.OCLDelegateDomain.getPivot(OCLDelegateDomain.java:175)
at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.getProperty(OCLSettingDelegate.java:92)

any idea?

Cheers
Re: OCL Tuples in pivot [message #1159571 is a reply to message #1159418] Mon, 28 October 2013 12:28 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 500
Registered: June 2011
Senior Member
Hi,

I have been looking into test written for TupleType(test_TupleLiteralExp_checkTupleType). It uses TupleLiteralExp and TupleLiteralPart which i have not used with TupleType. Do you think it might be the cause?

My code is like
TupleType tt = org.eclipse.ocl.ecore.EcoreFactory.eINSTANCE.createTupleType();
EAttribute eAttribute1 = EcoreFactory.eINSTANCE.createEAttribute();
EAttribute eAttribute2 = EcoreFactory.eINSTANCE.createEAttribute();
eAttribute1.setName("first");
eAttribute1.setEType(EcorePackage.eINSTANCE.getEDouble());
eAttribute1.setName("second");
eAttribute2.setEType(EcorePackage.eINSTANCE.getEBoolean());
tt.getEStructuralFeatures().add(eAttribute1);
tt.oclProperties().add(eAttribute1);
tt.getEStructuralFeatures().add(eAttribute2);
tt.oclProperties().add(eAttribute2);
// set the type of operation as tuple
eOperation.setEType(tt);

Cheers,
Re: OCL Tuples in pivot [message #1159724 is a reply to message #1159571] Mon, 28 October 2013 14:50 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

See http://wiki.eclipse.org/OCL/ForumNetiquette

Regards

Ed Willink

On 28/10/2013 16:28, ModelGeek Mising name wrote:
> Hi,
>
> I have been looking into test written for
> TupleType(test_TupleLiteralExp_checkTupleType). It uses
> TupleLiteralExp and TupleLiteralPart which i have not used with
> TupleType. Do you think it might be the cause?
>
> My code is like
> TupleType tt =
> org.eclipse.ocl.ecore.EcoreFactory.eINSTANCE.createTupleType();
> EAttribute eAttribute1 = EcoreFactory.eINSTANCE.createEAttribute();
> EAttribute eAttribute2 = EcoreFactory.eINSTANCE.createEAttribute();
> eAttribute1.setName("first");
> eAttribute1.setEType(EcorePackage.eINSTANCE.getEDouble());
> eAttribute1.setName("second");
> eAttribute2.setEType(EcorePackage.eINSTANCE.getEBoolean());
> tt.getEStructuralFeatures().add(eAttribute1);
> tt.oclProperties().add(eAttribute1);
> tt.getEStructuralFeatures().add(eAttribute2);
> tt.oclProperties().add(eAttribute2);
> // set the type of operation as tuple
> eOperation.setEType(tt);
>
> Cheers,
Re: OCL Tuples in pivot [message #1160867 is a reply to message #1159724] Tue, 29 October 2013 08:04 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 500
Registered: June 2011
Senior Member
Hi,

I have attached a plugin(developed in Kepler). It is very simple plugin with one package "tupletest1".
It contains file TestTuple.java. In this file an Ecore model is created programmatically consisting of one class. Class has one attribute(name = test, type = Real) and one operation(name=opt, type = Tuple(Real, Real), arguments=none).

The OCL statement for attribute is "let t : Tuple(a:Real , b:Real) = opt() in t.a*4" and the OCL statement for operation is "let t : Tuple(a:Real, b:Real) = Tuple{a=2, b=2} in t"

The class TestTuple is instantiated in class View.java(simple view onCreate instantiation for TestTuple is performed).

When i try to evaluate attribute using setting delegates then i get the following exception


org.eclipse.ocl.common.internal.delegate.OCLDelegateException: OCL evaluation result of 'temp::TestClass.test' is invalid

Do you have any clue wht tuple is problematic in the given code.

Cheers
at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:81)
at org.eclipse.emf.ecore.util.BasicSettingDelegate$Stateless.dynamicGet(BasicSettingDelegate.java:185)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1027)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1011)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)
at tupletest1.TestTuple.useDelegates(TestTuple.java:145)
at tupletest1.View.createPartControl(View.java:72)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:142)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:174)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:323)
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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:877)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:857)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:119)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:333)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:254)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:526)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:511)
at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:61)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:59)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:97)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:649)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:676)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1042)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at tupletest1.Application.start(Application.java:20)
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:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
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:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: org.eclipse.ocl.examples.domain.values.impl.InvalidValueException
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitLetExp(EvaluationVisitorImpl.java:578)
at org.eclipse.ocl.examples.pivot.internal.impl.LetExpImpl.accept(LetExpImpl.java:454)
at org.eclipse.ocl.examples.pivot.utilities.QueryImpl.evaluate(QueryImpl.java:197)
at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:72)
... 98 more
Caused by: org.eclipse.ocl.examples.domain.values.impl.InvalidValueException: Failed to evaluate temp::TestClass.opt() :
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:794)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:452)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitVariable(EvaluationVisitorImpl.java:934)
at org.eclipse.ocl.examples.pivot.internal.impl.VariableImpl.accept(VariableImpl.java:430)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitLetExp(EvaluationVisitorImpl.java:575)
... 101 more
Caused by: java.lang.NullPointerException
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:79)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:701)
... 105 more

[Updated on: Tue, 29 October 2013 08:05]

Report message to a moderator

Re: OCL Tuples in pivot [message #1162198 is a reply to message #1160867] Wed, 30 October 2013 04:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

You didn't specify how to run your code; Opening a Perspective named
Perspective is a very odd approach.

I have no idea why you are doing such low level model creation. It is
incredibly hard, but if you're going to ignore the higher level aids you
should expect to debug your own problems.

If you added a

Diagnostician.INSTANCE.validate(modelPackage);

you would have noticed a couple of

The feature 'eType' of
'org.eclipse.emf.ecore.impl.EOperationImpl@11db0bc{test.ecore#//TestClass/opt}'
contains a dangling reference
'org.eclipse.ocl.ecore.impl.TupleTypeImpl@129751d{#//}'
The feature 'eClassifier' of
'org.eclipse.emf.ecore.impl.EGenericTypeImpl@c7c79e{test.ecore#//TestClass/opt/@eGenericType}'
contains a dangling reference
'org.eclipse.ocl.ecore.impl.TupleTypeImpl@129751d{#//}'

Once you fix those, you will notice that your tuple parts are unnamed,
causing the operation lookup failure and so the eventual failure.

When writing very complicated stupid code expect the problem to be in
your code so debug it properly.

Now go back to your original messages and ask yourself how anyone could
have answered your question sensibly.

Regards

Ed Willink



On 29/10/2013 13:04, ModelGeek Mising name wrote:
> Hi,
>
> I have attached a plugin. It is very simple plugin with one package "tupletest1".
> It contains file TestTuple.java. In this file an Ecore model is created programmatically consisting of one class. Class has one attribute(name = test, type = Real) and one operation(name=opt, type = Tuple(Real, Real), arguments=none).
>
> The OCL statement for attribute is "let t : Tuple(a:Real , b:Real) = opt() in t.a*4" and the OCL statement for operation is "let t : Tuple(a:Real, b:Real) = Tuple{a=2, b=2} in t"
>
> The class TestTuple is instantiated in class View.java(simple view onCreate instantiation for TestTuple is performed).
>
> When i try to evaluate attribute using setting delegates then i get the following exception
>
>
> org.eclipse.ocl.common.internal.delegate.OCLDelegateException: OCL evaluation result of 'temp::TestClass.test' is invalid
>
> Do you have any clue wht tuple is problematic in the given code.
>
> Cheers
> at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:81)
> at org.eclipse.emf.ecore.util.BasicSettingDelegate$Stateless.dynamicGet(BasicSettingDelegate.java:185)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1027)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1011)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)
> at tupletest1.TestTuple.useDelegates(TestTuple.java:145)
> at tupletest1.View.createPartControl(View.java:72)
> at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:142)
> at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:174)
> at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:323)
> 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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
> at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:877)
> at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:857)
> at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:119)
> at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:333)
> at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:254)
> at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
> at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:526)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:511)
> at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:61)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:59)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103)
> at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:97)
> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:649)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
> at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:676)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1042)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
> at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> at tupletest1.Application.start(Application.java:20)
> 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:354)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
> 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:636)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
> Caused by: org.eclipse.ocl.examples.domain.values.impl.InvalidValueException
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitLetExp(EvaluationVisitorImpl.java:578)
> at org.eclipse.ocl.examples.pivot.internal.impl.LetExpImpl.accept(LetExpImpl.java:454)
> at org.eclipse.ocl.examples.pivot.utilities.QueryImpl.evaluate(QueryImpl.java:197)
> at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:72)
> ... 98 more
> Caused by: org.eclipse.ocl.examples.domain.values.impl.InvalidValueException: Failed to evaluate temp::TestClass.opt() :
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:794)
> at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:452)
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitVariable(EvaluationVisitorImpl.java:934)
> at org.eclipse.ocl.examples.pivot.internal.impl.VariableImpl.accept(VariableImpl.java:430)
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitLetExp(EvaluationVisitorImpl.java:575)
> ... 101 more
> Caused by: java.lang.NullPointerException
> at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:79)
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:701)
> ... 105 more
>
Re: OCL Tuples in pivot [message #1162253 is a reply to message #1162198] Wed, 30 October 2013 04:51 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 500
Registered: June 2011
Senior Member
Sorry for giving incomplete information.
You can run the plug-in as Eclipse Application (menu Run->Run As->Eclipse Application).

The perspective/GUI is just for the testing... just ignore that.
Dangling reference problem is solved (i added tupletype in package).
I have also given names to tuple parts but still i am getting the same exception when i try to evaluate using dalegates.

Please check the attached project. Thanks!

org.eclipse.ocl.common.internal.delegate.OCLDelegateException: OCL evaluation result of 'temp::TestClass.test' is invalid
at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:81)
at org.eclipse.emf.ecore.util.BasicSettingDelegate$Stateless.dynamicGet(BasicSettingDelegate.java:185)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1027)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1011)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)
at tupletest1.TestTuple.useDelegates(TestTuple.java:151)
at tupletest1.View.createPartControl(View.java:72)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:142)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:174)
at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:323)
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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:877)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:857)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:119)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:333)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:254)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:526)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:511)
at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:61)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:59)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:97)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:649)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:676)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1042)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at tupletest1.Application.start(Application.java:20)
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:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
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:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: org.eclipse.ocl.examples.domain.values.impl.InvalidValueException
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitLetExp(EvaluationVisitorImpl.java:578)
at org.eclipse.ocl.examples.pivot.internal.impl.LetExpImpl.accept(LetExpImpl.java:454)
at org.eclipse.ocl.examples.pivot.utilities.QueryImpl.evaluate(QueryImpl.java:197)
at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:72)
... 98 more
Caused by: org.eclipse.ocl.examples.domain.values.impl.InvalidValueException: Failed to evaluate temp::TestClass.opt() :
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:794)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:452)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitVariable(EvaluationVisitorImpl.java:934)
at org.eclipse.ocl.examples.pivot.internal.impl.VariableImpl.accept(VariableImpl.java:430)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitLetExp(EvaluationVisitorImpl.java:575)
... 101 more
Caused by: java.lang.NullPointerException
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:79)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:701)
... 105 more
Re: OCL Tuples in pivot [message #1162418 is a reply to message #1162253] Wed, 30 October 2013 07:05 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

I'm sorry. I have no more time to spend on your crazy code.

Regards

Ed Willink

On 30/10/2013 09:51, ModelGeek Mising name wrote:
> Sorry for giving incomplete information.
> You can run the plug-in as Eclipse Application (menu Run->Run As->Eclipse Application).
>
> The perspective/GUI is just for the testing... just ignore that.
> Dangling reference problem is solved (i added tupletype in package).
> I have also given names to tuple parts but still i am getting the same exception when i try to evaluate using dalegates.
>
> Please check the attached project. Thanks!
>
> org.eclipse.ocl.common.internal.delegate.OCLDelegateException: OCL evaluation result of 'temp::TestClass.test' is invalid
> at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:81)
> at org.eclipse.emf.ecore.util.BasicSettingDelegate$Stateless.dynamicGet(BasicSettingDelegate.java:185)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1027)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1011)
> at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)
> at tupletest1.TestTuple.useDelegates(TestTuple.java:151)
> at tupletest1.View.createPartControl(View.java:72)
> at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:142)
> at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:174)
> at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:323)
> 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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
> at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:877)
> at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:857)
> at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:119)
> at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:333)
> at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:254)
> at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
> at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$6.run(PartRenderingEngine.java:526)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:511)
> at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:61)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:949)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:633)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRenderer.processContents(PerspectiveRenderer.java:59)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103)
> at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:97)
> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.postProcess(PerspectiveStackRenderer.java:77)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:649)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:61)
> at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:676)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:645)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:735)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:706)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:700)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:685)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1042)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
> at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> at tupletest1.Application.start(Application.java:20)
> 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:354)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
> 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:636)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
> Caused by: org.eclipse.ocl.examples.domain.values.impl.InvalidValueException
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitLetExp(EvaluationVisitorImpl.java:578)
> at org.eclipse.ocl.examples.pivot.internal.impl.LetExpImpl.accept(LetExpImpl.java:454)
> at org.eclipse.ocl.examples.pivot.utilities.QueryImpl.evaluate(QueryImpl.java:197)
> at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:72)
> ... 98 more
> Caused by: org.eclipse.ocl.examples.domain.values.impl.InvalidValueException: Failed to evaluate temp::TestClass.opt() :
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:794)
> at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:452)
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitVariable(EvaluationVisitorImpl.java:934)
> at org.eclipse.ocl.examples.pivot.internal.impl.VariableImpl.accept(VariableImpl.java:430)
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitLetExp(EvaluationVisitorImpl.java:575)
> ... 101 more
> Caused by: java.lang.NullPointerException
> at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:79)
> at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:701)
> ... 105 more
>
Re: OCL Tuples in pivot [message #1162527 is a reply to message #1162418] Wed, 30 October 2013 08:44 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 500
Registered: June 2011
Senior Member
I understand that you are busy. I have created a simple ecore file. Please open the file in Kepler build. It contains one Class(TestClass) having one attribute(test) and one operation(opt). There is no validation error. Validation is successful, but when i try to instantiate the class (name = TestClass) then it give me the same error.


open the ecore in simple ecore model editor and right click the class(TestClass) and select "create dynamic instance", save the xmi file and open it in sample ecore reflective editor.

open first tree node for instance.

index.php/fa/16610/0/

thanks for your time
  • Attachment: tuple.ecore
    (Size: 2.12KB, Downloaded 18 times)
  • Attachment: tuple.png
    (Size: 47.62KB, Downloaded 177 times)
Re: OCL Tuples in pivot [message #1162668 is a reply to message #1162527] Wed, 30 October 2013 10:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

Your model has a variety of problems, most notably the use of "(" in
names rather than EGenericType.

Basically you seem to be trying to workaround
https://bugs.eclipse.org/bugs/show_bug.cgi?id=392059,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401938.

This bug is getting really irritating; must be time to fix it.

Regards

Ed Willink

On 30/10/2013 13:44, ModelGeek Mising name wrote:
> I understand that you are busy. I have created a simple ecore file. Please open the file in Kepler build. It contains one Class(TestClass) having one attribute(test) and one operation(opt). There is no validation error. Validation is successful, but when i try to instantiate the class (name = TestClass) then it give me the same error.
>
>
> open the ecore in simple ecore model editor and right click the class(TestClass) and select "create dynamic instance", save the xmi file and open it in sample ecore reflective editor.
>
> open first tree node for instance.
>
>
>
> thanks for your time
Re: OCL Tuples in pivot [message #1169876 is a reply to message #1162668] Mon, 04 November 2013 03:50 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 500
Registered: June 2011
Senior Member
Is this in your priority list? Do we expect it to be fixed in near future?

thanks for support!

Cheers,

Re: OCL Tuples in pivot [message #1169944 is a reply to message #1169876] Mon, 04 November 2013 04:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

It is my current coding activity.

But EclipseCon was last week.

This weekend we have a workshop to discuss directions for OCL 2.5.

So my coding activity is not 100%.

Regards

Ed Willink

On 04/11/2013 08:50, ModelGeek Mising name wrote:
> Is this in your priority list? Do we expect it to be fixed in near
> future?
>
> thanks for support!
>
> Cheers,
>
>
Re: OCL Tuples in pivot [message #1256258 is a reply to message #1169944] Tue, 25 February 2014 03:48 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 500
Registered: June 2011
Senior Member
Hi,

I have tried the same example again and in the latest version (eclipse.buildId=4.4.0.I20140123-1600) and i am getting the same problem. Are tuples still problematic in the latest version?

Cheers,
Re: OCL Tuples in pivot [message #1256327 is a reply to message #1256258] Tue, 25 February 2014 05:05 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4014
Registered: July 2009
Senior Member
Hi

It's still on my TODO list but not that close to the top I'm afraid.

Regards

Ed Willink


On 25/02/2014 08:48, ModelGeek Mising name wrote:
> Hi,
>
> I have tried the same example again and in the latest version
> (eclipse.buildId=4.4.0.I20140123-1600) and i am getting the same
> problem. Are tuples still problematic in the latest version?
>
> Cheers,
Previous Topic:How to Apply OCL code on Ecore KDM Model
Next Topic:OCL expression evaluation as "LHS"
Goto Forum:
  


Current Time: Thu Jul 31 13:38:01 EDT 2014

Powered by FUDForum. Page generated in 0.02112 seconds