Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Operation overriding : is this a bug in pivot delegates?
Operation overriding : is this a bug in pivot delegates? [message #1036608] Mon, 08 April 2013 15:54 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 516
Registered: June 2011
Senior Member
Hi,

I have attached ecore and xmi files. When i try to open xmi in editor then i get following error added in my error log panel.

I am using org.eclipse.ocl.examples.pivot 3.3.0.v20121102-1800


org.eclipse.ocl.common.internal.delegate.OCLDelegateException: OCL evaluation result of 'temp::Tester.total' is invalid
at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:78)
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 org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:998)
at org.eclipse.gmt.modisco.infra.browser.uicore.internal.model.AttributeItem.localGet(AttributeItem.java:112)
at org.eclipse.gmt.modisco.infra.browser.uicore.internal.model.AttributeItem.getCount(AttributeItem.java:80)
at org.eclipse.gmt.modisco.infra.browser.uicore.internal.model.AttributeItem.getForeground(AttributeItem.java:250)
at org.eclipse.gmt.modisco.infra.browser.editors.BrowserLabelProvider$ForegroundColorComputation.basicCompute(BrowserLabelProvider.java:125)
at org.eclipse.gmt.modisco.infra.browser.editors.BrowserLabelProvider$ForegroundColorComputation.basicCompute(BrowserLabelProvider.java:1)
at org.eclipse.gmt.modisco.infra.browser.editors.NonBlockingElementComputation$1.run(NonBlockingElementComputation.java:76)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.ocl.examples.domain.evaluation.InvalidValueException: parse failure
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.resolveExpressionInOCL(EObjectOperation.java:143)
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:65)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:674)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
at org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager.evaluateBody(EvaluatorIterationManager.java:123)
at org.eclipse.ocl.examples.library.iterator.CollectIteration.updateAccumulator(CollectIteration.java:41)
at org.eclipse.ocl.examples.domain.library.AbstractIteration.evaluateIteration(AbstractIteration.java:46)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:559)
at org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:74)
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:67)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:674)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
at org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager.evaluateBody(EvaluatorIterationManager.java:123)
at org.eclipse.ocl.examples.library.iterator.CollectIteration.updateAccumulator(CollectIteration.java:41)
at org.eclipse.ocl.examples.domain.library.AbstractIteration.evaluateIteration(AbstractIteration.java:46)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:559)
at org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:74)
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:67)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:674)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
at org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager.evaluateBody(EvaluatorIterationManager.java:123)
at org.eclipse.ocl.examples.library.iterator.CollectIteration.updateAccumulator(CollectIteration.java:41)
at org.eclipse.ocl.examples.domain.library.AbstractIteration.evaluateIteration(AbstractIteration.java:46)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:559)
at org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:74)
at org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:67)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:674)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
at org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager.evaluateBody(EvaluatorIterationManager.java:123)
at org.eclipse.ocl.examples.library.iterator.CollectIteration.updateAccumulator(CollectIteration.java:41)
at org.eclipse.ocl.examples.domain.library.AbstractIteration.evaluateIteration(AbstractIteration.java:46)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:559)
at org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:513)
at org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
at org.eclipse.ocl.examples.pivot.utilities.QueryImpl.evaluate(QueryImpl.java:197)
at org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:69)
... 12 more


Cheers,
Re: Operation overriding : is this a bug in pivot delegates? [message #1036627 is a reply to message #1036608] Mon, 08 April 2013 16:10 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4097
Registered: July 2009
Senior Member
Hi

No attachments!

OCL evaluation result of 'temp::Tester.total' is invalid

means that the evaluation resulted in the invalid value.

Caused by:
org.eclipse.ocl.examples.domain.evaluation.InvalidValueException: parse
failure

tells you it was invalid becuase the OLD couldn't be parsed.

....

Regards

Ed Willink


On 08/04/2013 16:54, ModelGeek Mising name wrote:
> Hi,
>
> I have attached ecore and xmi files. When i try to open xmi in editor
> then i get following error added in my error log panel.
>
> I am using org.eclipse.ocl.examples.pivot 3.3.0.v20121102-1800
>
>
> org.eclipse.ocl.common.internal.delegate.OCLDelegateException: OCL
> evaluation result of 'temp::Tester.total' is invalid
> at
> org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:78)
> 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
> org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:998)
> at
> org.eclipse.gmt.modisco.infra.browser.uicore.internal.model.AttributeItem.localGet(AttributeItem.java:112)
> at
> org.eclipse.gmt.modisco.infra.browser.uicore.internal.model.AttributeItem.getCount(AttributeItem.java:80)
> at
> org.eclipse.gmt.modisco.infra.browser.uicore.internal.model.AttributeItem.getForeground(AttributeItem.java:250)
> at
> org.eclipse.gmt.modisco.infra.browser.editors.BrowserLabelProvider$ForegroundColorComputation.basicCompute(BrowserLabelProvider.java:125)
> at
> org.eclipse.gmt.modisco.infra.browser.editors.BrowserLabelProvider$ForegroundColorComputation.basicCompute(BrowserLabelProvider.java:1)
> at
> org.eclipse.gmt.modisco.infra.browser.editors.NonBlockingElementComputation$1.run(NonBlockingElementComputation.java:76)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
> Caused by:
> org.eclipse.ocl.examples.domain.evaluation.InvalidValueException:
> parse failure
> at
> org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.resolveExpressionInOCL(EObjectOperation.java:143)
> at
> org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:65)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:674)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
> at
> org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager.evaluateBody(EvaluatorIterationManager.java:123)
> at
> org.eclipse.ocl.examples.library.iterator.CollectIteration.updateAccumulator(CollectIteration.java:41)
> at
> org.eclipse.ocl.examples.domain.library.AbstractIteration.evaluateIteration(AbstractIteration.java:46)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:559)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
> at
> org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:74)
> at
> org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:67)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:674)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
> at
> org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager.evaluateBody(EvaluatorIterationManager.java:123)
> at
> org.eclipse.ocl.examples.library.iterator.CollectIteration.updateAccumulator(CollectIteration.java:41)
> at
> org.eclipse.ocl.examples.domain.library.AbstractIteration.evaluateIteration(AbstractIteration.java:46)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:559)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
> at
> org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:74)
> at
> org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:67)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:674)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
> at
> org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager.evaluateBody(EvaluatorIterationManager.java:123)
> at
> org.eclipse.ocl.examples.library.iterator.CollectIteration.updateAccumulator(CollectIteration.java:41)
> at
> org.eclipse.ocl.examples.domain.library.AbstractIteration.evaluateIteration(AbstractIteration.java:46)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:559)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
> at
> org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:74)
> at
> org.eclipse.ocl.examples.pivot.ecore.EObjectOperation.evaluate(EObjectOperation.java:67)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:674)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.evaluate(EvaluationVisitorImpl.java:143)
> at
> org.eclipse.ocl.examples.domain.library.EvaluatorIterationManager.evaluateBody(EvaluatorIterationManager.java:123)
> at
> org.eclipse.ocl.examples.library.iterator.CollectIteration.updateAccumulator(CollectIteration.java:41)
> at
> org.eclipse.ocl.examples.domain.library.AbstractIteration.evaluateIteration(AbstractIteration.java:46)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:559)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:513)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.IteratorExpImpl.accept(IteratorExpImpl.java:1224)
> at
> org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:640)
> at
> org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:467)
> at
> org.eclipse.ocl.examples.pivot.utilities.QueryImpl.evaluate(QueryImpl.java:197)
> at
> org.eclipse.ocl.examples.pivot.delegate.OCLSettingDelegate.get(OCLSettingDelegate.java:69)
> ... 12 more
>
>
> Cheers,
Re: Operation overriding : is this a bug in pivot delegates? [message #1037159 is a reply to message #1036627] Tue, 09 April 2013 08:24 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 516
Registered: June 2011
Senior Member
Here comes ecore and xmi files.

Please check variable "total" in class "Tester" and its derivation statement is uing getConnections() operation from "super" class. Class "child1" and "child2" are inheriting from super and "child1" is overriding getConnections() operations.
If we do not use "child1" in XMI then it works fine but as with "child1" it is giving me earlier mentioned error.

Can you please check if it is a bug?

thanks for your support

Cheers
  • Attachment: test.ecore
    (Size: 3.72KB, Downloaded 41 times)
  • Attachment: Tester1.xmi
    (Size: 0.55KB, Downloaded 43 times)
Re: Operation overriding : is this a bug in pivot delegates? [message #1037174 is a reply to message #1037159] Tue, 09 April 2013 08:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4097
Registered: July 2009
Senior Member
Hi

You have given no clue as to how you execute so I cannot tell whether
you are using the Pivot or the LPG evaluator.

The Pivot support overriding by the identical signature.

The LPG support did not, but in Indigo a user preference is available to
enable dynamic dispatch.

Regards

Ed Willink


On 09/04/2013 09:24, ModelGeek Mising name wrote:
> Here comes ecore and xmi files.
>
> Please check variable "total" in class "Tester" and its derivation statement is uing getConnections() operation from "super" class. Class "child1" and "child2" are inheriting from super and "child1" is overriding getConnections() operations.
> If we do not use "child1" in XMI then it works fine but as with "child1" it is giving me earlier mentioned error.
>
> Can you please check if it is a bug?
>
> thanks for your support
>
> Cheers
Re: Operation overriding : is this a bug in pivot delegates? [message #1037196 is a reply to message #1037174] Tue, 09 April 2013 09:17 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 516
Registered: June 2011
Senior Member
I am using Pivot. There can be two ways to do that.

You can use given XMI file :

Please create new empty emf project. Import attached ecore and xmi files.
Open XMI file with "Sample Reflective Ecore editor" or with "General EMF editor". Select root object "Tester". It will show error.


Create new XMI file(better for understanding problem):
create ecore with following

import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';

package temp : Test = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
class super
{
operation getValue() : ecore::EDouble
{
body: 2;
}
operation getConnections() : super[*]
{
body: if target->notEmpty() then
target->collect(as : super | as.getConnections())->asSet()->union(target)
else
let next : Set(super) = Set{} in
next
endif;
}
property source#target : super[*];
property target#source : super[*] { ordered composes };
}
class Tester
{
attribute total : ecore::EDoubleObject { derived volatile }
{
derivation: self.super.getConnections().getValue()->sum();
}
property super : super[*] { composes };
}
class Child1 extends super
{
operation getValue() : ecore::EDouble
{
body: 1;
}
operation getConnections() : super[*]
{
body: if child2->isEmpty() then
child2.oclAsType(super)->collect(as : super | as.getConnections())->asSet()->union(child2)
else
let next : Set(super) = Set{} in
next
endif;
}
property child2#child1 : Child2[*];
}
class Child2 extends super
{
operation getValue() : ecore::EDouble
{
body: 1.5;
}
property child1#child2 : Child1[*] { ordered };
}
}

then open with "Sample Ecore Editor". Right click on "Tester" class and choose "Create Dynamic Instance". XMI file will be created. Open newly created XMI file in "Sample Reflective Ecore editor" and right click "Tester" and select menu add child -> "Super Super". It will add new instance of super. Now right click on newly created super object and and select menu add child -> "Super Super". It will also add new instance of super. Now if you will select root tester object and goto properiest pane, it will be showing you total = 2.
Now select the last added super object and right click and choose add child -> "Target Child1". Select the root Tester object and here it will be error.

child1 class is overriding methods available in super class and it seems like a bug in pivot.

[Updated on: Tue, 09 April 2013 09:37]

Report message to a moderator

Re: Operation overriding : is this a bug in pivot delegates? [message #1037361 is a reply to message #1037196] Tue, 09 April 2013 13:05 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4097
Registered: July 2009
Senior Member
On 09/04/2013 10:17, ModelGeek Mising name wrote:
> I am using Pivot. There can be two ways to do that.
>
> You can use given XMI file :
>
> Please create new empty emf project. Import attached ecore and xmi files.
> Open XMI file with "Sample Reflective Ecore editor" or with "General
> EMF editor". Select root object "Tester". It will show error.
Not for me.

You need to identify what error you see where.

Regards

Ed Willink
Re: Operation overriding : is this a bug in pivot delegates? [message #1037414 is a reply to message #1037196] Tue, 09 April 2013 14:28 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 516
Registered: June 2011
Senior Member
The bug i am suspecting in general is when you have a collection of type Generalization class(super in this example) and it contains objects for both generalzation and specialization classes(child1, child2) and specialization classes have overriden method(child1 in this example). Now if you want to loop through collection and want to call a method which is overridden in specialization then Pivot is unable to handle that.

If you remove all specialization objects then it will work fine or your sepcializations do not override methods then it will also work.

In ecore "Tester" contains list of "super" type. Class super contains getConnections() and getValue() methods. Child1 and Child2 are inheriting from super, child1 is overriding getConnection() and getValue() method method.

getConnections() method is supposed to return list of super type, so specializations override this method to give list.

Total tries to aggregate getvalue from all super type objects.
index.php/fa/14299/0/index.php/fa/14300/0/index.php/fa/14301/0/
  • Attachment: doesnotwork.png
    (Size: 35.14KB, Downloaded 159 times)
  • Attachment: works.png
    (Size: 11.19KB, Downloaded 151 times)

[Updated on: Tue, 09 April 2013 14:29]

Report message to a moderator

Re: Operation overriding : is this a bug in pivot delegates? [message #1037618 is a reply to message #1037414] Tue, 09 April 2013 20:04 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4097
Registered: July 2009
Senior Member
Hi

I don't get the error you see. Tester is shown with a 5.0 'label' suffix.

I suspect that I've fixed the bug that is troubling you.

Regards

Ed Willink


On 09/04/2013 15:28, ModelGeek Mising name wrote:
> The bug i am suspecting in general is when you have a collection of type Generalization class(super in this example) and it contains objects for both generalzation and specialization classes(child1, child2) and specialization classes have overriden method(child1 in this example). Now if you want to loop through collection and want to call a method which is overridden in specialization then Pivot is unable to handle that.
>
> If you remove all specialization objects then it will work fine or your sepcializations do not override methods then it will also work.
>
> In ecore "Tester" contains list of "super" type. Class super contains getConnections() and getValue() methods. Child1 and Child2 are inheriting from super, child1 is overriding getConnection() and getValue() method method.
>
> getConnections() method is supposed to return list of super type, so specializations override this method to give list.
>
> Total tries to aggregate getvalue from all super type objects.
>
Re: Operation overriding : is this a bug in pivot delegates? [message #1037931 is a reply to message #1037618] Wed, 10 April 2013 07:36 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 516
Registered: June 2011
Senior Member
May i know what version of related plugins are you using?

thanks for your support!

[Updated on: Wed, 10 April 2013 07:39]

Report message to a moderator

Re: Operation overriding : is this a bug in pivot delegates? [message #1038222 is a reply to message #1037931] Wed, 10 April 2013 15:18 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising name
Messages: 516
Registered: June 2011
Senior Member
I have updated my MDT-OCL plugins and it is working fine now.
Thanks!

One small thing, OCL validation is still gives an error message(Iterator variable must have same type as source element type ) for
self.anychildClass->reject(as : super | as.anybooleanOpt())) but delegates evalute that without any problem.

thanks again!
Re: Operation overriding : is this a bug in pivot delegates? [message #1038401 is a reply to message #1038222] Wed, 10 April 2013 20:35 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4097
Registered: July 2009
Senior Member
Hi

Your comments make no sense to me. You have been talking about the Pivot
evaluator and now complain about a message only produced by the LPG
evaluator.

A validation error means that a model is not well-formed; it is not a
guarantee of malfunction.

Regards

Ed Willink

On 10/04/2013 16:18, ModelGeek Mising name wrote:
> I have updated my MDT-OCL plugins and it is working fine now. Thanks!
>
> One small thing, OCL validation is still gives an error
> message(Iterator variable must have same type as source element type )
> for
> self.anychildClass->reject(as : super | as.anybooleanOpt())) but
> delegates evalute that without any problem.
>
> thanks again!
Previous Topic:OCL check programmatically
Next Topic:Specifying derived values in a UML model
Goto Forum:
  


Current Time: Sat Oct 25 00:47:13 GMT 2014

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

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